diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b1bb80..0c00fe17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,14 @@ ## Unreleased -### Fixed -- The type definition for `Memo.hash` now allows `Buffer`s ([#698](https://github.com/stellar/js-stellar-base/pull/698)). +### Breaking Changes +* XDR has been upgraded to the latest stable version ([stellar-xdr@`6a620d1`](https://github.com/stellar/stellar-xdr/tree/6a620d160aab22609c982d54578ff6a63bfcdc01)). This is mostly renames, but it includes the following relevant breaking changes ([#704](https://github.com/stellar/js-stellar-base/pull/704)): + - `Operation.bumpFootprintExpiration` is now `extendFootprintTtl` and its `ledgersToExpire` field is now named `extendTo`, but it serves the same purpose. + - In TypeScript, the `Operation.BumpFootprintExpiration` is now `Operation.ExtendFootprintTTL` + - `xdr.ContractExecutable.contractExecutableToken` is now `contractExecutableStellarAsset` + - `xdr.SorobanTransactionData.refundableFee` is now `resourceFee` + - In turn, `SorobanDataBuilder.setRefundableFee` is now `setResourceFee` + - This new fee encompasses the entirety of the Soroban-related resource fees. Note that this is distinct from the "network-inclusion" fee that you would set on your transaction (i.e. `TransactionBuilder(..., { fee: ... })`). ## [`v10.0.0-beta.3`](https://github.com/stellar/js-stellar-base/compare/v10.0.0-beta.2...v10.0.0-beta.3) diff --git a/Makefile b/Makefile index c80c0a8a..ea3db5e7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/9ac02641139e6717924fdad716f6e958d0168491 +XDR_BASE_URL_CURR=https://github.com/stellar/stellar-xdr/raw/6a620d160aab22609c982d54578ff6a63bfcdc01 XDR_BASE_LOCAL_CURR=xdr/curr XDR_FILES_CURR= \ Stellar-SCP.x \ @@ -14,7 +14,7 @@ XDR_FILES_CURR= \ Stellar-contract-config-setting.x XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR)) -XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/440dc9512b6e72cf84965641c5eb495d6043ed73 +XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-xdr/raw/45fbdc24a3afaffdaa47bef4656f9945d1a63581 XDR_BASE_LOCAL_NEXT=xdr/next XDR_FILES_NEXT= \ Stellar-SCP.x \ diff --git a/src/generated/curr_generated.js b/src/generated/curr_generated.js index 713a0935..d5d413f4 100644 --- a/src/generated/curr_generated.js +++ b/src/generated/curr_generated.js @@ -476,7 +476,7 @@ var types = XDR.config((xdr) => { // CONTRACT_DATA = 6, // CONTRACT_CODE = 7, // CONFIG_SETTING = 8, - // EXPIRATION = 9 + // TTL = 9 // }; // // =========================================================================== @@ -490,7 +490,7 @@ var types = XDR.config((xdr) => { contractData: 6, contractCode: 7, configSetting: 8, - expiration: 9, + ttl: 9, }); // === xdr source ============================================================ @@ -1522,16 +1522,16 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct ExpirationEntry { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // struct TTLEntry { + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; - // uint32 expirationLedgerSeq; + // uint32 liveUntilLedgerSeq; // }; // // =========================================================================== - xdr.struct("ExpirationEntry", [ + xdr.struct("TtlEntry", [ ["keyHash", xdr.lookup("Hash")], - ["expirationLedgerSeq", xdr.lookup("Uint32")], + ["liveUntilLedgerSeq", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ @@ -1592,8 +1592,8 @@ var types = XDR.config((xdr) => { // ContractCodeEntry contractCode; // case CONFIG_SETTING: // ConfigSettingEntry configSetting; - // case EXPIRATION: - // ExpirationEntry expiration; + // case TTL: + // TTLEntry ttl; // } // // =========================================================================== @@ -1610,7 +1610,7 @@ var types = XDR.config((xdr) => { ["contractData", "contractData"], ["contractCode", "contractCode"], ["configSetting", "configSetting"], - ["expiration", "expiration"], + ["ttl", "ttl"], ], arms: { account: xdr.lookup("AccountEntry"), @@ -1622,7 +1622,7 @@ var types = XDR.config((xdr) => { contractData: xdr.lookup("ContractDataEntry"), contractCode: xdr.lookup("ContractCodeEntry"), configSetting: xdr.lookup("ConfigSettingEntry"), - expiration: xdr.lookup("ExpirationEntry"), + ttl: xdr.lookup("TtlEntry"), }, }); @@ -1675,8 +1675,8 @@ var types = XDR.config((xdr) => { // ContractCodeEntry contractCode; // case CONFIG_SETTING: // ConfigSettingEntry configSetting; - // case EXPIRATION: - // ExpirationEntry expiration; + // case TTL: + // TTLEntry ttl; // } // data; // @@ -1816,12 +1816,12 @@ var types = XDR.config((xdr) => { // // struct // { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; // } // // =========================================================================== - xdr.struct("LedgerKeyExpiration", [["keyHash", xdr.lookup("Hash")]]); + xdr.struct("LedgerKeyTtl", [["keyHash", xdr.lookup("Hash")]]); // === xdr source ============================================================ // @@ -1882,12 +1882,12 @@ var types = XDR.config((xdr) => { // { // ConfigSettingID configSettingID; // } configSetting; - // case EXPIRATION: + // case TTL: // struct // { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; - // } expiration; + // } ttl; // }; // // =========================================================================== @@ -1904,7 +1904,7 @@ var types = XDR.config((xdr) => { ["contractData", "contractData"], ["contractCode", "contractCode"], ["configSetting", "configSetting"], - ["expiration", "expiration"], + ["ttl", "ttl"], ], arms: { account: xdr.lookup("LedgerKeyAccount"), @@ -1916,7 +1916,7 @@ var types = XDR.config((xdr) => { contractData: xdr.lookup("LedgerKeyContractData"), contractCode: xdr.lookup("LedgerKeyContractCode"), configSetting: xdr.lookup("LedgerKeyConfigSetting"), - expiration: xdr.lookup("LedgerKeyExpiration"), + ttl: xdr.lookup("LedgerKeyTtl"), }, }); @@ -3049,43 +3049,8 @@ var types = XDR.config((xdr) => { // // struct LedgerCloseMetaV1 // { - // LedgerHeaderHistoryEntry ledgerHeader; - // - // GeneralizedTransactionSet txSet; - // - // // NB: transactions are sorted in apply order here - // // fees for all transactions are processed first - // // followed by applying transactions - // TransactionResultMeta txProcessing<>; - // - // // upgrades are applied last - // UpgradeEntryMeta upgradesProcessing<>; - // - // // other misc information attached to the ledger close - // SCPHistoryEntry scpInfo<>; - // }; - // - // =========================================================================== - xdr.struct("LedgerCloseMetaV1", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("GeneralizedTransactionSet")], - [ - "txProcessing", - xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), - ], - [ - "upgradesProcessing", - xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), - ], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], - ]); - - // === xdr source ============================================================ - // - // struct LedgerCloseMetaV2 - // { - // // We forgot to add an ExtensionPoint in v1 but at least - // // we can add one now in v2. + // // We forgot to add an ExtensionPoint in v0 but at least + // // we can add one now in v1. // ExtensionPoint ext; // // LedgerHeaderHistoryEntry ledgerHeader; @@ -3107,16 +3072,16 @@ var types = XDR.config((xdr) => { // // systems calculating storage fees correctly. // uint64 totalByteSizeOfBucketList; // - // // Expired temp keys that are being evicted at this ledger. + // // Temp keys that are being evicted at this ledger. // LedgerKey evictedTemporaryLedgerKeys<>; // - // // Expired restorable ledger entries that are being + // // Archived restorable ledger entries that are being // // evicted at this ledger. // LedgerEntry evictedPersistentLedgerEntries<>; // }; // // =========================================================================== - xdr.struct("LedgerCloseMetaV2", [ + xdr.struct("LedgerCloseMetaV1", [ ["ext", xdr.lookup("ExtensionPoint")], ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], ["txSet", xdr.lookup("GeneralizedTransactionSet")], @@ -3148,8 +3113,6 @@ var types = XDR.config((xdr) => { // LedgerCloseMetaV0 v0; // case 1: // LedgerCloseMetaV1 v1; - // case 2: - // LedgerCloseMetaV2 v2; // }; // // =========================================================================== @@ -3159,12 +3122,10 @@ var types = XDR.config((xdr) => { switches: [ [0, "v0"], [1, "v1"], - [2, "v2"], ], arms: { v0: xdr.lookup("LedgerCloseMetaV0"), v1: xdr.lookup("LedgerCloseMetaV1"), - v2: xdr.lookup("LedgerCloseMetaV2"), }, }); @@ -3944,7 +3905,7 @@ var types = XDR.config((xdr) => { // LIQUIDITY_POOL_DEPOSIT = 22, // LIQUIDITY_POOL_WITHDRAW = 23, // INVOKE_HOST_FUNCTION = 24, - // BUMP_FOOTPRINT_EXPIRATION = 25, + // EXTEND_FOOTPRINT_TTL = 25, // RESTORE_FOOTPRINT = 26 // }; // @@ -3975,7 +3936,7 @@ var types = XDR.config((xdr) => { liquidityPoolDeposit: 22, liquidityPoolWithdraw: 23, invokeHostFunction: 24, - bumpFootprintExpiration: 25, + extendFootprintTtl: 25, restoreFootprint: 26, }); @@ -4715,16 +4676,16 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct BumpFootprintExpirationOp + // struct ExtendFootprintTTLOp // { // ExtensionPoint ext; - // uint32 ledgersToExpire; + // uint32 extendTo; // }; // // =========================================================================== - xdr.struct("BumpFootprintExpirationOp", [ + xdr.struct("ExtendFootprintTtlOp", [ ["ext", xdr.lookup("ExtensionPoint")], - ["ledgersToExpire", xdr.lookup("Uint32")], + ["extendTo", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ @@ -4791,8 +4752,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionOp invokeHostFunctionOp; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLOp extendFootprintTTLOp; // case RESTORE_FOOTPRINT: // RestoreFootprintOp restoreFootprintOp; // } @@ -4827,7 +4788,7 @@ var types = XDR.config((xdr) => { ["liquidityPoolDeposit", "liquidityPoolDepositOp"], ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], ["invokeHostFunction", "invokeHostFunctionOp"], - ["bumpFootprintExpiration", "bumpFootprintExpirationOp"], + ["extendFootprintTtl", "extendFootprintTtlOp"], ["restoreFootprint", "restoreFootprintOp"], ], arms: { @@ -4856,7 +4817,7 @@ var types = XDR.config((xdr) => { liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), invokeHostFunctionOp: xdr.lookup("InvokeHostFunctionOp"), - bumpFootprintExpirationOp: xdr.lookup("BumpFootprintExpirationOp"), + extendFootprintTtlOp: xdr.lookup("ExtendFootprintTtlOp"), restoreFootprintOp: xdr.lookup("RestoreFootprintOp"), }, }); @@ -4922,8 +4883,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionOp invokeHostFunctionOp; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLOp extendFootprintTTLOp; // case RESTORE_FOOTPRINT: // RestoreFootprintOp restoreFootprintOp; // } @@ -5272,15 +5233,23 @@ var types = XDR.config((xdr) => { // { // ExtensionPoint ext; // SorobanResources resources; - // // Portion of transaction `fee` allocated to refundable fees. - // int64 refundableFee; + // // Amount of the transaction `fee` allocated to the Soroban resource fees. + // // The fraction of `resourceFee` corresponding to `resources` specified + // // above is *not* refundable (i.e. fees for instructions, ledger I/O), as + // // well as fees for the transaction size. + // // The remaining part of the fee is refundable and the charged value is + // // based on the actual consumption of refundable resources (events, ledger + // // rent bumps). + // // The `inclusionFee` used for prioritization of the transaction is defined + // // as `tx.fee - resourceFee`. + // int64 resourceFee; // }; // // =========================================================================== xdr.struct("SorobanTransactionData", [ ["ext", xdr.lookup("ExtensionPoint")], ["resources", xdr.lookup("SorobanResources")], - ["refundableFee", xdr.lookup("Int64")], + ["resourceFee", xdr.lookup("Int64")], ]); // === xdr source ============================================================ @@ -7256,7 +7225,7 @@ var types = XDR.config((xdr) => { // INVOKE_HOST_FUNCTION_MALFORMED = -1, // INVOKE_HOST_FUNCTION_TRAPPED = -2, // INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, - // INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + // INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, // INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 // }; // @@ -7266,7 +7235,7 @@ var types = XDR.config((xdr) => { invokeHostFunctionMalformed: -1, invokeHostFunctionTrapped: -2, invokeHostFunctionResourceLimitExceeded: -3, - invokeHostFunctionEntryExpired: -4, + invokeHostFunctionEntryArchived: -4, invokeHostFunctionInsufficientRefundableFee: -5, }); @@ -7279,7 +7248,7 @@ var types = XDR.config((xdr) => { // case INVOKE_HOST_FUNCTION_MALFORMED: // case INVOKE_HOST_FUNCTION_TRAPPED: // case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: - // case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: + // case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED: // case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: // void; // }; @@ -7293,7 +7262,7 @@ var types = XDR.config((xdr) => { ["invokeHostFunctionMalformed", xdr.void()], ["invokeHostFunctionTrapped", xdr.void()], ["invokeHostFunctionResourceLimitExceeded", xdr.void()], - ["invokeHostFunctionEntryExpired", xdr.void()], + ["invokeHostFunctionEntryArchived", xdr.void()], ["invokeHostFunctionInsufficientRefundableFee", xdr.void()], ], arms: { @@ -7303,46 +7272,46 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // enum BumpFootprintExpirationResultCode + // enum ExtendFootprintTTLResultCode // { // // codes considered as "success" for the operation - // BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + // EXTEND_FOOTPRINT_TTL_SUCCESS = 0, // // // codes considered as "failure" for the operation - // BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, - // BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, - // BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + // EXTEND_FOOTPRINT_TTL_MALFORMED = -1, + // EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2, + // EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3 // }; // // =========================================================================== - xdr.enum("BumpFootprintExpirationResultCode", { - bumpFootprintExpirationSuccess: 0, - bumpFootprintExpirationMalformed: -1, - bumpFootprintExpirationResourceLimitExceeded: -2, - bumpFootprintExpirationInsufficientRefundableFee: -3, + xdr.enum("ExtendFootprintTtlResultCode", { + extendFootprintTtlSuccess: 0, + extendFootprintTtlMalformed: -1, + extendFootprintTtlResourceLimitExceeded: -2, + extendFootprintTtlInsufficientRefundableFee: -3, }); // === xdr source ============================================================ // - // union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) + // union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code) // { - // case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + // case EXTEND_FOOTPRINT_TTL_SUCCESS: // void; - // case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: - // case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: - // case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + // case EXTEND_FOOTPRINT_TTL_MALFORMED: + // case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED: + // case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE: // void; // }; // // =========================================================================== - xdr.union("BumpFootprintExpirationResult", { - switchOn: xdr.lookup("BumpFootprintExpirationResultCode"), + xdr.union("ExtendFootprintTtlResult", { + switchOn: xdr.lookup("ExtendFootprintTtlResultCode"), switchName: "code", switches: [ - ["bumpFootprintExpirationSuccess", xdr.void()], - ["bumpFootprintExpirationMalformed", xdr.void()], - ["bumpFootprintExpirationResourceLimitExceeded", xdr.void()], - ["bumpFootprintExpirationInsufficientRefundableFee", xdr.void()], + ["extendFootprintTtlSuccess", xdr.void()], + ["extendFootprintTtlMalformed", xdr.void()], + ["extendFootprintTtlResourceLimitExceeded", xdr.void()], + ["extendFootprintTtlInsufficientRefundableFee", xdr.void()], ], arms: {}, }); @@ -7472,8 +7441,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionResult invokeHostFunctionResult; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLResult extendFootprintTTLResult; // case RESTORE_FOOTPRINT: // RestoreFootprintResult restoreFootprintResult; // } @@ -7508,7 +7477,7 @@ var types = XDR.config((xdr) => { ["liquidityPoolDeposit", "liquidityPoolDepositResult"], ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], ["invokeHostFunction", "invokeHostFunctionResult"], - ["bumpFootprintExpiration", "bumpFootprintExpirationResult"], + ["extendFootprintTtl", "extendFootprintTtlResult"], ["restoreFootprint", "restoreFootprintResult"], ], arms: { @@ -7545,9 +7514,7 @@ var types = XDR.config((xdr) => { liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), invokeHostFunctionResult: xdr.lookup("InvokeHostFunctionResult"), - bumpFootprintExpirationResult: xdr.lookup( - "BumpFootprintExpirationResult" - ), + extendFootprintTtlResult: xdr.lookup("ExtendFootprintTtlResult"), restoreFootprintResult: xdr.lookup("RestoreFootprintResult"), }, }); @@ -7609,8 +7576,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionResult invokeHostFunctionResult; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLResult extendFootprintTTLResult; // case RESTORE_FOOTPRINT: // RestoreFootprintResult restoreFootprintResult; // } @@ -8468,13 +8435,13 @@ var types = XDR.config((xdr) => { // enum ContractExecutableType // { // CONTRACT_EXECUTABLE_WASM = 0, - // CONTRACT_EXECUTABLE_TOKEN = 1 + // CONTRACT_EXECUTABLE_STELLAR_ASSET = 1 // }; // // =========================================================================== xdr.enum("ContractExecutableType", { contractExecutableWasm: 0, - contractExecutableToken: 1, + contractExecutableStellarAsset: 1, }); // === xdr source ============================================================ @@ -8483,7 +8450,7 @@ var types = XDR.config((xdr) => { // { // case CONTRACT_EXECUTABLE_WASM: // Hash wasm_hash; - // case CONTRACT_EXECUTABLE_TOKEN: + // case CONTRACT_EXECUTABLE_STELLAR_ASSET: // void; // }; // @@ -8493,7 +8460,7 @@ var types = XDR.config((xdr) => { switchName: "type", switches: [ ["contractExecutableWasm", "wasmHash"], - ["contractExecutableToken", xdr.void()], + ["contractExecutableStellarAsset", xdr.void()], ], arms: { wasmHash: xdr.lookup("Hash"), @@ -9465,96 +9432,81 @@ var types = XDR.config((xdr) => { // enum ContractCostType { // // Cost of running 1 wasm instruction // WasmInsnExec = 0, - // // Cost of growing wasm linear memory by 1 page - // WasmMemAlloc = 1, - // // Cost of allocating a chuck of host memory (in bytes) - // HostMemAlloc = 2, - // // Cost of copying a chuck of bytes into a pre-allocated host memory - // HostMemCpy = 3, - // // Cost of comparing two slices of host memory - // HostMemCmp = 4, + // // Cost of allocating a slice of memory (in bytes) + // MemAlloc = 1, + // // Cost of copying a slice of bytes into a pre-allocated memory + // MemCpy = 2, + // // Cost of comparing two slices of memory + // MemCmp = 3, // // Cost of a host function dispatch, not including the actual work done by // // the function nor the cost of VM invocation machinary - // DispatchHostFunction = 5, + // DispatchHostFunction = 4, // // Cost of visiting a host object from the host object storage. Exists to // // make sure some baseline cost coverage, i.e. repeatly visiting objects // // by the guest will always incur some charges. - // VisitObject = 6, + // VisitObject = 5, // // Cost of serializing an xdr object to bytes - // ValSer = 7, + // ValSer = 6, // // Cost of deserializing an xdr object from bytes - // ValDeser = 8, + // ValDeser = 7, // // Cost of computing the sha256 hash from bytes - // ComputeSha256Hash = 9, + // ComputeSha256Hash = 8, // // Cost of computing the ed25519 pubkey from bytes - // ComputeEd25519PubKey = 10, - // // Cost of accessing an entry in a Map. - // MapEntry = 11, - // // Cost of accessing an entry in a Vec - // VecEntry = 12, + // ComputeEd25519PubKey = 9, // // Cost of verifying ed25519 signature of a payload. - // VerifyEd25519Sig = 13, - // // Cost of reading a slice of vm linear memory - // VmMemRead = 14, - // // Cost of writing to a slice of vm linear memory - // VmMemWrite = 15, + // VerifyEd25519Sig = 10, // // Cost of instantiation a VM from wasm bytes code. - // VmInstantiation = 16, + // VmInstantiation = 11, // // Cost of instantiation a VM from a cached state. - // VmCachedInstantiation = 17, + // VmCachedInstantiation = 12, // // Cost of invoking a function on the VM. If the function is a host function, // // additional cost will be covered by `DispatchHostFunction`. - // InvokeVmFunction = 18, + // InvokeVmFunction = 13, // // Cost of computing a keccak256 hash from bytes. - // ComputeKeccak256Hash = 19, - // // Cost of computing an ECDSA secp256k1 pubkey from bytes. - // ComputeEcdsaSecp256k1Key = 20, + // ComputeKeccak256Hash = 14, // // Cost of computing an ECDSA secp256k1 signature from bytes. - // ComputeEcdsaSecp256k1Sig = 21, + // ComputeEcdsaSecp256k1Sig = 15, // // Cost of recovering an ECDSA secp256k1 key from a signature. - // RecoverEcdsaSecp256k1Key = 22, + // RecoverEcdsaSecp256k1Key = 16, // // Cost of int256 addition (`+`) and subtraction (`-`) operations - // Int256AddSub = 23, + // Int256AddSub = 17, // // Cost of int256 multiplication (`*`) operation - // Int256Mul = 24, + // Int256Mul = 18, // // Cost of int256 division (`/`) operation - // Int256Div = 25, + // Int256Div = 19, // // Cost of int256 power (`exp`) operation - // Int256Pow = 26, + // Int256Pow = 20, // // Cost of int256 shift (`shl`, `shr`) operation - // Int256Shift = 27 + // Int256Shift = 21, + // // Cost of drawing random bytes using a ChaCha20 PRNG + // ChaCha20DrawBytes = 22 // }; // // =========================================================================== xdr.enum("ContractCostType", { wasmInsnExec: 0, - wasmMemAlloc: 1, - hostMemAlloc: 2, - hostMemCpy: 3, - hostMemCmp: 4, - dispatchHostFunction: 5, - visitObject: 6, - valSer: 7, - valDeser: 8, - computeSha256Hash: 9, - computeEd25519PubKey: 10, - mapEntry: 11, - vecEntry: 12, - verifyEd25519Sig: 13, - vmMemRead: 14, - vmMemWrite: 15, - vmInstantiation: 16, - vmCachedInstantiation: 17, - invokeVmFunction: 18, - computeKeccak256Hash: 19, - computeEcdsaSecp256k1Key: 20, - computeEcdsaSecp256k1Sig: 21, - recoverEcdsaSecp256k1Key: 22, - int256AddSub: 23, - int256Mul: 24, - int256Div: 25, - int256Pow: 26, - int256Shift: 27, + memAlloc: 1, + memCpy: 2, + memCmp: 3, + dispatchHostFunction: 4, + visitObject: 5, + valSer: 6, + valDeser: 7, + computeSha256Hash: 8, + computeEd25519PubKey: 9, + verifyEd25519Sig: 10, + vmInstantiation: 11, + vmCachedInstantiation: 12, + invokeVmFunction: 13, + computeKeccak256Hash: 14, + computeEcdsaSecp256k1Sig: 15, + recoverEcdsaSecp256k1Key: 16, + int256AddSub: 17, + int256Mul: 18, + int256Div: 19, + int256Pow: 20, + int256Shift: 21, + chaCha20DrawBytes: 22, }); // === xdr source ============================================================ @@ -9576,17 +9528,17 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct StateExpirationSettings { - // uint32 maxEntryExpiration; - // uint32 minTempEntryExpiration; - // uint32 minPersistentEntryExpiration; + // struct StateArchivalSettings { + // uint32 maxEntryTTL; + // uint32 minTemporaryTTL; + // uint32 minPersistentTTL; // // // rent_fee = wfee_rate_average / rent_rate_denominator_for_type // int64 persistentRentRateDenominator; // int64 tempRentRateDenominator; // - // // max number of entries that emit expiration meta in a single ledger - // uint32 maxEntriesToExpire; + // // max number of entries that emit archival meta in a single ledger + // uint32 maxEntriesToArchive; // // // Number of snapshots to use when calculating average BucketList size // uint32 bucketListSizeWindowSampleSize; @@ -9599,13 +9551,13 @@ var types = XDR.config((xdr) => { // }; // // =========================================================================== - xdr.struct("StateExpirationSettings", [ - ["maxEntryExpiration", xdr.lookup("Uint32")], - ["minTempEntryExpiration", xdr.lookup("Uint32")], - ["minPersistentEntryExpiration", xdr.lookup("Uint32")], + xdr.struct("StateArchivalSettings", [ + ["maxEntryTtl", xdr.lookup("Uint32")], + ["minTemporaryTtl", xdr.lookup("Uint32")], + ["minPersistentTtl", xdr.lookup("Uint32")], ["persistentRentRateDenominator", xdr.lookup("Int64")], ["tempRentRateDenominator", xdr.lookup("Int64")], - ["maxEntriesToExpire", xdr.lookup("Uint32")], + ["maxEntriesToArchive", xdr.lookup("Uint32")], ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], ["evictionScanSize", xdr.lookup("Uint64")], ["startingEvictionScanLevel", xdr.lookup("Uint32")], @@ -9660,7 +9612,7 @@ var types = XDR.config((xdr) => { // CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, // CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, - // CONFIG_SETTING_STATE_EXPIRATION = 10, + // CONFIG_SETTING_STATE_ARCHIVAL = 10, // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, // CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, // CONFIG_SETTING_EVICTION_ITERATOR = 13 @@ -9678,7 +9630,7 @@ var types = XDR.config((xdr) => { configSettingContractCostParamsMemoryBytes: 7, configSettingContractDataKeySizeBytes: 8, configSettingContractDataEntrySizeBytes: 9, - configSettingStateExpiration: 10, + configSettingStateArchival: 10, configSettingContractExecutionLanes: 11, configSettingBucketlistSizeWindow: 12, configSettingEvictionIterator: 13, @@ -9708,8 +9660,8 @@ var types = XDR.config((xdr) => { // uint32 contractDataKeySizeBytes; // case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: // uint32 contractDataEntrySizeBytes; - // case CONFIG_SETTING_STATE_EXPIRATION: - // StateExpirationSettings stateExpirationSettings; + // case CONFIG_SETTING_STATE_ARCHIVAL: + // StateArchivalSettings stateArchivalSettings; // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; // case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: @@ -9739,7 +9691,7 @@ var types = XDR.config((xdr) => { ], ["configSettingContractDataKeySizeBytes", "contractDataKeySizeBytes"], ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], - ["configSettingStateExpiration", "stateExpirationSettings"], + ["configSettingStateArchival", "stateArchivalSettings"], ["configSettingContractExecutionLanes", "contractExecutionLanes"], ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], ["configSettingEvictionIterator", "evictionIterator"], @@ -9757,7 +9709,7 @@ var types = XDR.config((xdr) => { contractCostParamsMemBytes: xdr.lookup("ContractCostParams"), contractDataKeySizeBytes: xdr.lookup("Uint32"), contractDataEntrySizeBytes: xdr.lookup("Uint32"), - stateExpirationSettings: xdr.lookup("StateExpirationSettings"), + stateArchivalSettings: xdr.lookup("StateArchivalSettings"), contractExecutionLanes: xdr.lookup( "ConfigSettingContractExecutionLanesV0" ), diff --git a/src/generated/next_generated.js b/src/generated/next_generated.js index 713a0935..d5d413f4 100644 --- a/src/generated/next_generated.js +++ b/src/generated/next_generated.js @@ -476,7 +476,7 @@ var types = XDR.config((xdr) => { // CONTRACT_DATA = 6, // CONTRACT_CODE = 7, // CONFIG_SETTING = 8, - // EXPIRATION = 9 + // TTL = 9 // }; // // =========================================================================== @@ -490,7 +490,7 @@ var types = XDR.config((xdr) => { contractData: 6, contractCode: 7, configSetting: 8, - expiration: 9, + ttl: 9, }); // === xdr source ============================================================ @@ -1522,16 +1522,16 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct ExpirationEntry { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // struct TTLEntry { + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; - // uint32 expirationLedgerSeq; + // uint32 liveUntilLedgerSeq; // }; // // =========================================================================== - xdr.struct("ExpirationEntry", [ + xdr.struct("TtlEntry", [ ["keyHash", xdr.lookup("Hash")], - ["expirationLedgerSeq", xdr.lookup("Uint32")], + ["liveUntilLedgerSeq", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ @@ -1592,8 +1592,8 @@ var types = XDR.config((xdr) => { // ContractCodeEntry contractCode; // case CONFIG_SETTING: // ConfigSettingEntry configSetting; - // case EXPIRATION: - // ExpirationEntry expiration; + // case TTL: + // TTLEntry ttl; // } // // =========================================================================== @@ -1610,7 +1610,7 @@ var types = XDR.config((xdr) => { ["contractData", "contractData"], ["contractCode", "contractCode"], ["configSetting", "configSetting"], - ["expiration", "expiration"], + ["ttl", "ttl"], ], arms: { account: xdr.lookup("AccountEntry"), @@ -1622,7 +1622,7 @@ var types = XDR.config((xdr) => { contractData: xdr.lookup("ContractDataEntry"), contractCode: xdr.lookup("ContractCodeEntry"), configSetting: xdr.lookup("ConfigSettingEntry"), - expiration: xdr.lookup("ExpirationEntry"), + ttl: xdr.lookup("TtlEntry"), }, }); @@ -1675,8 +1675,8 @@ var types = XDR.config((xdr) => { // ContractCodeEntry contractCode; // case CONFIG_SETTING: // ConfigSettingEntry configSetting; - // case EXPIRATION: - // ExpirationEntry expiration; + // case TTL: + // TTLEntry ttl; // } // data; // @@ -1816,12 +1816,12 @@ var types = XDR.config((xdr) => { // // struct // { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; // } // // =========================================================================== - xdr.struct("LedgerKeyExpiration", [["keyHash", xdr.lookup("Hash")]]); + xdr.struct("LedgerKeyTtl", [["keyHash", xdr.lookup("Hash")]]); // === xdr source ============================================================ // @@ -1882,12 +1882,12 @@ var types = XDR.config((xdr) => { // { // ConfigSettingID configSettingID; // } configSetting; - // case EXPIRATION: + // case TTL: // struct // { - // // Hash of the LedgerKey that is associated with this ExpirationEntry + // // Hash of the LedgerKey that is associated with this TTLEntry // Hash keyHash; - // } expiration; + // } ttl; // }; // // =========================================================================== @@ -1904,7 +1904,7 @@ var types = XDR.config((xdr) => { ["contractData", "contractData"], ["contractCode", "contractCode"], ["configSetting", "configSetting"], - ["expiration", "expiration"], + ["ttl", "ttl"], ], arms: { account: xdr.lookup("LedgerKeyAccount"), @@ -1916,7 +1916,7 @@ var types = XDR.config((xdr) => { contractData: xdr.lookup("LedgerKeyContractData"), contractCode: xdr.lookup("LedgerKeyContractCode"), configSetting: xdr.lookup("LedgerKeyConfigSetting"), - expiration: xdr.lookup("LedgerKeyExpiration"), + ttl: xdr.lookup("LedgerKeyTtl"), }, }); @@ -3049,43 +3049,8 @@ var types = XDR.config((xdr) => { // // struct LedgerCloseMetaV1 // { - // LedgerHeaderHistoryEntry ledgerHeader; - // - // GeneralizedTransactionSet txSet; - // - // // NB: transactions are sorted in apply order here - // // fees for all transactions are processed first - // // followed by applying transactions - // TransactionResultMeta txProcessing<>; - // - // // upgrades are applied last - // UpgradeEntryMeta upgradesProcessing<>; - // - // // other misc information attached to the ledger close - // SCPHistoryEntry scpInfo<>; - // }; - // - // =========================================================================== - xdr.struct("LedgerCloseMetaV1", [ - ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], - ["txSet", xdr.lookup("GeneralizedTransactionSet")], - [ - "txProcessing", - xdr.varArray(xdr.lookup("TransactionResultMeta"), 2147483647), - ], - [ - "upgradesProcessing", - xdr.varArray(xdr.lookup("UpgradeEntryMeta"), 2147483647), - ], - ["scpInfo", xdr.varArray(xdr.lookup("ScpHistoryEntry"), 2147483647)], - ]); - - // === xdr source ============================================================ - // - // struct LedgerCloseMetaV2 - // { - // // We forgot to add an ExtensionPoint in v1 but at least - // // we can add one now in v2. + // // We forgot to add an ExtensionPoint in v0 but at least + // // we can add one now in v1. // ExtensionPoint ext; // // LedgerHeaderHistoryEntry ledgerHeader; @@ -3107,16 +3072,16 @@ var types = XDR.config((xdr) => { // // systems calculating storage fees correctly. // uint64 totalByteSizeOfBucketList; // - // // Expired temp keys that are being evicted at this ledger. + // // Temp keys that are being evicted at this ledger. // LedgerKey evictedTemporaryLedgerKeys<>; // - // // Expired restorable ledger entries that are being + // // Archived restorable ledger entries that are being // // evicted at this ledger. // LedgerEntry evictedPersistentLedgerEntries<>; // }; // // =========================================================================== - xdr.struct("LedgerCloseMetaV2", [ + xdr.struct("LedgerCloseMetaV1", [ ["ext", xdr.lookup("ExtensionPoint")], ["ledgerHeader", xdr.lookup("LedgerHeaderHistoryEntry")], ["txSet", xdr.lookup("GeneralizedTransactionSet")], @@ -3148,8 +3113,6 @@ var types = XDR.config((xdr) => { // LedgerCloseMetaV0 v0; // case 1: // LedgerCloseMetaV1 v1; - // case 2: - // LedgerCloseMetaV2 v2; // }; // // =========================================================================== @@ -3159,12 +3122,10 @@ var types = XDR.config((xdr) => { switches: [ [0, "v0"], [1, "v1"], - [2, "v2"], ], arms: { v0: xdr.lookup("LedgerCloseMetaV0"), v1: xdr.lookup("LedgerCloseMetaV1"), - v2: xdr.lookup("LedgerCloseMetaV2"), }, }); @@ -3944,7 +3905,7 @@ var types = XDR.config((xdr) => { // LIQUIDITY_POOL_DEPOSIT = 22, // LIQUIDITY_POOL_WITHDRAW = 23, // INVOKE_HOST_FUNCTION = 24, - // BUMP_FOOTPRINT_EXPIRATION = 25, + // EXTEND_FOOTPRINT_TTL = 25, // RESTORE_FOOTPRINT = 26 // }; // @@ -3975,7 +3936,7 @@ var types = XDR.config((xdr) => { liquidityPoolDeposit: 22, liquidityPoolWithdraw: 23, invokeHostFunction: 24, - bumpFootprintExpiration: 25, + extendFootprintTtl: 25, restoreFootprint: 26, }); @@ -4715,16 +4676,16 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct BumpFootprintExpirationOp + // struct ExtendFootprintTTLOp // { // ExtensionPoint ext; - // uint32 ledgersToExpire; + // uint32 extendTo; // }; // // =========================================================================== - xdr.struct("BumpFootprintExpirationOp", [ + xdr.struct("ExtendFootprintTtlOp", [ ["ext", xdr.lookup("ExtensionPoint")], - ["ledgersToExpire", xdr.lookup("Uint32")], + ["extendTo", xdr.lookup("Uint32")], ]); // === xdr source ============================================================ @@ -4791,8 +4752,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionOp invokeHostFunctionOp; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLOp extendFootprintTTLOp; // case RESTORE_FOOTPRINT: // RestoreFootprintOp restoreFootprintOp; // } @@ -4827,7 +4788,7 @@ var types = XDR.config((xdr) => { ["liquidityPoolDeposit", "liquidityPoolDepositOp"], ["liquidityPoolWithdraw", "liquidityPoolWithdrawOp"], ["invokeHostFunction", "invokeHostFunctionOp"], - ["bumpFootprintExpiration", "bumpFootprintExpirationOp"], + ["extendFootprintTtl", "extendFootprintTtlOp"], ["restoreFootprint", "restoreFootprintOp"], ], arms: { @@ -4856,7 +4817,7 @@ var types = XDR.config((xdr) => { liquidityPoolDepositOp: xdr.lookup("LiquidityPoolDepositOp"), liquidityPoolWithdrawOp: xdr.lookup("LiquidityPoolWithdrawOp"), invokeHostFunctionOp: xdr.lookup("InvokeHostFunctionOp"), - bumpFootprintExpirationOp: xdr.lookup("BumpFootprintExpirationOp"), + extendFootprintTtlOp: xdr.lookup("ExtendFootprintTtlOp"), restoreFootprintOp: xdr.lookup("RestoreFootprintOp"), }, }); @@ -4922,8 +4883,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionOp invokeHostFunctionOp; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationOp bumpFootprintExpirationOp; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLOp extendFootprintTTLOp; // case RESTORE_FOOTPRINT: // RestoreFootprintOp restoreFootprintOp; // } @@ -5272,15 +5233,23 @@ var types = XDR.config((xdr) => { // { // ExtensionPoint ext; // SorobanResources resources; - // // Portion of transaction `fee` allocated to refundable fees. - // int64 refundableFee; + // // Amount of the transaction `fee` allocated to the Soroban resource fees. + // // The fraction of `resourceFee` corresponding to `resources` specified + // // above is *not* refundable (i.e. fees for instructions, ledger I/O), as + // // well as fees for the transaction size. + // // The remaining part of the fee is refundable and the charged value is + // // based on the actual consumption of refundable resources (events, ledger + // // rent bumps). + // // The `inclusionFee` used for prioritization of the transaction is defined + // // as `tx.fee - resourceFee`. + // int64 resourceFee; // }; // // =========================================================================== xdr.struct("SorobanTransactionData", [ ["ext", xdr.lookup("ExtensionPoint")], ["resources", xdr.lookup("SorobanResources")], - ["refundableFee", xdr.lookup("Int64")], + ["resourceFee", xdr.lookup("Int64")], ]); // === xdr source ============================================================ @@ -7256,7 +7225,7 @@ var types = XDR.config((xdr) => { // INVOKE_HOST_FUNCTION_MALFORMED = -1, // INVOKE_HOST_FUNCTION_TRAPPED = -2, // INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, - // INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + // INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, // INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 // }; // @@ -7266,7 +7235,7 @@ var types = XDR.config((xdr) => { invokeHostFunctionMalformed: -1, invokeHostFunctionTrapped: -2, invokeHostFunctionResourceLimitExceeded: -3, - invokeHostFunctionEntryExpired: -4, + invokeHostFunctionEntryArchived: -4, invokeHostFunctionInsufficientRefundableFee: -5, }); @@ -7279,7 +7248,7 @@ var types = XDR.config((xdr) => { // case INVOKE_HOST_FUNCTION_MALFORMED: // case INVOKE_HOST_FUNCTION_TRAPPED: // case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: - // case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: + // case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED: // case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: // void; // }; @@ -7293,7 +7262,7 @@ var types = XDR.config((xdr) => { ["invokeHostFunctionMalformed", xdr.void()], ["invokeHostFunctionTrapped", xdr.void()], ["invokeHostFunctionResourceLimitExceeded", xdr.void()], - ["invokeHostFunctionEntryExpired", xdr.void()], + ["invokeHostFunctionEntryArchived", xdr.void()], ["invokeHostFunctionInsufficientRefundableFee", xdr.void()], ], arms: { @@ -7303,46 +7272,46 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // enum BumpFootprintExpirationResultCode + // enum ExtendFootprintTTLResultCode // { // // codes considered as "success" for the operation - // BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + // EXTEND_FOOTPRINT_TTL_SUCCESS = 0, // // // codes considered as "failure" for the operation - // BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, - // BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, - // BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + // EXTEND_FOOTPRINT_TTL_MALFORMED = -1, + // EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2, + // EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3 // }; // // =========================================================================== - xdr.enum("BumpFootprintExpirationResultCode", { - bumpFootprintExpirationSuccess: 0, - bumpFootprintExpirationMalformed: -1, - bumpFootprintExpirationResourceLimitExceeded: -2, - bumpFootprintExpirationInsufficientRefundableFee: -3, + xdr.enum("ExtendFootprintTtlResultCode", { + extendFootprintTtlSuccess: 0, + extendFootprintTtlMalformed: -1, + extendFootprintTtlResourceLimitExceeded: -2, + extendFootprintTtlInsufficientRefundableFee: -3, }); // === xdr source ============================================================ // - // union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) + // union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code) // { - // case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: + // case EXTEND_FOOTPRINT_TTL_SUCCESS: // void; - // case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: - // case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: - // case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: + // case EXTEND_FOOTPRINT_TTL_MALFORMED: + // case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED: + // case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE: // void; // }; // // =========================================================================== - xdr.union("BumpFootprintExpirationResult", { - switchOn: xdr.lookup("BumpFootprintExpirationResultCode"), + xdr.union("ExtendFootprintTtlResult", { + switchOn: xdr.lookup("ExtendFootprintTtlResultCode"), switchName: "code", switches: [ - ["bumpFootprintExpirationSuccess", xdr.void()], - ["bumpFootprintExpirationMalformed", xdr.void()], - ["bumpFootprintExpirationResourceLimitExceeded", xdr.void()], - ["bumpFootprintExpirationInsufficientRefundableFee", xdr.void()], + ["extendFootprintTtlSuccess", xdr.void()], + ["extendFootprintTtlMalformed", xdr.void()], + ["extendFootprintTtlResourceLimitExceeded", xdr.void()], + ["extendFootprintTtlInsufficientRefundableFee", xdr.void()], ], arms: {}, }); @@ -7472,8 +7441,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionResult invokeHostFunctionResult; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLResult extendFootprintTTLResult; // case RESTORE_FOOTPRINT: // RestoreFootprintResult restoreFootprintResult; // } @@ -7508,7 +7477,7 @@ var types = XDR.config((xdr) => { ["liquidityPoolDeposit", "liquidityPoolDepositResult"], ["liquidityPoolWithdraw", "liquidityPoolWithdrawResult"], ["invokeHostFunction", "invokeHostFunctionResult"], - ["bumpFootprintExpiration", "bumpFootprintExpirationResult"], + ["extendFootprintTtl", "extendFootprintTtlResult"], ["restoreFootprint", "restoreFootprintResult"], ], arms: { @@ -7545,9 +7514,7 @@ var types = XDR.config((xdr) => { liquidityPoolDepositResult: xdr.lookup("LiquidityPoolDepositResult"), liquidityPoolWithdrawResult: xdr.lookup("LiquidityPoolWithdrawResult"), invokeHostFunctionResult: xdr.lookup("InvokeHostFunctionResult"), - bumpFootprintExpirationResult: xdr.lookup( - "BumpFootprintExpirationResult" - ), + extendFootprintTtlResult: xdr.lookup("ExtendFootprintTtlResult"), restoreFootprintResult: xdr.lookup("RestoreFootprintResult"), }, }); @@ -7609,8 +7576,8 @@ var types = XDR.config((xdr) => { // LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; // case INVOKE_HOST_FUNCTION: // InvokeHostFunctionResult invokeHostFunctionResult; - // case BUMP_FOOTPRINT_EXPIRATION: - // BumpFootprintExpirationResult bumpFootprintExpirationResult; + // case EXTEND_FOOTPRINT_TTL: + // ExtendFootprintTTLResult extendFootprintTTLResult; // case RESTORE_FOOTPRINT: // RestoreFootprintResult restoreFootprintResult; // } @@ -8468,13 +8435,13 @@ var types = XDR.config((xdr) => { // enum ContractExecutableType // { // CONTRACT_EXECUTABLE_WASM = 0, - // CONTRACT_EXECUTABLE_TOKEN = 1 + // CONTRACT_EXECUTABLE_STELLAR_ASSET = 1 // }; // // =========================================================================== xdr.enum("ContractExecutableType", { contractExecutableWasm: 0, - contractExecutableToken: 1, + contractExecutableStellarAsset: 1, }); // === xdr source ============================================================ @@ -8483,7 +8450,7 @@ var types = XDR.config((xdr) => { // { // case CONTRACT_EXECUTABLE_WASM: // Hash wasm_hash; - // case CONTRACT_EXECUTABLE_TOKEN: + // case CONTRACT_EXECUTABLE_STELLAR_ASSET: // void; // }; // @@ -8493,7 +8460,7 @@ var types = XDR.config((xdr) => { switchName: "type", switches: [ ["contractExecutableWasm", "wasmHash"], - ["contractExecutableToken", xdr.void()], + ["contractExecutableStellarAsset", xdr.void()], ], arms: { wasmHash: xdr.lookup("Hash"), @@ -9465,96 +9432,81 @@ var types = XDR.config((xdr) => { // enum ContractCostType { // // Cost of running 1 wasm instruction // WasmInsnExec = 0, - // // Cost of growing wasm linear memory by 1 page - // WasmMemAlloc = 1, - // // Cost of allocating a chuck of host memory (in bytes) - // HostMemAlloc = 2, - // // Cost of copying a chuck of bytes into a pre-allocated host memory - // HostMemCpy = 3, - // // Cost of comparing two slices of host memory - // HostMemCmp = 4, + // // Cost of allocating a slice of memory (in bytes) + // MemAlloc = 1, + // // Cost of copying a slice of bytes into a pre-allocated memory + // MemCpy = 2, + // // Cost of comparing two slices of memory + // MemCmp = 3, // // Cost of a host function dispatch, not including the actual work done by // // the function nor the cost of VM invocation machinary - // DispatchHostFunction = 5, + // DispatchHostFunction = 4, // // Cost of visiting a host object from the host object storage. Exists to // // make sure some baseline cost coverage, i.e. repeatly visiting objects // // by the guest will always incur some charges. - // VisitObject = 6, + // VisitObject = 5, // // Cost of serializing an xdr object to bytes - // ValSer = 7, + // ValSer = 6, // // Cost of deserializing an xdr object from bytes - // ValDeser = 8, + // ValDeser = 7, // // Cost of computing the sha256 hash from bytes - // ComputeSha256Hash = 9, + // ComputeSha256Hash = 8, // // Cost of computing the ed25519 pubkey from bytes - // ComputeEd25519PubKey = 10, - // // Cost of accessing an entry in a Map. - // MapEntry = 11, - // // Cost of accessing an entry in a Vec - // VecEntry = 12, + // ComputeEd25519PubKey = 9, // // Cost of verifying ed25519 signature of a payload. - // VerifyEd25519Sig = 13, - // // Cost of reading a slice of vm linear memory - // VmMemRead = 14, - // // Cost of writing to a slice of vm linear memory - // VmMemWrite = 15, + // VerifyEd25519Sig = 10, // // Cost of instantiation a VM from wasm bytes code. - // VmInstantiation = 16, + // VmInstantiation = 11, // // Cost of instantiation a VM from a cached state. - // VmCachedInstantiation = 17, + // VmCachedInstantiation = 12, // // Cost of invoking a function on the VM. If the function is a host function, // // additional cost will be covered by `DispatchHostFunction`. - // InvokeVmFunction = 18, + // InvokeVmFunction = 13, // // Cost of computing a keccak256 hash from bytes. - // ComputeKeccak256Hash = 19, - // // Cost of computing an ECDSA secp256k1 pubkey from bytes. - // ComputeEcdsaSecp256k1Key = 20, + // ComputeKeccak256Hash = 14, // // Cost of computing an ECDSA secp256k1 signature from bytes. - // ComputeEcdsaSecp256k1Sig = 21, + // ComputeEcdsaSecp256k1Sig = 15, // // Cost of recovering an ECDSA secp256k1 key from a signature. - // RecoverEcdsaSecp256k1Key = 22, + // RecoverEcdsaSecp256k1Key = 16, // // Cost of int256 addition (`+`) and subtraction (`-`) operations - // Int256AddSub = 23, + // Int256AddSub = 17, // // Cost of int256 multiplication (`*`) operation - // Int256Mul = 24, + // Int256Mul = 18, // // Cost of int256 division (`/`) operation - // Int256Div = 25, + // Int256Div = 19, // // Cost of int256 power (`exp`) operation - // Int256Pow = 26, + // Int256Pow = 20, // // Cost of int256 shift (`shl`, `shr`) operation - // Int256Shift = 27 + // Int256Shift = 21, + // // Cost of drawing random bytes using a ChaCha20 PRNG + // ChaCha20DrawBytes = 22 // }; // // =========================================================================== xdr.enum("ContractCostType", { wasmInsnExec: 0, - wasmMemAlloc: 1, - hostMemAlloc: 2, - hostMemCpy: 3, - hostMemCmp: 4, - dispatchHostFunction: 5, - visitObject: 6, - valSer: 7, - valDeser: 8, - computeSha256Hash: 9, - computeEd25519PubKey: 10, - mapEntry: 11, - vecEntry: 12, - verifyEd25519Sig: 13, - vmMemRead: 14, - vmMemWrite: 15, - vmInstantiation: 16, - vmCachedInstantiation: 17, - invokeVmFunction: 18, - computeKeccak256Hash: 19, - computeEcdsaSecp256k1Key: 20, - computeEcdsaSecp256k1Sig: 21, - recoverEcdsaSecp256k1Key: 22, - int256AddSub: 23, - int256Mul: 24, - int256Div: 25, - int256Pow: 26, - int256Shift: 27, + memAlloc: 1, + memCpy: 2, + memCmp: 3, + dispatchHostFunction: 4, + visitObject: 5, + valSer: 6, + valDeser: 7, + computeSha256Hash: 8, + computeEd25519PubKey: 9, + verifyEd25519Sig: 10, + vmInstantiation: 11, + vmCachedInstantiation: 12, + invokeVmFunction: 13, + computeKeccak256Hash: 14, + computeEcdsaSecp256k1Sig: 15, + recoverEcdsaSecp256k1Key: 16, + int256AddSub: 17, + int256Mul: 18, + int256Div: 19, + int256Pow: 20, + int256Shift: 21, + chaCha20DrawBytes: 22, }); // === xdr source ============================================================ @@ -9576,17 +9528,17 @@ var types = XDR.config((xdr) => { // === xdr source ============================================================ // - // struct StateExpirationSettings { - // uint32 maxEntryExpiration; - // uint32 minTempEntryExpiration; - // uint32 minPersistentEntryExpiration; + // struct StateArchivalSettings { + // uint32 maxEntryTTL; + // uint32 minTemporaryTTL; + // uint32 minPersistentTTL; // // // rent_fee = wfee_rate_average / rent_rate_denominator_for_type // int64 persistentRentRateDenominator; // int64 tempRentRateDenominator; // - // // max number of entries that emit expiration meta in a single ledger - // uint32 maxEntriesToExpire; + // // max number of entries that emit archival meta in a single ledger + // uint32 maxEntriesToArchive; // // // Number of snapshots to use when calculating average BucketList size // uint32 bucketListSizeWindowSampleSize; @@ -9599,13 +9551,13 @@ var types = XDR.config((xdr) => { // }; // // =========================================================================== - xdr.struct("StateExpirationSettings", [ - ["maxEntryExpiration", xdr.lookup("Uint32")], - ["minTempEntryExpiration", xdr.lookup("Uint32")], - ["minPersistentEntryExpiration", xdr.lookup("Uint32")], + xdr.struct("StateArchivalSettings", [ + ["maxEntryTtl", xdr.lookup("Uint32")], + ["minTemporaryTtl", xdr.lookup("Uint32")], + ["minPersistentTtl", xdr.lookup("Uint32")], ["persistentRentRateDenominator", xdr.lookup("Int64")], ["tempRentRateDenominator", xdr.lookup("Int64")], - ["maxEntriesToExpire", xdr.lookup("Uint32")], + ["maxEntriesToArchive", xdr.lookup("Uint32")], ["bucketListSizeWindowSampleSize", xdr.lookup("Uint32")], ["evictionScanSize", xdr.lookup("Uint64")], ["startingEvictionScanLevel", xdr.lookup("Uint32")], @@ -9660,7 +9612,7 @@ var types = XDR.config((xdr) => { // CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, // CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, // CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, - // CONFIG_SETTING_STATE_EXPIRATION = 10, + // CONFIG_SETTING_STATE_ARCHIVAL = 10, // CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, // CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, // CONFIG_SETTING_EVICTION_ITERATOR = 13 @@ -9678,7 +9630,7 @@ var types = XDR.config((xdr) => { configSettingContractCostParamsMemoryBytes: 7, configSettingContractDataKeySizeBytes: 8, configSettingContractDataEntrySizeBytes: 9, - configSettingStateExpiration: 10, + configSettingStateArchival: 10, configSettingContractExecutionLanes: 11, configSettingBucketlistSizeWindow: 12, configSettingEvictionIterator: 13, @@ -9708,8 +9660,8 @@ var types = XDR.config((xdr) => { // uint32 contractDataKeySizeBytes; // case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: // uint32 contractDataEntrySizeBytes; - // case CONFIG_SETTING_STATE_EXPIRATION: - // StateExpirationSettings stateExpirationSettings; + // case CONFIG_SETTING_STATE_ARCHIVAL: + // StateArchivalSettings stateArchivalSettings; // case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: // ConfigSettingContractExecutionLanesV0 contractExecutionLanes; // case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: @@ -9739,7 +9691,7 @@ var types = XDR.config((xdr) => { ], ["configSettingContractDataKeySizeBytes", "contractDataKeySizeBytes"], ["configSettingContractDataEntrySizeBytes", "contractDataEntrySizeBytes"], - ["configSettingStateExpiration", "stateExpirationSettings"], + ["configSettingStateArchival", "stateArchivalSettings"], ["configSettingContractExecutionLanes", "contractExecutionLanes"], ["configSettingBucketlistSizeWindow", "bucketListSizeWindow"], ["configSettingEvictionIterator", "evictionIterator"], @@ -9757,7 +9709,7 @@ var types = XDR.config((xdr) => { contractCostParamsMemBytes: xdr.lookup("ContractCostParams"), contractDataKeySizeBytes: xdr.lookup("Uint32"), contractDataEntrySizeBytes: xdr.lookup("Uint32"), - stateExpirationSettings: xdr.lookup("StateExpirationSettings"), + stateArchivalSettings: xdr.lookup("StateArchivalSettings"), contractExecutionLanes: xdr.lookup( "ConfigSettingContractExecutionLanesV0" ), diff --git a/src/invocation.js b/src/invocation.js index 4ad48e20..4369785b 100644 --- a/src/invocation.js +++ b/src/invocation.js @@ -135,7 +135,7 @@ export function buildInvocationTree(root) { break; } - // contractExecutableToken + // contractExecutableStellarAsset case 1: output.args.type = 'sac'; output.args.asset = Asset.fromOperation( diff --git a/src/operation.js b/src/operation.js index 0712f66f..ae7bc30c 100644 --- a/src/operation.js +++ b/src/operation.js @@ -92,7 +92,7 @@ export const AuthClawbackEnabledFlag = 1 << 3; * * `{@link Operation.liquidityPoolDeposit}` * * `{@link Operation.liquidityPoolWithdraw}` * * `{@link Operation.invokeHostFunction}` - * * `{@link Operation.bumpFootprintExpiration}` + * * `{@link Operation.extendFootprintTtlOp}` * * `{@link Operation.restoreFootprint}` * * @class Operation @@ -381,9 +381,9 @@ export class Operation { result.auth = attrs.auth() ?? []; break; } - case 'bumpFootprintExpiration': { - result.type = 'bumpFootprintExpiration'; - result.ledgersToExpire = attrs.ledgersToExpire(); + case 'extendFootprintTtl': { + result.type = 'extendFootprintTtl'; + result.extendTo = attrs.extendTo(); break; } case 'restoreFootprint': { @@ -672,5 +672,5 @@ Operation.setTrustLineFlags = ops.setTrustLineFlags; Operation.liquidityPoolDeposit = ops.liquidityPoolDeposit; Operation.liquidityPoolWithdraw = ops.liquidityPoolWithdraw; Operation.invokeHostFunction = ops.invokeHostFunction; -Operation.bumpFootprintExpiration = ops.bumpFootprintExpiration; +Operation.extendFootprintTtlOp = ops.extendFootprintTtlOp; Operation.restoreFootprint = ops.restoreFootprint; diff --git a/src/operations/bump_footprint_expiration.js b/src/operations/extend_footprint_ttl_op.js similarity index 65% rename from src/operations/bump_footprint_expiration.js rename to src/operations/extend_footprint_ttl_op.js index 7d2fbe9c..f934f5f5 100644 --- a/src/operations/bump_footprint_expiration.js +++ b/src/operations/extend_footprint_ttl_op.js @@ -11,29 +11,29 @@ import xdr from '../xdr'; * usage as part of {@link xdr.SorobanResources}). * * @function - * @alias Operation.bumpFootprintExpiration + * @alias Operation.extendFootprintTtlOp * * @param {object} opts - object holding operation parameters - * @param {number} opts.ledgersToExpire - the number of ledgers past the LCL + * @param {number} opts.extendTo - the number of ledgers past the LCL * (last closed ledger) by which to extend the validity of the ledger keys in * this transaction * @param {string} [opts.source] - an optional source account * * @returns {xdr.Operation} a Bump Footprint Expiration operation - * (xdr.BumpFootprintExpirationOp) + * (xdr.ExtendFootprintTTLOp) */ -export function bumpFootprintExpiration(opts) { - if ((opts.ledgersToExpire ?? -1) <= 0) { - throw new RangeError("ledgersToExpire isn't a ledger quantity (uint32)"); +export function extendFootprintTtlOp(opts) { + if ((opts.extendTo ?? -1) <= 0) { + throw new RangeError("extendTo isn't a ledger quantity (uint32)"); } - const bumpFootprintOp = new xdr.BumpFootprintExpirationOp({ + const bumpFootprintOp = new xdr.ExtendFootprintTtlOp({ ext: new xdr.ExtensionPoint(0), - ledgersToExpire: opts.ledgersToExpire + extendTo: opts.extendTo }); const opAttributes = { - body: xdr.OperationBody.bumpFootprintExpiration(bumpFootprintOp) + body: xdr.OperationBody.extendFootprintTtl(bumpFootprintOp) }; this.setSourceAccount(opAttributes, opts); diff --git a/src/operations/index.js b/src/operations/index.js index 82d32de9..fb3123fa 100644 --- a/src/operations/index.js +++ b/src/operations/index.js @@ -31,5 +31,5 @@ export { setTrustLineFlags } from './set_trustline_flags'; export { liquidityPoolDeposit } from './liquidity_pool_deposit'; export { liquidityPoolWithdraw } from './liquidity_pool_withdraw'; export { invokeHostFunction } from './invoke_host_function'; -export { bumpFootprintExpiration } from './bump_footprint_expiration'; +export { extendFootprintTtlOp } from './extend_footprint_ttl_op'; export { restoreFootprint } from './restore_footprint'; diff --git a/src/sorobandata_builder.js b/src/sorobandata_builder.js index 4d74ccd2..8668ea82 100644 --- a/src/sorobandata_builder.js +++ b/src/sorobandata_builder.js @@ -5,10 +5,9 @@ import xdr from './xdr'; * items set to specific values. * * This is recommended for when you are building - * {@link Operation.bumpFootprintExpiration} / - * {@link Operation.restoreFootprint} operations and need to - * {@link TransactionBuilder.setSorobanData} to avoid (re)building the entire - * data structure from scratch. + * {@link Operation.extendFootprintTtlOp} / {@link Operation.restoreFootprint} + * operations and need to {@link TransactionBuilder.setSorobanData} to avoid + * (re)building the entire data structure from scratch. * * @constructor * @@ -46,7 +45,7 @@ export class SorobanDataBuilder { writeBytes: 0 }), ext: new xdr.ExtensionPoint(0), - refundableFee: new xdr.Int64(0) + resourceFee: new xdr.Int64(0) }); } else if ( typeof sorobanData === 'string' || @@ -73,12 +72,12 @@ export class SorobanDataBuilder { } /** - * Sets the "refundable" fee portion of the Soroban data. - * @param {number | bigint | string} fee the refundable fee to set (int64) + * Sets the resource fee portion of the Soroban data. + * @param {number | bigint | string} fee the resource fee to set (int64) * @returns {SorobanDataBuilder} */ - setRefundableFee(fee) { - this._data.refundableFee(new xdr.Int64(fee)); + setResourceFee(fee) { + this._data.resourceFee(new xdr.Int64(fee)); return this; } diff --git a/test/unit/invocation_test.js b/test/unit/invocation_test.js index be7b1d09..d67c0c3e 100644 --- a/test/unit/invocation_test.js +++ b/test/unit/invocation_test.js @@ -69,7 +69,8 @@ describe('parsing invocation trees', function () { xdr.ContractIdPreimage.contractIdPreimageFromAsset( new Asset('TEST', nftId).toXDRObject() ), - executable: xdr.ContractExecutable.contractExecutableToken() + executable: + xdr.ContractExecutable.contractExecutableStellarAsset() }) ), subInvocations: [] diff --git a/test/unit/operation_test.js b/test/unit/operation_test.js index b16ab293..665af753 100644 --- a/test/unit/operation_test.js +++ b/test/unit/operation_test.js @@ -2047,24 +2047,22 @@ describe('Operation', function () { }); }); - describe('bumpFootprintExpiration()', function () { + describe('extendFootprintTtlOp()', function () { it('creates operation', function () { - const op = StellarBase.Operation.bumpFootprintExpiration({ - ledgersToExpire: 1234 + const op = StellarBase.Operation.extendFootprintTtlOp({ + extendTo: 1234 }); const xdr = op.toXDR('hex'); const operation = StellarBase.xdr.Operation.fromXDR(xdr, 'hex'); - expect(operation.body().switch().name).to.equal( - 'bumpFootprintExpiration' - ); + expect(operation.body().switch().name).to.equal('extendFootprintTtl'); const obj = StellarBase.Operation.fromXDRObject(operation); - expect(obj.type).to.be.equal('bumpFootprintExpiration'); - expect(obj.ledgersToExpire).to.equal(1234); + expect(obj.type).to.be.equal('extendFootprintTtl'); + expect(obj.extendTo).to.equal(1234); expect(() => { - StellarBase.Operation.bumpFootprintExpiration({ - ledgersToExpire: 0 + StellarBase.Operation.extendFootprintTtlOp({ + extendTo: 0 }); }).to.throw(/ledger quantity/i); }); diff --git a/test/unit/sorobandata_builder_test.js b/test/unit/sorobandata_builder_test.js index 96cb7ea3..5323e04a 100644 --- a/test/unit/sorobandata_builder_test.js +++ b/test/unit/sorobandata_builder_test.js @@ -13,7 +13,7 @@ describe('SorobanTransactionData can be built', function () { writeBytes: 3 }), ext: new xdr.ExtensionPoint(0), - refundableFee: new xdr.Int64(5) + resourceFee: new xdr.Int64(5) }); const key = c.getFootprint()[0]; @@ -35,7 +35,7 @@ describe('SorobanTransactionData can be built', function () { it('sets properties as expected', function () { expect( - new dataBuilder().setResources(1, 2, 3).setRefundableFee(5).build() + new dataBuilder().setResources(1, 2, 3).setResourceFee(5).build() ).to.eql(sentinel); // this isn't a valid param but we're just checking that setters work @@ -73,8 +73,8 @@ describe('SorobanTransactionData can be built', function () { it('makes copies on build()', function () { const builder = new dataBuilder(); const first = builder.build(); - const second = builder.setRefundableFee(100).build(); + const second = builder.setResourceFee(100).build(); - expect(first.refundableFee()).to.not.eql(second.refundableFee()); + expect(first.resourceFee()).to.not.eql(second.resourceFee()); }); }); diff --git a/test/unit/transaction_builder_test.js b/test/unit/transaction_builder_test.js index e069f49a..3c790c7a 100644 --- a/test/unit/transaction_builder_test.js +++ b/test/unit/transaction_builder_test.js @@ -73,7 +73,7 @@ describe('TransactionBuilder', function () { ); sorobanTransactionData = new StellarBase.SorobanDataBuilder() .setResources(0, 5, 0) - .setRefundableFee(1) + .setResourceFee(1) .build(); }); diff --git a/types/curr.d.ts b/types/curr.d.ts index 9941c15e..9aefb65d 100644 --- a/types/curr.d.ts +++ b/types/curr.d.ts @@ -1,4 +1,4 @@ -// Automatically generated on 2023-09-11T12:23:00-08:00 +// Automatically generated on 2023-10-16T10:48:00-08:00 import { Operation } from './index'; export {}; @@ -319,7 +319,7 @@ export namespace xdr { | 'contractData' | 'contractCode' | 'configSetting' - | 'expiration'; + | 'ttl'; readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; @@ -341,7 +341,7 @@ export namespace xdr { static configSetting(): LedgerEntryType; - static expiration(): LedgerEntryType; + static ttl(): LedgerEntryType; } class AccountFlags { @@ -748,7 +748,7 @@ export namespace xdr { | 'liquidityPoolDeposit' | 'liquidityPoolWithdraw' | 'invokeHostFunction' - | 'bumpFootprintExpiration' + | 'extendFootprintTtl' | 'restoreFootprint'; readonly value: @@ -830,7 +830,7 @@ export namespace xdr { static invokeHostFunction(): OperationType; - static bumpFootprintExpiration(): OperationType; + static extendFootprintTtl(): OperationType; static restoreFootprint(): OperationType; } @@ -1643,7 +1643,7 @@ export namespace xdr { | 'invokeHostFunctionMalformed' | 'invokeHostFunctionTrapped' | 'invokeHostFunctionResourceLimitExceeded' - | 'invokeHostFunctionEntryExpired' + | 'invokeHostFunctionEntryArchived' | 'invokeHostFunctionInsufficientRefundableFee'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1656,27 +1656,27 @@ export namespace xdr { static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResultCode; - static invokeHostFunctionEntryExpired(): InvokeHostFunctionResultCode; + static invokeHostFunctionEntryArchived(): InvokeHostFunctionResultCode; static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResultCode; } - class BumpFootprintExpirationResultCode { + class ExtendFootprintTtlResultCode { readonly name: - | 'bumpFootprintExpirationSuccess' - | 'bumpFootprintExpirationMalformed' - | 'bumpFootprintExpirationResourceLimitExceeded' - | 'bumpFootprintExpirationInsufficientRefundableFee'; + | 'extendFootprintTtlSuccess' + | 'extendFootprintTtlMalformed' + | 'extendFootprintTtlResourceLimitExceeded' + | 'extendFootprintTtlInsufficientRefundableFee'; readonly value: 0 | -1 | -2 | -3; - static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResultCode; + static extendFootprintTtlSuccess(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResultCode; + static extendFootprintTtlMalformed(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResultCode; + static extendFootprintTtlResourceLimitExceeded(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResultCode; + static extendFootprintTtlInsufficientRefundableFee(): ExtendFootprintTtlResultCode; } class RestoreFootprintResultCode { @@ -2020,13 +2020,13 @@ export namespace xdr { } class ContractExecutableType { - readonly name: 'contractExecutableWasm' | 'contractExecutableToken'; + readonly name: 'contractExecutableWasm' | 'contractExecutableStellarAsset'; readonly value: 0 | 1; static contractExecutableWasm(): ContractExecutableType; - static contractExecutableToken(): ContractExecutableType; + static contractExecutableStellarAsset(): ContractExecutableType; } class ScAddressType { @@ -2195,33 +2195,28 @@ export namespace xdr { class ContractCostType { readonly name: | 'wasmInsnExec' - | 'wasmMemAlloc' - | 'hostMemAlloc' - | 'hostMemCpy' - | 'hostMemCmp' + | 'memAlloc' + | 'memCpy' + | 'memCmp' | 'dispatchHostFunction' | 'visitObject' | 'valSer' | 'valDeser' | 'computeSha256Hash' | 'computeEd25519PubKey' - | 'mapEntry' - | 'vecEntry' | 'verifyEd25519Sig' - | 'vmMemRead' - | 'vmMemWrite' | 'vmInstantiation' | 'vmCachedInstantiation' | 'invokeVmFunction' | 'computeKeccak256Hash' - | 'computeEcdsaSecp256k1Key' | 'computeEcdsaSecp256k1Sig' | 'recoverEcdsaSecp256k1Key' | 'int256AddSub' | 'int256Mul' | 'int256Div' | 'int256Pow' - | 'int256Shift'; + | 'int256Shift' + | 'chaCha20DrawBytes'; readonly value: | 0 @@ -2246,22 +2241,15 @@ export namespace xdr { | 19 | 20 | 21 - | 22 - | 23 - | 24 - | 25 - | 26 - | 27; + | 22; static wasmInsnExec(): ContractCostType; - static wasmMemAlloc(): ContractCostType; - - static hostMemAlloc(): ContractCostType; + static memAlloc(): ContractCostType; - static hostMemCpy(): ContractCostType; + static memCpy(): ContractCostType; - static hostMemCmp(): ContractCostType; + static memCmp(): ContractCostType; static dispatchHostFunction(): ContractCostType; @@ -2275,16 +2263,8 @@ export namespace xdr { static computeEd25519PubKey(): ContractCostType; - static mapEntry(): ContractCostType; - - static vecEntry(): ContractCostType; - static verifyEd25519Sig(): ContractCostType; - static vmMemRead(): ContractCostType; - - static vmMemWrite(): ContractCostType; - static vmInstantiation(): ContractCostType; static vmCachedInstantiation(): ContractCostType; @@ -2293,8 +2273,6 @@ export namespace xdr { static computeKeccak256Hash(): ContractCostType; - static computeEcdsaSecp256k1Key(): ContractCostType; - static computeEcdsaSecp256k1Sig(): ContractCostType; static recoverEcdsaSecp256k1Key(): ContractCostType; @@ -2308,6 +2286,8 @@ export namespace xdr { static int256Pow(): ContractCostType; static int256Shift(): ContractCostType; + + static chaCha20DrawBytes(): ContractCostType; } class ConfigSettingId { @@ -2322,7 +2302,7 @@ export namespace xdr { | 'configSettingContractCostParamsMemoryBytes' | 'configSettingContractDataKeySizeBytes' | 'configSettingContractDataEntrySizeBytes' - | 'configSettingStateExpiration' + | 'configSettingStateArchival' | 'configSettingContractExecutionLanes' | 'configSettingBucketlistSizeWindow' | 'configSettingEvictionIterator'; @@ -2349,7 +2329,7 @@ export namespace xdr { static configSettingContractDataEntrySizeBytes(): ConfigSettingId; - static configSettingStateExpiration(): ConfigSettingId; + static configSettingStateArchival(): ConfigSettingId; static configSettingContractExecutionLanes(): ConfigSettingId; @@ -3517,28 +3497,28 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ExpirationEntry { - constructor(attributes: { keyHash: Buffer; expirationLedgerSeq: number }); + class TtlEntry { + constructor(attributes: { keyHash: Buffer; liveUntilLedgerSeq: number }); keyHash(value?: Buffer): Buffer; - expirationLedgerSeq(value?: number): number; + liveUntilLedgerSeq(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ExpirationEntry; + static read(io: Buffer): TtlEntry; - static write(value: ExpirationEntry, io: Buffer): void; + static write(value: TtlEntry, io: Buffer): void; - static isValid(value: ExpirationEntry): boolean; + static isValid(value: TtlEntry): boolean; - static toXDR(value: ExpirationEntry): Buffer; + static toXDR(value: TtlEntry): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ExpirationEntry; + static fromXDR(input: Buffer, format?: 'raw'): TtlEntry; - static fromXDR(input: string, format: 'hex' | 'base64'): ExpirationEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): TtlEntry; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -3879,7 +3859,7 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKeyExpiration { + class LedgerKeyTtl { constructor(attributes: { keyHash: Buffer }); keyHash(value?: Buffer): Buffer; @@ -3888,20 +3868,17 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerKeyExpiration; + static read(io: Buffer): LedgerKeyTtl; - static write(value: LedgerKeyExpiration, io: Buffer): void; + static write(value: LedgerKeyTtl, io: Buffer): void; - static isValid(value: LedgerKeyExpiration): boolean; + static isValid(value: LedgerKeyTtl): boolean; - static toXDR(value: LedgerKeyExpiration): Buffer; + static toXDR(value: LedgerKeyTtl): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyExpiration; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyTtl; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): LedgerKeyExpiration; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyTtl; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -4911,46 +4888,6 @@ export namespace xdr { } class LedgerCloseMetaV1 { - constructor(attributes: { - ledgerHeader: LedgerHeaderHistoryEntry; - txSet: GeneralizedTransactionSet; - txProcessing: TransactionResultMeta[]; - upgradesProcessing: UpgradeEntryMeta[]; - scpInfo: ScpHistoryEntry[]; - }); - - ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - - txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; - - txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; - - upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; - - scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): LedgerCloseMetaV1; - - static write(value: LedgerCloseMetaV1, io: Buffer): void; - - static isValid(value: LedgerCloseMetaV1): boolean; - - static toXDR(value: LedgerCloseMetaV1): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class LedgerCloseMetaV2 { constructor(attributes: { ext: ExtensionPoint; ledgerHeader: LedgerHeaderHistoryEntry; @@ -4985,17 +4922,17 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerCloseMetaV2; + static read(io: Buffer): LedgerCloseMetaV1; - static write(value: LedgerCloseMetaV2, io: Buffer): void; + static write(value: LedgerCloseMetaV1, io: Buffer): void; - static isValid(value: LedgerCloseMetaV2): boolean; + static isValid(value: LedgerCloseMetaV1): boolean; - static toXDR(value: LedgerCloseMetaV2): Buffer; + static toXDR(value: LedgerCloseMetaV1): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -6721,31 +6658,31 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BumpFootprintExpirationOp { - constructor(attributes: { ext: ExtensionPoint; ledgersToExpire: number }); + class ExtendFootprintTtlOp { + constructor(attributes: { ext: ExtensionPoint; extendTo: number }); ext(value?: ExtensionPoint): ExtensionPoint; - ledgersToExpire(value?: number): number; + extendTo(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BumpFootprintExpirationOp; + static read(io: Buffer): ExtendFootprintTtlOp; - static write(value: BumpFootprintExpirationOp, io: Buffer): void; + static write(value: ExtendFootprintTtlOp, io: Buffer): void; - static isValid(value: BumpFootprintExpirationOp): boolean; + static isValid(value: ExtendFootprintTtlOp): boolean; - static toXDR(value: BumpFootprintExpirationOp): Buffer; + static toXDR(value: ExtendFootprintTtlOp): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): BumpFootprintExpirationOp; + static fromXDR(input: Buffer, format?: 'raw'): ExtendFootprintTtlOp; static fromXDR( input: string, format: 'hex' | 'base64', - ): BumpFootprintExpirationOp; + ): ExtendFootprintTtlOp; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -7105,14 +7042,14 @@ export namespace xdr { constructor(attributes: { ext: ExtensionPoint; resources: SorobanResources; - refundableFee: Int64; + resourceFee: Int64; }); ext(value?: ExtensionPoint): ExtensionPoint; resources(value?: SorobanResources): SorobanResources; - refundableFee(value?: Int64): Int64; + resourceFee(value?: Int64): Int64; toXDR(format?: 'raw'): Buffer; @@ -9086,30 +9023,30 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class StateExpirationSettings { + class StateArchivalSettings { constructor(attributes: { - maxEntryExpiration: number; - minTempEntryExpiration: number; - minPersistentEntryExpiration: number; + maxEntryTtl: number; + minTemporaryTtl: number; + minPersistentTtl: number; persistentRentRateDenominator: Int64; tempRentRateDenominator: Int64; - maxEntriesToExpire: number; + maxEntriesToArchive: number; bucketListSizeWindowSampleSize: number; evictionScanSize: Uint64; startingEvictionScanLevel: number; }); - maxEntryExpiration(value?: number): number; + maxEntryTtl(value?: number): number; - minTempEntryExpiration(value?: number): number; + minTemporaryTtl(value?: number): number; - minPersistentEntryExpiration(value?: number): number; + minPersistentTtl(value?: number): number; persistentRentRateDenominator(value?: Int64): Int64; tempRentRateDenominator(value?: Int64): Int64; - maxEntriesToExpire(value?: number): number; + maxEntriesToArchive(value?: number): number; bucketListSizeWindowSampleSize(value?: number): number; @@ -9121,20 +9058,20 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): StateExpirationSettings; + static read(io: Buffer): StateArchivalSettings; - static write(value: StateExpirationSettings, io: Buffer): void; + static write(value: StateArchivalSettings, io: Buffer): void; - static isValid(value: StateExpirationSettings): boolean; + static isValid(value: StateArchivalSettings): boolean; - static toXDR(value: StateExpirationSettings): Buffer; + static toXDR(value: StateArchivalSettings): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): StateExpirationSettings; + static fromXDR(input: Buffer, format?: 'raw'): StateArchivalSettings; static fromXDR( input: string, format: 'hex' | 'base64', - ): StateExpirationSettings; + ): StateArchivalSettings; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -9867,7 +9804,7 @@ export namespace xdr { configSetting(value?: ConfigSettingEntry): ConfigSettingEntry; - expiration(value?: ExpirationEntry): ExpirationEntry; + ttl(value?: TtlEntry): TtlEntry; static account(value: AccountEntry): LedgerEntryData; @@ -9887,7 +9824,7 @@ export namespace xdr { static configSetting(value: ConfigSettingEntry): LedgerEntryData; - static expiration(value: ExpirationEntry): LedgerEntryData; + static ttl(value: TtlEntry): LedgerEntryData; value(): | AccountEntry @@ -9899,7 +9836,7 @@ export namespace xdr { | ContractDataEntry | ContractCodeEntry | ConfigSettingEntry - | ExpirationEntry; + | TtlEntry; toXDR(format?: 'raw'): Buffer; @@ -9977,7 +9914,7 @@ export namespace xdr { configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; - expiration(value?: LedgerKeyExpiration): LedgerKeyExpiration; + ttl(value?: LedgerKeyTtl): LedgerKeyTtl; static account(value: LedgerKeyAccount): LedgerKey; @@ -9997,7 +9934,7 @@ export namespace xdr { static configSetting(value: LedgerKeyConfigSetting): LedgerKey; - static expiration(value: LedgerKeyExpiration): LedgerKey; + static ttl(value: LedgerKeyTtl): LedgerKey; value(): | LedgerKeyAccount @@ -10009,7 +9946,7 @@ export namespace xdr { | LedgerKeyContractData | LedgerKeyContractCode | LedgerKeyConfigSetting - | LedgerKeyExpiration; + | LedgerKeyTtl; toXDR(format?: 'raw'): Buffer; @@ -10614,15 +10551,11 @@ export namespace xdr { v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; - v2(value?: LedgerCloseMetaV2): LedgerCloseMetaV2; - static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; - static 2(value: LedgerCloseMetaV2): LedgerCloseMeta; - - value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; + value(): LedgerCloseMetaV0 | LedgerCloseMetaV1; toXDR(format?: 'raw'): Buffer; @@ -11256,9 +11189,7 @@ export namespace xdr { invokeHostFunctionOp(value?: InvokeHostFunctionOp): InvokeHostFunctionOp; - bumpFootprintExpirationOp( - value?: BumpFootprintExpirationOp, - ): BumpFootprintExpirationOp; + extendFootprintTtlOp(value?: ExtendFootprintTtlOp): ExtendFootprintTtlOp; restoreFootprintOp(value?: RestoreFootprintOp): RestoreFootprintOp; @@ -11322,9 +11253,7 @@ export namespace xdr { static invokeHostFunction(value: InvokeHostFunctionOp): OperationBody; - static bumpFootprintExpiration( - value: BumpFootprintExpirationOp, - ): OperationBody; + static extendFootprintTtl(value: ExtendFootprintTtlOp): OperationBody; static restoreFootprint(value: RestoreFootprintOp): OperationBody; @@ -11352,7 +11281,7 @@ export namespace xdr { | LiquidityPoolDepositOp | LiquidityPoolWithdrawOp | InvokeHostFunctionOp - | BumpFootprintExpirationOp + | ExtendFootprintTtlOp | RestoreFootprintOp | void; @@ -12839,7 +12768,7 @@ export namespace xdr { static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResult; - static invokeHostFunctionEntryExpired(): InvokeHostFunctionResult; + static invokeHostFunctionEntryArchived(): InvokeHostFunctionResult; static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResult; @@ -12869,16 +12798,16 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BumpFootprintExpirationResult { - switch(): BumpFootprintExpirationResultCode; + class ExtendFootprintTtlResult { + switch(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResult; + static extendFootprintTtlSuccess(): ExtendFootprintTtlResult; - static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResult; + static extendFootprintTtlMalformed(): ExtendFootprintTtlResult; - static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResult; + static extendFootprintTtlResourceLimitExceeded(): ExtendFootprintTtlResult; - static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResult; + static extendFootprintTtlInsufficientRefundableFee(): ExtendFootprintTtlResult; value(): void; @@ -12886,23 +12815,20 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BumpFootprintExpirationResult; + static read(io: Buffer): ExtendFootprintTtlResult; - static write(value: BumpFootprintExpirationResult, io: Buffer): void; + static write(value: ExtendFootprintTtlResult, io: Buffer): void; - static isValid(value: BumpFootprintExpirationResult): boolean; + static isValid(value: ExtendFootprintTtlResult): boolean; - static toXDR(value: BumpFootprintExpirationResult): Buffer; + static toXDR(value: ExtendFootprintTtlResult): Buffer; - static fromXDR( - input: Buffer, - format?: 'raw', - ): BumpFootprintExpirationResult; + static fromXDR(input: Buffer, format?: 'raw'): ExtendFootprintTtlResult; static fromXDR( input: string, format: 'hex' | 'base64', - ): BumpFootprintExpirationResult; + ): ExtendFootprintTtlResult; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -13025,9 +12951,9 @@ export namespace xdr { value?: InvokeHostFunctionResult, ): InvokeHostFunctionResult; - bumpFootprintExpirationResult( - value?: BumpFootprintExpirationResult, - ): BumpFootprintExpirationResult; + extendFootprintTtlResult( + value?: ExtendFootprintTtlResult, + ): ExtendFootprintTtlResult; restoreFootprintResult( value?: RestoreFootprintResult, @@ -13105,8 +13031,8 @@ export namespace xdr { value: InvokeHostFunctionResult, ): OperationResultTr; - static bumpFootprintExpiration( - value: BumpFootprintExpirationResult, + static extendFootprintTtl( + value: ExtendFootprintTtlResult, ): OperationResultTr; static restoreFootprint(value: RestoreFootprintResult): OperationResultTr; @@ -13137,7 +13063,7 @@ export namespace xdr { | LiquidityPoolDepositResult | LiquidityPoolWithdrawResult | InvokeHostFunctionResult - | BumpFootprintExpirationResult + | ExtendFootprintTtlResult | RestoreFootprintResult; toXDR(format?: 'raw'): Buffer; @@ -13568,7 +13494,7 @@ export namespace xdr { static contractExecutableWasm(value: Buffer): ContractExecutable; - static contractExecutableToken(): ContractExecutable; + static contractExecutableStellarAsset(): ContractExecutable; value(): Buffer | void; @@ -14049,9 +13975,7 @@ export namespace xdr { contractDataEntrySizeBytes(value?: number): number; - stateExpirationSettings( - value?: StateExpirationSettings, - ): StateExpirationSettings; + stateArchivalSettings(value?: StateArchivalSettings): StateArchivalSettings; contractExecutionLanes( value?: ConfigSettingContractExecutionLanesV0, @@ -14099,8 +14023,8 @@ export namespace xdr { value: number, ): ConfigSettingEntry; - static configSettingStateExpiration( - value: StateExpirationSettings, + static configSettingStateArchival( + value: StateArchivalSettings, ): ConfigSettingEntry; static configSettingContractExecutionLanes( @@ -14126,7 +14050,7 @@ export namespace xdr { | ContractCostParamEntry[] | number | number - | StateExpirationSettings + | StateArchivalSettings | ConfigSettingContractExecutionLanesV0 | Uint64[] | EvictionIterator; diff --git a/types/index.d.ts b/types/index.d.ts index e7f3c99e..4b3f7461 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -369,7 +369,7 @@ export namespace OperationType { type LiquidityPoolDeposit = 'liquidityPoolDeposit'; type LiquidityPoolWithdraw = 'liquidityPoolWithdraw'; type InvokeHostFunction = 'invokeHostFunction'; - type BumpFootprintExpiration = 'bumpFootprintExpiration'; + type ExtendFootprintTTL = 'extendFootprintTtlOp'; type RestoreFootprint = 'restoreFootprint'; } export type OperationType = @@ -398,7 +398,7 @@ export type OperationType = | OperationType.LiquidityPoolDeposit | OperationType.LiquidityPoolWithdraw | OperationType.InvokeHostFunction - | OperationType.BumpFootprintExpiration + | OperationType.ExtendFootprintTTL | OperationType.RestoreFootprint; export namespace OperationOptions { @@ -550,8 +550,8 @@ export namespace OperationOptions { func: xdr.HostFunction; auth: xdr.SorobanAuthorizationEntry[]; } - interface BumpFootprintExpiration extends BaseOptions { - ledgersToExpire: number; + interface ExtendFootprintTTLOp extends BaseOptions { + extendTo: number; } type RestoreFootprint = BaseOptions; } @@ -586,7 +586,7 @@ export type OperationOptions = | OperationOptions.LiquidityPoolDeposit | OperationOptions.LiquidityPoolWithdraw | OperationOptions.InvokeHostFunction - | OperationOptions.BumpFootprintExpiration + | OperationOptions.ExtendFootprintTTLOp | OperationOptions.RestoreFootprint; export namespace Operation { @@ -876,11 +876,11 @@ export namespace Operation { options: OperationOptions.InvokeHostFunction ): xdr.Operation<InvokeHostFunction>; - function bumpFootprintExpiration( - options: OperationOptions.BumpFootprintExpiration - ): xdr.Operation<BumpFootprintExpiration>; - interface BumpFootprintExpiration extends BaseOperation<OperationType.BumpFootprintExpiration> { - ledgersToExpire: number; + function extendFootprintTtlOp( + options: OperationOptions.ExtendFootprintTTLOp + ): xdr.Operation<ExtendFootprintTTLOp>; + interface ExtendFootprintTTLOp extends BaseOperation<OperationType.ExtendFootprintTTL> { + extendTo: number; } function restoreFootprint(options: OperationOptions.RestoreFootprint): @@ -923,7 +923,7 @@ export type Operation = | Operation.LiquidityPoolDeposit | Operation.LiquidityPoolWithdraw | Operation.InvokeHostFunction - | Operation.BumpFootprintExpiration + | Operation.ExtendFootprintTTLOp | Operation.RestoreFootprint; export namespace StrKey { @@ -1145,7 +1145,7 @@ export class SorobanDataBuilder { constructor(data?: string | Uint8Array | Buffer | xdr.SorobanTransactionData); static fromXDR(data: Uint8Array | Buffer | string): SorobanDataBuilder; - setRefundableFee(fee: IntLike): SorobanDataBuilder; + setResourceFee(fee: IntLike): SorobanDataBuilder; setResources( cpuInstrs: number, readBytes: number, diff --git a/types/next.d.ts b/types/next.d.ts index 9941c15e..9aefb65d 100644 --- a/types/next.d.ts +++ b/types/next.d.ts @@ -1,4 +1,4 @@ -// Automatically generated on 2023-09-11T12:23:00-08:00 +// Automatically generated on 2023-10-16T10:48:00-08:00 import { Operation } from './index'; export {}; @@ -319,7 +319,7 @@ export namespace xdr { | 'contractData' | 'contractCode' | 'configSetting' - | 'expiration'; + | 'ttl'; readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; @@ -341,7 +341,7 @@ export namespace xdr { static configSetting(): LedgerEntryType; - static expiration(): LedgerEntryType; + static ttl(): LedgerEntryType; } class AccountFlags { @@ -748,7 +748,7 @@ export namespace xdr { | 'liquidityPoolDeposit' | 'liquidityPoolWithdraw' | 'invokeHostFunction' - | 'bumpFootprintExpiration' + | 'extendFootprintTtl' | 'restoreFootprint'; readonly value: @@ -830,7 +830,7 @@ export namespace xdr { static invokeHostFunction(): OperationType; - static bumpFootprintExpiration(): OperationType; + static extendFootprintTtl(): OperationType; static restoreFootprint(): OperationType; } @@ -1643,7 +1643,7 @@ export namespace xdr { | 'invokeHostFunctionMalformed' | 'invokeHostFunctionTrapped' | 'invokeHostFunctionResourceLimitExceeded' - | 'invokeHostFunctionEntryExpired' + | 'invokeHostFunctionEntryArchived' | 'invokeHostFunctionInsufficientRefundableFee'; readonly value: 0 | -1 | -2 | -3 | -4 | -5; @@ -1656,27 +1656,27 @@ export namespace xdr { static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResultCode; - static invokeHostFunctionEntryExpired(): InvokeHostFunctionResultCode; + static invokeHostFunctionEntryArchived(): InvokeHostFunctionResultCode; static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResultCode; } - class BumpFootprintExpirationResultCode { + class ExtendFootprintTtlResultCode { readonly name: - | 'bumpFootprintExpirationSuccess' - | 'bumpFootprintExpirationMalformed' - | 'bumpFootprintExpirationResourceLimitExceeded' - | 'bumpFootprintExpirationInsufficientRefundableFee'; + | 'extendFootprintTtlSuccess' + | 'extendFootprintTtlMalformed' + | 'extendFootprintTtlResourceLimitExceeded' + | 'extendFootprintTtlInsufficientRefundableFee'; readonly value: 0 | -1 | -2 | -3; - static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResultCode; + static extendFootprintTtlSuccess(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResultCode; + static extendFootprintTtlMalformed(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResultCode; + static extendFootprintTtlResourceLimitExceeded(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResultCode; + static extendFootprintTtlInsufficientRefundableFee(): ExtendFootprintTtlResultCode; } class RestoreFootprintResultCode { @@ -2020,13 +2020,13 @@ export namespace xdr { } class ContractExecutableType { - readonly name: 'contractExecutableWasm' | 'contractExecutableToken'; + readonly name: 'contractExecutableWasm' | 'contractExecutableStellarAsset'; readonly value: 0 | 1; static contractExecutableWasm(): ContractExecutableType; - static contractExecutableToken(): ContractExecutableType; + static contractExecutableStellarAsset(): ContractExecutableType; } class ScAddressType { @@ -2195,33 +2195,28 @@ export namespace xdr { class ContractCostType { readonly name: | 'wasmInsnExec' - | 'wasmMemAlloc' - | 'hostMemAlloc' - | 'hostMemCpy' - | 'hostMemCmp' + | 'memAlloc' + | 'memCpy' + | 'memCmp' | 'dispatchHostFunction' | 'visitObject' | 'valSer' | 'valDeser' | 'computeSha256Hash' | 'computeEd25519PubKey' - | 'mapEntry' - | 'vecEntry' | 'verifyEd25519Sig' - | 'vmMemRead' - | 'vmMemWrite' | 'vmInstantiation' | 'vmCachedInstantiation' | 'invokeVmFunction' | 'computeKeccak256Hash' - | 'computeEcdsaSecp256k1Key' | 'computeEcdsaSecp256k1Sig' | 'recoverEcdsaSecp256k1Key' | 'int256AddSub' | 'int256Mul' | 'int256Div' | 'int256Pow' - | 'int256Shift'; + | 'int256Shift' + | 'chaCha20DrawBytes'; readonly value: | 0 @@ -2246,22 +2241,15 @@ export namespace xdr { | 19 | 20 | 21 - | 22 - | 23 - | 24 - | 25 - | 26 - | 27; + | 22; static wasmInsnExec(): ContractCostType; - static wasmMemAlloc(): ContractCostType; - - static hostMemAlloc(): ContractCostType; + static memAlloc(): ContractCostType; - static hostMemCpy(): ContractCostType; + static memCpy(): ContractCostType; - static hostMemCmp(): ContractCostType; + static memCmp(): ContractCostType; static dispatchHostFunction(): ContractCostType; @@ -2275,16 +2263,8 @@ export namespace xdr { static computeEd25519PubKey(): ContractCostType; - static mapEntry(): ContractCostType; - - static vecEntry(): ContractCostType; - static verifyEd25519Sig(): ContractCostType; - static vmMemRead(): ContractCostType; - - static vmMemWrite(): ContractCostType; - static vmInstantiation(): ContractCostType; static vmCachedInstantiation(): ContractCostType; @@ -2293,8 +2273,6 @@ export namespace xdr { static computeKeccak256Hash(): ContractCostType; - static computeEcdsaSecp256k1Key(): ContractCostType; - static computeEcdsaSecp256k1Sig(): ContractCostType; static recoverEcdsaSecp256k1Key(): ContractCostType; @@ -2308,6 +2286,8 @@ export namespace xdr { static int256Pow(): ContractCostType; static int256Shift(): ContractCostType; + + static chaCha20DrawBytes(): ContractCostType; } class ConfigSettingId { @@ -2322,7 +2302,7 @@ export namespace xdr { | 'configSettingContractCostParamsMemoryBytes' | 'configSettingContractDataKeySizeBytes' | 'configSettingContractDataEntrySizeBytes' - | 'configSettingStateExpiration' + | 'configSettingStateArchival' | 'configSettingContractExecutionLanes' | 'configSettingBucketlistSizeWindow' | 'configSettingEvictionIterator'; @@ -2349,7 +2329,7 @@ export namespace xdr { static configSettingContractDataEntrySizeBytes(): ConfigSettingId; - static configSettingStateExpiration(): ConfigSettingId; + static configSettingStateArchival(): ConfigSettingId; static configSettingContractExecutionLanes(): ConfigSettingId; @@ -3517,28 +3497,28 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class ExpirationEntry { - constructor(attributes: { keyHash: Buffer; expirationLedgerSeq: number }); + class TtlEntry { + constructor(attributes: { keyHash: Buffer; liveUntilLedgerSeq: number }); keyHash(value?: Buffer): Buffer; - expirationLedgerSeq(value?: number): number; + liveUntilLedgerSeq(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): ExpirationEntry; + static read(io: Buffer): TtlEntry; - static write(value: ExpirationEntry, io: Buffer): void; + static write(value: TtlEntry, io: Buffer): void; - static isValid(value: ExpirationEntry): boolean; + static isValid(value: TtlEntry): boolean; - static toXDR(value: ExpirationEntry): Buffer; + static toXDR(value: TtlEntry): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): ExpirationEntry; + static fromXDR(input: Buffer, format?: 'raw'): TtlEntry; - static fromXDR(input: string, format: 'hex' | 'base64'): ExpirationEntry; + static fromXDR(input: string, format: 'hex' | 'base64'): TtlEntry; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -3879,7 +3859,7 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class LedgerKeyExpiration { + class LedgerKeyTtl { constructor(attributes: { keyHash: Buffer }); keyHash(value?: Buffer): Buffer; @@ -3888,20 +3868,17 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerKeyExpiration; + static read(io: Buffer): LedgerKeyTtl; - static write(value: LedgerKeyExpiration, io: Buffer): void; + static write(value: LedgerKeyTtl, io: Buffer): void; - static isValid(value: LedgerKeyExpiration): boolean; + static isValid(value: LedgerKeyTtl): boolean; - static toXDR(value: LedgerKeyExpiration): Buffer; + static toXDR(value: LedgerKeyTtl): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyExpiration; + static fromXDR(input: Buffer, format?: 'raw'): LedgerKeyTtl; - static fromXDR( - input: string, - format: 'hex' | 'base64', - ): LedgerKeyExpiration; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerKeyTtl; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -4911,46 +4888,6 @@ export namespace xdr { } class LedgerCloseMetaV1 { - constructor(attributes: { - ledgerHeader: LedgerHeaderHistoryEntry; - txSet: GeneralizedTransactionSet; - txProcessing: TransactionResultMeta[]; - upgradesProcessing: UpgradeEntryMeta[]; - scpInfo: ScpHistoryEntry[]; - }); - - ledgerHeader(value?: LedgerHeaderHistoryEntry): LedgerHeaderHistoryEntry; - - txSet(value?: GeneralizedTransactionSet): GeneralizedTransactionSet; - - txProcessing(value?: TransactionResultMeta[]): TransactionResultMeta[]; - - upgradesProcessing(value?: UpgradeEntryMeta[]): UpgradeEntryMeta[]; - - scpInfo(value?: ScpHistoryEntry[]): ScpHistoryEntry[]; - - toXDR(format?: 'raw'): Buffer; - - toXDR(format: 'hex' | 'base64'): string; - - static read(io: Buffer): LedgerCloseMetaV1; - - static write(value: LedgerCloseMetaV1, io: Buffer): void; - - static isValid(value: LedgerCloseMetaV1): boolean; - - static toXDR(value: LedgerCloseMetaV1): Buffer; - - static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; - - static validateXDR(input: Buffer, format?: 'raw'): boolean; - - static validateXDR(input: string, format: 'hex' | 'base64'): boolean; - } - - class LedgerCloseMetaV2 { constructor(attributes: { ext: ExtensionPoint; ledgerHeader: LedgerHeaderHistoryEntry; @@ -4985,17 +4922,17 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): LedgerCloseMetaV2; + static read(io: Buffer): LedgerCloseMetaV1; - static write(value: LedgerCloseMetaV2, io: Buffer): void; + static write(value: LedgerCloseMetaV1, io: Buffer): void; - static isValid(value: LedgerCloseMetaV2): boolean; + static isValid(value: LedgerCloseMetaV1): boolean; - static toXDR(value: LedgerCloseMetaV2): Buffer; + static toXDR(value: LedgerCloseMetaV1): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV2; + static fromXDR(input: Buffer, format?: 'raw'): LedgerCloseMetaV1; - static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV2; + static fromXDR(input: string, format: 'hex' | 'base64'): LedgerCloseMetaV1; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -6721,31 +6658,31 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BumpFootprintExpirationOp { - constructor(attributes: { ext: ExtensionPoint; ledgersToExpire: number }); + class ExtendFootprintTtlOp { + constructor(attributes: { ext: ExtensionPoint; extendTo: number }); ext(value?: ExtensionPoint): ExtensionPoint; - ledgersToExpire(value?: number): number; + extendTo(value?: number): number; toXDR(format?: 'raw'): Buffer; toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BumpFootprintExpirationOp; + static read(io: Buffer): ExtendFootprintTtlOp; - static write(value: BumpFootprintExpirationOp, io: Buffer): void; + static write(value: ExtendFootprintTtlOp, io: Buffer): void; - static isValid(value: BumpFootprintExpirationOp): boolean; + static isValid(value: ExtendFootprintTtlOp): boolean; - static toXDR(value: BumpFootprintExpirationOp): Buffer; + static toXDR(value: ExtendFootprintTtlOp): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): BumpFootprintExpirationOp; + static fromXDR(input: Buffer, format?: 'raw'): ExtendFootprintTtlOp; static fromXDR( input: string, format: 'hex' | 'base64', - ): BumpFootprintExpirationOp; + ): ExtendFootprintTtlOp; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -7105,14 +7042,14 @@ export namespace xdr { constructor(attributes: { ext: ExtensionPoint; resources: SorobanResources; - refundableFee: Int64; + resourceFee: Int64; }); ext(value?: ExtensionPoint): ExtensionPoint; resources(value?: SorobanResources): SorobanResources; - refundableFee(value?: Int64): Int64; + resourceFee(value?: Int64): Int64; toXDR(format?: 'raw'): Buffer; @@ -9086,30 +9023,30 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class StateExpirationSettings { + class StateArchivalSettings { constructor(attributes: { - maxEntryExpiration: number; - minTempEntryExpiration: number; - minPersistentEntryExpiration: number; + maxEntryTtl: number; + minTemporaryTtl: number; + minPersistentTtl: number; persistentRentRateDenominator: Int64; tempRentRateDenominator: Int64; - maxEntriesToExpire: number; + maxEntriesToArchive: number; bucketListSizeWindowSampleSize: number; evictionScanSize: Uint64; startingEvictionScanLevel: number; }); - maxEntryExpiration(value?: number): number; + maxEntryTtl(value?: number): number; - minTempEntryExpiration(value?: number): number; + minTemporaryTtl(value?: number): number; - minPersistentEntryExpiration(value?: number): number; + minPersistentTtl(value?: number): number; persistentRentRateDenominator(value?: Int64): Int64; tempRentRateDenominator(value?: Int64): Int64; - maxEntriesToExpire(value?: number): number; + maxEntriesToArchive(value?: number): number; bucketListSizeWindowSampleSize(value?: number): number; @@ -9121,20 +9058,20 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): StateExpirationSettings; + static read(io: Buffer): StateArchivalSettings; - static write(value: StateExpirationSettings, io: Buffer): void; + static write(value: StateArchivalSettings, io: Buffer): void; - static isValid(value: StateExpirationSettings): boolean; + static isValid(value: StateArchivalSettings): boolean; - static toXDR(value: StateExpirationSettings): Buffer; + static toXDR(value: StateArchivalSettings): Buffer; - static fromXDR(input: Buffer, format?: 'raw'): StateExpirationSettings; + static fromXDR(input: Buffer, format?: 'raw'): StateArchivalSettings; static fromXDR( input: string, format: 'hex' | 'base64', - ): StateExpirationSettings; + ): StateArchivalSettings; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -9867,7 +9804,7 @@ export namespace xdr { configSetting(value?: ConfigSettingEntry): ConfigSettingEntry; - expiration(value?: ExpirationEntry): ExpirationEntry; + ttl(value?: TtlEntry): TtlEntry; static account(value: AccountEntry): LedgerEntryData; @@ -9887,7 +9824,7 @@ export namespace xdr { static configSetting(value: ConfigSettingEntry): LedgerEntryData; - static expiration(value: ExpirationEntry): LedgerEntryData; + static ttl(value: TtlEntry): LedgerEntryData; value(): | AccountEntry @@ -9899,7 +9836,7 @@ export namespace xdr { | ContractDataEntry | ContractCodeEntry | ConfigSettingEntry - | ExpirationEntry; + | TtlEntry; toXDR(format?: 'raw'): Buffer; @@ -9977,7 +9914,7 @@ export namespace xdr { configSetting(value?: LedgerKeyConfigSetting): LedgerKeyConfigSetting; - expiration(value?: LedgerKeyExpiration): LedgerKeyExpiration; + ttl(value?: LedgerKeyTtl): LedgerKeyTtl; static account(value: LedgerKeyAccount): LedgerKey; @@ -9997,7 +9934,7 @@ export namespace xdr { static configSetting(value: LedgerKeyConfigSetting): LedgerKey; - static expiration(value: LedgerKeyExpiration): LedgerKey; + static ttl(value: LedgerKeyTtl): LedgerKey; value(): | LedgerKeyAccount @@ -10009,7 +9946,7 @@ export namespace xdr { | LedgerKeyContractData | LedgerKeyContractCode | LedgerKeyConfigSetting - | LedgerKeyExpiration; + | LedgerKeyTtl; toXDR(format?: 'raw'): Buffer; @@ -10614,15 +10551,11 @@ export namespace xdr { v1(value?: LedgerCloseMetaV1): LedgerCloseMetaV1; - v2(value?: LedgerCloseMetaV2): LedgerCloseMetaV2; - static 0(value: LedgerCloseMetaV0): LedgerCloseMeta; static 1(value: LedgerCloseMetaV1): LedgerCloseMeta; - static 2(value: LedgerCloseMetaV2): LedgerCloseMeta; - - value(): LedgerCloseMetaV0 | LedgerCloseMetaV1 | LedgerCloseMetaV2; + value(): LedgerCloseMetaV0 | LedgerCloseMetaV1; toXDR(format?: 'raw'): Buffer; @@ -11256,9 +11189,7 @@ export namespace xdr { invokeHostFunctionOp(value?: InvokeHostFunctionOp): InvokeHostFunctionOp; - bumpFootprintExpirationOp( - value?: BumpFootprintExpirationOp, - ): BumpFootprintExpirationOp; + extendFootprintTtlOp(value?: ExtendFootprintTtlOp): ExtendFootprintTtlOp; restoreFootprintOp(value?: RestoreFootprintOp): RestoreFootprintOp; @@ -11322,9 +11253,7 @@ export namespace xdr { static invokeHostFunction(value: InvokeHostFunctionOp): OperationBody; - static bumpFootprintExpiration( - value: BumpFootprintExpirationOp, - ): OperationBody; + static extendFootprintTtl(value: ExtendFootprintTtlOp): OperationBody; static restoreFootprint(value: RestoreFootprintOp): OperationBody; @@ -11352,7 +11281,7 @@ export namespace xdr { | LiquidityPoolDepositOp | LiquidityPoolWithdrawOp | InvokeHostFunctionOp - | BumpFootprintExpirationOp + | ExtendFootprintTtlOp | RestoreFootprintOp | void; @@ -12839,7 +12768,7 @@ export namespace xdr { static invokeHostFunctionResourceLimitExceeded(): InvokeHostFunctionResult; - static invokeHostFunctionEntryExpired(): InvokeHostFunctionResult; + static invokeHostFunctionEntryArchived(): InvokeHostFunctionResult; static invokeHostFunctionInsufficientRefundableFee(): InvokeHostFunctionResult; @@ -12869,16 +12798,16 @@ export namespace xdr { static validateXDR(input: string, format: 'hex' | 'base64'): boolean; } - class BumpFootprintExpirationResult { - switch(): BumpFootprintExpirationResultCode; + class ExtendFootprintTtlResult { + switch(): ExtendFootprintTtlResultCode; - static bumpFootprintExpirationSuccess(): BumpFootprintExpirationResult; + static extendFootprintTtlSuccess(): ExtendFootprintTtlResult; - static bumpFootprintExpirationMalformed(): BumpFootprintExpirationResult; + static extendFootprintTtlMalformed(): ExtendFootprintTtlResult; - static bumpFootprintExpirationResourceLimitExceeded(): BumpFootprintExpirationResult; + static extendFootprintTtlResourceLimitExceeded(): ExtendFootprintTtlResult; - static bumpFootprintExpirationInsufficientRefundableFee(): BumpFootprintExpirationResult; + static extendFootprintTtlInsufficientRefundableFee(): ExtendFootprintTtlResult; value(): void; @@ -12886,23 +12815,20 @@ export namespace xdr { toXDR(format: 'hex' | 'base64'): string; - static read(io: Buffer): BumpFootprintExpirationResult; + static read(io: Buffer): ExtendFootprintTtlResult; - static write(value: BumpFootprintExpirationResult, io: Buffer): void; + static write(value: ExtendFootprintTtlResult, io: Buffer): void; - static isValid(value: BumpFootprintExpirationResult): boolean; + static isValid(value: ExtendFootprintTtlResult): boolean; - static toXDR(value: BumpFootprintExpirationResult): Buffer; + static toXDR(value: ExtendFootprintTtlResult): Buffer; - static fromXDR( - input: Buffer, - format?: 'raw', - ): BumpFootprintExpirationResult; + static fromXDR(input: Buffer, format?: 'raw'): ExtendFootprintTtlResult; static fromXDR( input: string, format: 'hex' | 'base64', - ): BumpFootprintExpirationResult; + ): ExtendFootprintTtlResult; static validateXDR(input: Buffer, format?: 'raw'): boolean; @@ -13025,9 +12951,9 @@ export namespace xdr { value?: InvokeHostFunctionResult, ): InvokeHostFunctionResult; - bumpFootprintExpirationResult( - value?: BumpFootprintExpirationResult, - ): BumpFootprintExpirationResult; + extendFootprintTtlResult( + value?: ExtendFootprintTtlResult, + ): ExtendFootprintTtlResult; restoreFootprintResult( value?: RestoreFootprintResult, @@ -13105,8 +13031,8 @@ export namespace xdr { value: InvokeHostFunctionResult, ): OperationResultTr; - static bumpFootprintExpiration( - value: BumpFootprintExpirationResult, + static extendFootprintTtl( + value: ExtendFootprintTtlResult, ): OperationResultTr; static restoreFootprint(value: RestoreFootprintResult): OperationResultTr; @@ -13137,7 +13063,7 @@ export namespace xdr { | LiquidityPoolDepositResult | LiquidityPoolWithdrawResult | InvokeHostFunctionResult - | BumpFootprintExpirationResult + | ExtendFootprintTtlResult | RestoreFootprintResult; toXDR(format?: 'raw'): Buffer; @@ -13568,7 +13494,7 @@ export namespace xdr { static contractExecutableWasm(value: Buffer): ContractExecutable; - static contractExecutableToken(): ContractExecutable; + static contractExecutableStellarAsset(): ContractExecutable; value(): Buffer | void; @@ -14049,9 +13975,7 @@ export namespace xdr { contractDataEntrySizeBytes(value?: number): number; - stateExpirationSettings( - value?: StateExpirationSettings, - ): StateExpirationSettings; + stateArchivalSettings(value?: StateArchivalSettings): StateArchivalSettings; contractExecutionLanes( value?: ConfigSettingContractExecutionLanesV0, @@ -14099,8 +14023,8 @@ export namespace xdr { value: number, ): ConfigSettingEntry; - static configSettingStateExpiration( - value: StateExpirationSettings, + static configSettingStateArchival( + value: StateArchivalSettings, ): ConfigSettingEntry; static configSettingContractExecutionLanes( @@ -14126,7 +14050,7 @@ export namespace xdr { | ContractCostParamEntry[] | number | number - | StateExpirationSettings + | StateArchivalSettings | ConfigSettingContractExecutionLanesV0 | Uint64[] | EvictionIterator; diff --git a/xdr/curr/Stellar-contract-config-setting.x b/xdr/curr/Stellar-contract-config-setting.x index 9512f0c4..b187a18c 100644 --- a/xdr/curr/Stellar-contract-config-setting.x +++ b/xdr/curr/Stellar-contract-config-setting.x @@ -92,64 +92,54 @@ struct ConfigSettingContractBandwidthV0 enum ContractCostType { // Cost of running 1 wasm instruction WasmInsnExec = 0, - // Cost of growing wasm linear memory by 1 page - WasmMemAlloc = 1, - // Cost of allocating a chuck of host memory (in bytes) - HostMemAlloc = 2, - // Cost of copying a chuck of bytes into a pre-allocated host memory - HostMemCpy = 3, - // Cost of comparing two slices of host memory - HostMemCmp = 4, + // Cost of allocating a slice of memory (in bytes) + MemAlloc = 1, + // Cost of copying a slice of bytes into a pre-allocated memory + MemCpy = 2, + // Cost of comparing two slices of memory + MemCmp = 3, // Cost of a host function dispatch, not including the actual work done by // the function nor the cost of VM invocation machinary - DispatchHostFunction = 5, + DispatchHostFunction = 4, // Cost of visiting a host object from the host object storage. Exists to // make sure some baseline cost coverage, i.e. repeatly visiting objects // by the guest will always incur some charges. - VisitObject = 6, + VisitObject = 5, // Cost of serializing an xdr object to bytes - ValSer = 7, + ValSer = 6, // Cost of deserializing an xdr object from bytes - ValDeser = 8, + ValDeser = 7, // Cost of computing the sha256 hash from bytes - ComputeSha256Hash = 9, + ComputeSha256Hash = 8, // Cost of computing the ed25519 pubkey from bytes - ComputeEd25519PubKey = 10, - // Cost of accessing an entry in a Map. - MapEntry = 11, - // Cost of accessing an entry in a Vec - VecEntry = 12, + ComputeEd25519PubKey = 9, // Cost of verifying ed25519 signature of a payload. - VerifyEd25519Sig = 13, - // Cost of reading a slice of vm linear memory - VmMemRead = 14, - // Cost of writing to a slice of vm linear memory - VmMemWrite = 15, + VerifyEd25519Sig = 10, // Cost of instantiation a VM from wasm bytes code. - VmInstantiation = 16, + VmInstantiation = 11, // Cost of instantiation a VM from a cached state. - VmCachedInstantiation = 17, + VmCachedInstantiation = 12, // Cost of invoking a function on the VM. If the function is a host function, // additional cost will be covered by `DispatchHostFunction`. - InvokeVmFunction = 18, + InvokeVmFunction = 13, // Cost of computing a keccak256 hash from bytes. - ComputeKeccak256Hash = 19, - // Cost of computing an ECDSA secp256k1 pubkey from bytes. - ComputeEcdsaSecp256k1Key = 20, + ComputeKeccak256Hash = 14, // Cost of computing an ECDSA secp256k1 signature from bytes. - ComputeEcdsaSecp256k1Sig = 21, + ComputeEcdsaSecp256k1Sig = 15, // Cost of recovering an ECDSA secp256k1 key from a signature. - RecoverEcdsaSecp256k1Key = 22, + RecoverEcdsaSecp256k1Key = 16, // Cost of int256 addition (`+`) and subtraction (`-`) operations - Int256AddSub = 23, + Int256AddSub = 17, // Cost of int256 multiplication (`*`) operation - Int256Mul = 24, + Int256Mul = 18, // Cost of int256 division (`/`) operation - Int256Div = 25, + Int256Div = 19, // Cost of int256 power (`exp`) operation - Int256Pow = 26, + Int256Pow = 20, // Cost of int256 shift (`shl`, `shr`) operation - Int256Shift = 27 + Int256Shift = 21, + // Cost of drawing random bytes using a ChaCha20 PRNG + ChaCha20DrawBytes = 22 }; struct ContractCostParamEntry { @@ -160,17 +150,17 @@ struct ContractCostParamEntry { int64 linearTerm; }; -struct StateExpirationSettings { - uint32 maxEntryExpiration; - uint32 minTempEntryExpiration; - uint32 minPersistentEntryExpiration; +struct StateArchivalSettings { + uint32 maxEntryTTL; + uint32 minTemporaryTTL; + uint32 minPersistentTTL; // rent_fee = wfee_rate_average / rent_rate_denominator_for_type int64 persistentRentRateDenominator; int64 tempRentRateDenominator; - // max number of entries that emit expiration meta in a single ledger - uint32 maxEntriesToExpire; + // max number of entries that emit archival meta in a single ledger + uint32 maxEntriesToArchive; // Number of snapshots to use when calculating average BucketList size uint32 bucketListSizeWindowSampleSize; @@ -206,7 +196,7 @@ enum ConfigSettingID CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, - CONFIG_SETTING_STATE_EXPIRATION = 10, + CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, CONFIG_SETTING_EVICTION_ITERATOR = 13 @@ -234,8 +224,8 @@ case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: uint32 contractDataKeySizeBytes; case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: uint32 contractDataEntrySizeBytes; -case CONFIG_SETTING_STATE_EXPIRATION: - StateExpirationSettings stateExpirationSettings; +case CONFIG_SETTING_STATE_ARCHIVAL: + StateArchivalSettings stateArchivalSettings; case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0 contractExecutionLanes; case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: diff --git a/xdr/curr/Stellar-contract.x b/xdr/curr/Stellar-contract.x index 7c7469c7..51130056 100644 --- a/xdr/curr/Stellar-contract.x +++ b/xdr/curr/Stellar-contract.x @@ -165,14 +165,14 @@ struct Int256Parts { enum ContractExecutableType { CONTRACT_EXECUTABLE_WASM = 0, - CONTRACT_EXECUTABLE_TOKEN = 1 + CONTRACT_EXECUTABLE_STELLAR_ASSET = 1 }; union ContractExecutable switch (ContractExecutableType type) { case CONTRACT_EXECUTABLE_WASM: Hash wasm_hash; -case CONTRACT_EXECUTABLE_TOKEN: +case CONTRACT_EXECUTABLE_STELLAR_ASSET: void; }; diff --git a/xdr/curr/Stellar-ledger-entries.x b/xdr/curr/Stellar-ledger-entries.x index f0664840..8a8784e2 100644 --- a/xdr/curr/Stellar-ledger-entries.x +++ b/xdr/curr/Stellar-ledger-entries.x @@ -101,7 +101,7 @@ enum LedgerEntryType CONTRACT_DATA = 6, CONTRACT_CODE = 7, CONFIG_SETTING = 8, - EXPIRATION = 9 + TTL = 9 }; struct Signer @@ -515,10 +515,10 @@ struct ContractCodeEntry { opaque code<>; }; -struct ExpirationEntry { - // Hash of the LedgerKey that is associated with this ExpirationEntry +struct TTLEntry { + // Hash of the LedgerKey that is associated with this TTLEntry Hash keyHash; - uint32 expirationLedgerSeq; + uint32 liveUntilLedgerSeq; }; struct LedgerEntryExtensionV1 @@ -557,8 +557,8 @@ struct LedgerEntry ContractCodeEntry contractCode; case CONFIG_SETTING: ConfigSettingEntry configSetting; - case EXPIRATION: - ExpirationEntry expiration; + case TTL: + TTLEntry ttl; } data; @@ -630,12 +630,12 @@ case CONFIG_SETTING: { ConfigSettingID configSettingID; } configSetting; -case EXPIRATION: +case TTL: struct { - // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash of the LedgerKey that is associated with this TTLEntry Hash keyHash; - } expiration; + } ttl; }; // list of all envelope types used in the application diff --git a/xdr/curr/Stellar-ledger.x b/xdr/curr/Stellar-ledger.x index a1bbac4b..b18a3a0d 100644 --- a/xdr/curr/Stellar-ledger.x +++ b/xdr/curr/Stellar-ledger.x @@ -486,26 +486,8 @@ struct LedgerCloseMetaV0 struct LedgerCloseMetaV1 { - LedgerHeaderHistoryEntry ledgerHeader; - - GeneralizedTransactionSet txSet; - - // NB: transactions are sorted in apply order here - // fees for all transactions are processed first - // followed by applying transactions - TransactionResultMeta txProcessing<>; - - // upgrades are applied last - UpgradeEntryMeta upgradesProcessing<>; - - // other misc information attached to the ledger close - SCPHistoryEntry scpInfo<>; -}; - -struct LedgerCloseMetaV2 -{ - // We forgot to add an ExtensionPoint in v1 but at least - // we can add one now in v2. + // We forgot to add an ExtensionPoint in v0 but at least + // we can add one now in v1. ExtensionPoint ext; LedgerHeaderHistoryEntry ledgerHeader; @@ -527,10 +509,10 @@ struct LedgerCloseMetaV2 // systems calculating storage fees correctly. uint64 totalByteSizeOfBucketList; - // Expired temp keys that are being evicted at this ledger. + // Temp keys that are being evicted at this ledger. LedgerKey evictedTemporaryLedgerKeys<>; - // Expired restorable ledger entries that are being + // Archived restorable ledger entries that are being // evicted at this ledger. LedgerEntry evictedPersistentLedgerEntries<>; }; @@ -541,7 +523,5 @@ case 0: LedgerCloseMetaV0 v0; case 1: LedgerCloseMetaV1 v1; -case 2: - LedgerCloseMetaV2 v2; }; } diff --git a/xdr/curr/Stellar-transaction.x b/xdr/curr/Stellar-transaction.x index 2e3c22b3..c7f0f5e2 100644 --- a/xdr/curr/Stellar-transaction.x +++ b/xdr/curr/Stellar-transaction.x @@ -63,7 +63,7 @@ enum OperationType LIQUIDITY_POOL_DEPOSIT = 22, LIQUIDITY_POOL_WITHDRAW = 23, INVOKE_HOST_FUNCTION = 24, - BUMP_FOOTPRINT_EXPIRATION = 25, + EXTEND_FOOTPRINT_TTL = 25, RESTORE_FOOTPRINT = 26 }; @@ -585,19 +585,19 @@ struct InvokeHostFunctionOp SorobanAuthorizationEntry auth<>; }; -/* Bump the expiration ledger of the entries specified in the readOnly footprint - so they'll expire at least ledgersToExpire ledgers from lcl. +/* Extend the TTL of the entries specified in the readOnly footprint + so they will live at least extendTo ledgers from lcl. Threshold: med - Result: BumpFootprintExpirationResult + Result: ExtendFootprintTTLResult */ -struct BumpFootprintExpirationOp +struct ExtendFootprintTTLOp { ExtensionPoint ext; - uint32 ledgersToExpire; + uint32 extendTo; }; -/* Restore the expired or evicted entries specified in the readWrite footprint. +/* Restore the archived entries specified in the readWrite footprint. Threshold: med Result: RestoreFootprintOp @@ -667,8 +667,8 @@ struct Operation LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; case INVOKE_HOST_FUNCTION: InvokeHostFunctionOp invokeHostFunctionOp; - case BUMP_FOOTPRINT_EXPIRATION: - BumpFootprintExpirationOp bumpFootprintExpirationOp; + case EXTEND_FOOTPRINT_TTL: + ExtendFootprintTTLOp extendFootprintTTLOp; case RESTORE_FOOTPRINT: RestoreFootprintOp restoreFootprintOp; } @@ -821,8 +821,16 @@ struct SorobanTransactionData { ExtensionPoint ext; SorobanResources resources; - // Portion of transaction `fee` allocated to refundable fees. - int64 refundableFee; + // Amount of the transaction `fee` allocated to the Soroban resource fees. + // The fraction of `resourceFee` corresponding to `resources` specified + // above is *not* refundable (i.e. fees for instructions, ledger I/O), as + // well as fees for the transaction size. + // The remaining part of the fee is refundable and the charged value is + // based on the actual consumption of refundable resources (events, ledger + // rent bumps). + // The `inclusionFee` used for prioritization of the transaction is defined + // as `tx.fee - resourceFee`. + int64 resourceFee; }; // TransactionV0 is a transaction with the AccountID discriminant stripped off, @@ -1789,7 +1797,7 @@ enum InvokeHostFunctionResultCode INVOKE_HOST_FUNCTION_MALFORMED = -1, INVOKE_HOST_FUNCTION_TRAPPED = -2, INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, - INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 }; @@ -1800,29 +1808,29 @@ case INVOKE_HOST_FUNCTION_SUCCESS: case INVOKE_HOST_FUNCTION_MALFORMED: case INVOKE_HOST_FUNCTION_TRAPPED: case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: -case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: +case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED: case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: void; }; -enum BumpFootprintExpirationResultCode +enum ExtendFootprintTTLResultCode { // codes considered as "success" for the operation - BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + EXTEND_FOOTPRINT_TTL_SUCCESS = 0, // codes considered as "failure" for the operation - BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, - BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, - BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + EXTEND_FOOTPRINT_TTL_MALFORMED = -1, + EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2, + EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3 }; -union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) +union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code) { -case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: +case EXTEND_FOOTPRINT_TTL_SUCCESS: void; -case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: -case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: -case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: +case EXTEND_FOOTPRINT_TTL_MALFORMED: +case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED: +case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE: void; }; @@ -1915,8 +1923,8 @@ case opINNER: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; case INVOKE_HOST_FUNCTION: InvokeHostFunctionResult invokeHostFunctionResult; - case BUMP_FOOTPRINT_EXPIRATION: - BumpFootprintExpirationResult bumpFootprintExpirationResult; + case EXTEND_FOOTPRINT_TTL: + ExtendFootprintTTLResult extendFootprintTTLResult; case RESTORE_FOOTPRINT: RestoreFootprintResult restoreFootprintResult; } diff --git a/xdr/next/Stellar-contract-config-setting.x b/xdr/next/Stellar-contract-config-setting.x index 9512f0c4..b187a18c 100644 --- a/xdr/next/Stellar-contract-config-setting.x +++ b/xdr/next/Stellar-contract-config-setting.x @@ -92,64 +92,54 @@ struct ConfigSettingContractBandwidthV0 enum ContractCostType { // Cost of running 1 wasm instruction WasmInsnExec = 0, - // Cost of growing wasm linear memory by 1 page - WasmMemAlloc = 1, - // Cost of allocating a chuck of host memory (in bytes) - HostMemAlloc = 2, - // Cost of copying a chuck of bytes into a pre-allocated host memory - HostMemCpy = 3, - // Cost of comparing two slices of host memory - HostMemCmp = 4, + // Cost of allocating a slice of memory (in bytes) + MemAlloc = 1, + // Cost of copying a slice of bytes into a pre-allocated memory + MemCpy = 2, + // Cost of comparing two slices of memory + MemCmp = 3, // Cost of a host function dispatch, not including the actual work done by // the function nor the cost of VM invocation machinary - DispatchHostFunction = 5, + DispatchHostFunction = 4, // Cost of visiting a host object from the host object storage. Exists to // make sure some baseline cost coverage, i.e. repeatly visiting objects // by the guest will always incur some charges. - VisitObject = 6, + VisitObject = 5, // Cost of serializing an xdr object to bytes - ValSer = 7, + ValSer = 6, // Cost of deserializing an xdr object from bytes - ValDeser = 8, + ValDeser = 7, // Cost of computing the sha256 hash from bytes - ComputeSha256Hash = 9, + ComputeSha256Hash = 8, // Cost of computing the ed25519 pubkey from bytes - ComputeEd25519PubKey = 10, - // Cost of accessing an entry in a Map. - MapEntry = 11, - // Cost of accessing an entry in a Vec - VecEntry = 12, + ComputeEd25519PubKey = 9, // Cost of verifying ed25519 signature of a payload. - VerifyEd25519Sig = 13, - // Cost of reading a slice of vm linear memory - VmMemRead = 14, - // Cost of writing to a slice of vm linear memory - VmMemWrite = 15, + VerifyEd25519Sig = 10, // Cost of instantiation a VM from wasm bytes code. - VmInstantiation = 16, + VmInstantiation = 11, // Cost of instantiation a VM from a cached state. - VmCachedInstantiation = 17, + VmCachedInstantiation = 12, // Cost of invoking a function on the VM. If the function is a host function, // additional cost will be covered by `DispatchHostFunction`. - InvokeVmFunction = 18, + InvokeVmFunction = 13, // Cost of computing a keccak256 hash from bytes. - ComputeKeccak256Hash = 19, - // Cost of computing an ECDSA secp256k1 pubkey from bytes. - ComputeEcdsaSecp256k1Key = 20, + ComputeKeccak256Hash = 14, // Cost of computing an ECDSA secp256k1 signature from bytes. - ComputeEcdsaSecp256k1Sig = 21, + ComputeEcdsaSecp256k1Sig = 15, // Cost of recovering an ECDSA secp256k1 key from a signature. - RecoverEcdsaSecp256k1Key = 22, + RecoverEcdsaSecp256k1Key = 16, // Cost of int256 addition (`+`) and subtraction (`-`) operations - Int256AddSub = 23, + Int256AddSub = 17, // Cost of int256 multiplication (`*`) operation - Int256Mul = 24, + Int256Mul = 18, // Cost of int256 division (`/`) operation - Int256Div = 25, + Int256Div = 19, // Cost of int256 power (`exp`) operation - Int256Pow = 26, + Int256Pow = 20, // Cost of int256 shift (`shl`, `shr`) operation - Int256Shift = 27 + Int256Shift = 21, + // Cost of drawing random bytes using a ChaCha20 PRNG + ChaCha20DrawBytes = 22 }; struct ContractCostParamEntry { @@ -160,17 +150,17 @@ struct ContractCostParamEntry { int64 linearTerm; }; -struct StateExpirationSettings { - uint32 maxEntryExpiration; - uint32 minTempEntryExpiration; - uint32 minPersistentEntryExpiration; +struct StateArchivalSettings { + uint32 maxEntryTTL; + uint32 minTemporaryTTL; + uint32 minPersistentTTL; // rent_fee = wfee_rate_average / rent_rate_denominator_for_type int64 persistentRentRateDenominator; int64 tempRentRateDenominator; - // max number of entries that emit expiration meta in a single ledger - uint32 maxEntriesToExpire; + // max number of entries that emit archival meta in a single ledger + uint32 maxEntriesToArchive; // Number of snapshots to use when calculating average BucketList size uint32 bucketListSizeWindowSampleSize; @@ -206,7 +196,7 @@ enum ConfigSettingID CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, - CONFIG_SETTING_STATE_EXPIRATION = 10, + CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, CONFIG_SETTING_EVICTION_ITERATOR = 13 @@ -234,8 +224,8 @@ case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: uint32 contractDataKeySizeBytes; case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: uint32 contractDataEntrySizeBytes; -case CONFIG_SETTING_STATE_EXPIRATION: - StateExpirationSettings stateExpirationSettings; +case CONFIG_SETTING_STATE_ARCHIVAL: + StateArchivalSettings stateArchivalSettings; case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0 contractExecutionLanes; case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: diff --git a/xdr/next/Stellar-contract.x b/xdr/next/Stellar-contract.x index 7c7469c7..51130056 100644 --- a/xdr/next/Stellar-contract.x +++ b/xdr/next/Stellar-contract.x @@ -165,14 +165,14 @@ struct Int256Parts { enum ContractExecutableType { CONTRACT_EXECUTABLE_WASM = 0, - CONTRACT_EXECUTABLE_TOKEN = 1 + CONTRACT_EXECUTABLE_STELLAR_ASSET = 1 }; union ContractExecutable switch (ContractExecutableType type) { case CONTRACT_EXECUTABLE_WASM: Hash wasm_hash; -case CONTRACT_EXECUTABLE_TOKEN: +case CONTRACT_EXECUTABLE_STELLAR_ASSET: void; }; diff --git a/xdr/next/Stellar-ledger-entries.x b/xdr/next/Stellar-ledger-entries.x index f0664840..8a8784e2 100644 --- a/xdr/next/Stellar-ledger-entries.x +++ b/xdr/next/Stellar-ledger-entries.x @@ -101,7 +101,7 @@ enum LedgerEntryType CONTRACT_DATA = 6, CONTRACT_CODE = 7, CONFIG_SETTING = 8, - EXPIRATION = 9 + TTL = 9 }; struct Signer @@ -515,10 +515,10 @@ struct ContractCodeEntry { opaque code<>; }; -struct ExpirationEntry { - // Hash of the LedgerKey that is associated with this ExpirationEntry +struct TTLEntry { + // Hash of the LedgerKey that is associated with this TTLEntry Hash keyHash; - uint32 expirationLedgerSeq; + uint32 liveUntilLedgerSeq; }; struct LedgerEntryExtensionV1 @@ -557,8 +557,8 @@ struct LedgerEntry ContractCodeEntry contractCode; case CONFIG_SETTING: ConfigSettingEntry configSetting; - case EXPIRATION: - ExpirationEntry expiration; + case TTL: + TTLEntry ttl; } data; @@ -630,12 +630,12 @@ case CONFIG_SETTING: { ConfigSettingID configSettingID; } configSetting; -case EXPIRATION: +case TTL: struct { - // Hash of the LedgerKey that is associated with this ExpirationEntry + // Hash of the LedgerKey that is associated with this TTLEntry Hash keyHash; - } expiration; + } ttl; }; // list of all envelope types used in the application diff --git a/xdr/next/Stellar-ledger.x b/xdr/next/Stellar-ledger.x index a1bbac4b..b18a3a0d 100644 --- a/xdr/next/Stellar-ledger.x +++ b/xdr/next/Stellar-ledger.x @@ -486,26 +486,8 @@ struct LedgerCloseMetaV0 struct LedgerCloseMetaV1 { - LedgerHeaderHistoryEntry ledgerHeader; - - GeneralizedTransactionSet txSet; - - // NB: transactions are sorted in apply order here - // fees for all transactions are processed first - // followed by applying transactions - TransactionResultMeta txProcessing<>; - - // upgrades are applied last - UpgradeEntryMeta upgradesProcessing<>; - - // other misc information attached to the ledger close - SCPHistoryEntry scpInfo<>; -}; - -struct LedgerCloseMetaV2 -{ - // We forgot to add an ExtensionPoint in v1 but at least - // we can add one now in v2. + // We forgot to add an ExtensionPoint in v0 but at least + // we can add one now in v1. ExtensionPoint ext; LedgerHeaderHistoryEntry ledgerHeader; @@ -527,10 +509,10 @@ struct LedgerCloseMetaV2 // systems calculating storage fees correctly. uint64 totalByteSizeOfBucketList; - // Expired temp keys that are being evicted at this ledger. + // Temp keys that are being evicted at this ledger. LedgerKey evictedTemporaryLedgerKeys<>; - // Expired restorable ledger entries that are being + // Archived restorable ledger entries that are being // evicted at this ledger. LedgerEntry evictedPersistentLedgerEntries<>; }; @@ -541,7 +523,5 @@ case 0: LedgerCloseMetaV0 v0; case 1: LedgerCloseMetaV1 v1; -case 2: - LedgerCloseMetaV2 v2; }; } diff --git a/xdr/next/Stellar-transaction.x b/xdr/next/Stellar-transaction.x index 2e3c22b3..c7f0f5e2 100644 --- a/xdr/next/Stellar-transaction.x +++ b/xdr/next/Stellar-transaction.x @@ -63,7 +63,7 @@ enum OperationType LIQUIDITY_POOL_DEPOSIT = 22, LIQUIDITY_POOL_WITHDRAW = 23, INVOKE_HOST_FUNCTION = 24, - BUMP_FOOTPRINT_EXPIRATION = 25, + EXTEND_FOOTPRINT_TTL = 25, RESTORE_FOOTPRINT = 26 }; @@ -585,19 +585,19 @@ struct InvokeHostFunctionOp SorobanAuthorizationEntry auth<>; }; -/* Bump the expiration ledger of the entries specified in the readOnly footprint - so they'll expire at least ledgersToExpire ledgers from lcl. +/* Extend the TTL of the entries specified in the readOnly footprint + so they will live at least extendTo ledgers from lcl. Threshold: med - Result: BumpFootprintExpirationResult + Result: ExtendFootprintTTLResult */ -struct BumpFootprintExpirationOp +struct ExtendFootprintTTLOp { ExtensionPoint ext; - uint32 ledgersToExpire; + uint32 extendTo; }; -/* Restore the expired or evicted entries specified in the readWrite footprint. +/* Restore the archived entries specified in the readWrite footprint. Threshold: med Result: RestoreFootprintOp @@ -667,8 +667,8 @@ struct Operation LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; case INVOKE_HOST_FUNCTION: InvokeHostFunctionOp invokeHostFunctionOp; - case BUMP_FOOTPRINT_EXPIRATION: - BumpFootprintExpirationOp bumpFootprintExpirationOp; + case EXTEND_FOOTPRINT_TTL: + ExtendFootprintTTLOp extendFootprintTTLOp; case RESTORE_FOOTPRINT: RestoreFootprintOp restoreFootprintOp; } @@ -821,8 +821,16 @@ struct SorobanTransactionData { ExtensionPoint ext; SorobanResources resources; - // Portion of transaction `fee` allocated to refundable fees. - int64 refundableFee; + // Amount of the transaction `fee` allocated to the Soroban resource fees. + // The fraction of `resourceFee` corresponding to `resources` specified + // above is *not* refundable (i.e. fees for instructions, ledger I/O), as + // well as fees for the transaction size. + // The remaining part of the fee is refundable and the charged value is + // based on the actual consumption of refundable resources (events, ledger + // rent bumps). + // The `inclusionFee` used for prioritization of the transaction is defined + // as `tx.fee - resourceFee`. + int64 resourceFee; }; // TransactionV0 is a transaction with the AccountID discriminant stripped off, @@ -1789,7 +1797,7 @@ enum InvokeHostFunctionResultCode INVOKE_HOST_FUNCTION_MALFORMED = -1, INVOKE_HOST_FUNCTION_TRAPPED = -2, INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, - INVOKE_HOST_FUNCTION_ENTRY_EXPIRED = -4, + INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 }; @@ -1800,29 +1808,29 @@ case INVOKE_HOST_FUNCTION_SUCCESS: case INVOKE_HOST_FUNCTION_MALFORMED: case INVOKE_HOST_FUNCTION_TRAPPED: case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: -case INVOKE_HOST_FUNCTION_ENTRY_EXPIRED: +case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED: case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: void; }; -enum BumpFootprintExpirationResultCode +enum ExtendFootprintTTLResultCode { // codes considered as "success" for the operation - BUMP_FOOTPRINT_EXPIRATION_SUCCESS = 0, + EXTEND_FOOTPRINT_TTL_SUCCESS = 0, // codes considered as "failure" for the operation - BUMP_FOOTPRINT_EXPIRATION_MALFORMED = -1, - BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED = -2, - BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE = -3 + EXTEND_FOOTPRINT_TTL_MALFORMED = -1, + EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2, + EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3 }; -union BumpFootprintExpirationResult switch (BumpFootprintExpirationResultCode code) +union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code) { -case BUMP_FOOTPRINT_EXPIRATION_SUCCESS: +case EXTEND_FOOTPRINT_TTL_SUCCESS: void; -case BUMP_FOOTPRINT_EXPIRATION_MALFORMED: -case BUMP_FOOTPRINT_EXPIRATION_RESOURCE_LIMIT_EXCEEDED: -case BUMP_FOOTPRINT_EXPIRATION_INSUFFICIENT_REFUNDABLE_FEE: +case EXTEND_FOOTPRINT_TTL_MALFORMED: +case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED: +case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE: void; }; @@ -1915,8 +1923,8 @@ case opINNER: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; case INVOKE_HOST_FUNCTION: InvokeHostFunctionResult invokeHostFunctionResult; - case BUMP_FOOTPRINT_EXPIRATION: - BumpFootprintExpirationResult bumpFootprintExpirationResult; + case EXTEND_FOOTPRINT_TTL: + ExtendFootprintTTLResult extendFootprintTTLResult; case RESTORE_FOOTPRINT: RestoreFootprintResult restoreFootprintResult; }