diff --git a/Stellar-contract-config-setting.x b/Stellar-contract-config-setting.x index ac4c400..6956434 100644 --- a/Stellar-contract-config-setting.x +++ b/Stellar-contract-config-setting.x @@ -162,17 +162,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; @@ -208,7 +208,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 @@ -236,8 +236,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/Stellar-ledger-entries.x b/Stellar-ledger-entries.x index f066484..8a8784e 100644 --- a/Stellar-ledger-entries.x +++ b/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/Stellar-ledger.x b/Stellar-ledger.x index b218ae3..b18a3a0 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -509,10 +509,10 @@ struct LedgerCloseMetaV1 // 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<>; }; diff --git a/Stellar-transaction.x b/Stellar-transaction.x index 67d1206..19da55e 100644 --- a/Stellar-transaction.x +++ b/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; } @@ -1797,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 }; @@ -1808,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; }; @@ -1923,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; }