Skip to content

Commit

Permalink
Update xdr to pull in latest protocol 22 changes (#5457)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirms authored Sep 5, 2024
1 parent 676ad39 commit acfaa06
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ XDRS = $(DOWNLOADABLE_XDRS) xdr/Stellar-exporter.x


XDRGEN_COMMIT=e2cac557162d99b12ae73b846cf3d5bfe16636de
XDR_COMMIT=4ec28d95dd84b109253e22b151314478d6f00522
XDR_COMMIT=172a47c08cfbeb245e58dea5f840d1347f6b59d9

.PHONY: xdr xdr-clean xdr-update

Expand Down
150 changes: 144 additions & 6 deletions gxdr/xdr_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 48 additions & 1 deletion xdr/Stellar-contract-config-setting.x
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,54 @@ enum ContractCostType {
// point on a 256-bit elliptic curve
Sec1DecodePointUncompressed = 43,
// Cost of verifying an ECDSA Secp256r1 signature
VerifyEcdsaSecp256r1Sig = 44
VerifyEcdsaSecp256r1Sig = 44,

// Cost of encoding a BLS12-381 Fp (base field element)
Bls12381EncodeFp = 45,
// Cost of decoding a BLS12-381 Fp (base field element)
Bls12381DecodeFp = 46,
// Cost of validating a G1 point lies on the curve and belongs to the correct subgroup
Bls12381G1Validate = 47,
// Cost of validating a G2 point lies on the curve and belongs to the correct subgroup
Bls12381G2Validate = 48,
// Cost of converting a BLS12-381 G1 point from projective to affine coordinates
Bls12381G1ProjectiveToAffine = 49,
// Cost of converting a BLS12-381 G2 point from projective to affine coordinates
Bls12381G2ProjectiveToAffine = 50,
// Cost of performing BLS12-381 G1 point addition
Bls12381G1Add = 51,
// Cost of performing BLS12-381 G1 scalar multiplication
Bls12381G1Mul = 52,
// Cost of performing BLS12-381 G1 multi-scalar multiplication (MSM)
Bls12381G1Msm = 53,
// Cost of mapping a BLS12-381 Fp field element to a G1 point
Bls12381MapFpToG1 = 54,
// Cost of hashing to a BLS12-381 G1 point
Bls12381HashToG1 = 55,
// Cost of performing BLS12-381 G2 point addition
Bls12381G2Add = 56,
// Cost of performing BLS12-381 G2 scalar multiplication
Bls12381G2Mul = 57,
// Cost of performing BLS12-381 G2 multi-scalar multiplication (MSM)
Bls12381G2Msm = 58,
// Cost of mapping a BLS12-381 Fp2 field element to a G2 point
Bls12381MapFp2ToG2 = 59,
// Cost of hashing to a BLS12-381 G2 point
Bls12381HashToG2 = 60,
// Cost of performing BLS12-381 pairing operation
Bls12381Pairing = 61,
// Cost of converting a BLS12-381 scalar element from U256
Bls12381FrFromU256 = 62,
// Cost of converting a BLS12-381 scalar element to U256
Bls12381FrToU256 = 63,
// Cost of performing BLS12-381 scalar element addition/subtraction
Bls12381FrAddSub = 64,
// Cost of performing BLS12-381 scalar element multiplication
Bls12381FrMul = 65,
// Cost of performing BLS12-381 scalar element exponentiation
Bls12381FrPow = 66,
// Cost of performing BLS12-381 scalar element inversion
Bls12381FrInv = 67
};

struct ContractCostParamEntry {
Expand Down
5 changes: 4 additions & 1 deletion xdr/Stellar-contract-env-meta.x
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ enum SCEnvMetaKind
union SCEnvMetaEntry switch (SCEnvMetaKind kind)
{
case SC_ENV_META_KIND_INTERFACE_VERSION:
uint64 interfaceVersion;
struct {
uint32 protocol;
uint32 preRelease;
} interfaceVersion;
};

}
10 changes: 7 additions & 3 deletions xdr/Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -541,12 +541,16 @@ union SorobanAuthorizedFunction switch (SorobanAuthorizedFunctionType type)
{
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CONTRACT_FN:
InvokeContractArgs contractFn;
// This variant of auth payload for creating new contract instances is no
// longer accepted after protocol 22.
// This variant of auth payload for creating new contract instances
// doesn't allow specifying the constructor arguments, creating contracts
// with constructors that take arguments is only possible by authorizing
// `SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN`
// (protocol 22+).
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_HOST_FN:
CreateContractArgs createContractHostFn;
// This variant of auth payload for creating new contract instances
// is only accepted in and after protocol 22.
// is only accepted in and after protocol 22. It allows authorizing the
// contract constructor arguments.
case SOROBAN_AUTHORIZED_FUNCTION_TYPE_CREATE_CONTRACT_V2_HOST_FN:
CreateContractArgsV2 createContractV2HostFn;
};
Expand Down
2 changes: 1 addition & 1 deletion xdr/xdr_commit_generated.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ec28d95dd84b109253e22b151314478d6f00522
172a47c08cfbeb245e58dea5f840d1347f6b59d9
Loading

0 comments on commit acfaa06

Please sign in to comment.