diff --git a/Stellar-ledger.x b/Stellar-ledger.x index 9c0d036..6ab63fb 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -300,10 +300,11 @@ case 0: enum LedgerEntryChangeType { - LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger - LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger - LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger - LEDGER_ENTRY_STATE = 3 // value of the entry + LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger + LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger + LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger + LEDGER_ENTRY_STATE = 3, // value of the entry + LEDGER_ENTRY_RESTORED = 4 // archived entry was restored in the ledger }; union LedgerEntryChange switch (LedgerEntryChangeType type) @@ -316,6 +317,8 @@ case LEDGER_ENTRY_REMOVED: LedgerKey removed; case LEDGER_ENTRY_STATE: LedgerEntry state; +case LEDGER_ENTRY_RESTORED: + LedgerEntry restored; }; typedef LedgerEntryChange LedgerEntryChanges<>; @@ -506,12 +509,27 @@ struct LedgerCloseMetaExtV1 int64 sorobanFeeWrite1KB; }; +struct LedgerCloseMetaExtV2 +{ + ExtensionPoint ext; + int64 sorobanFeeWrite1KB; + + uint32 currentArchivalEpoch; + + // The last epoch currently stored by validators + // Any entry restored from an epoch older than this will + // require a proof. + uint32 lastArchivalEpochPersisted; +}; + union LedgerCloseMetaExt switch (int v) { case 0: void; case 1: LedgerCloseMetaExtV1 v1; +case 2: + LedgerCloseMetaExtV2 v2; }; struct LedgerCloseMetaV1 @@ -537,10 +555,12 @@ struct LedgerCloseMetaV1 // systems calculating storage fees correctly. uint64 totalByteSizeOfBucketList; - // Temp keys that are being evicted at this ledger. + // Temp keys and all TTL keys that are being evicted at this ledger. + // Note that this can contain TTL keys for both persistent and temporary + // entries, but the name is kept for legacy reasons. LedgerKey evictedTemporaryLedgerKeys<>; - // Archived restorable ledger entries that are being + // Archived persistent ledger entries that are being // evicted at this ledger. LedgerEntry evictedPersistentLedgerEntries<>; }; diff --git a/Stellar-transaction.x b/Stellar-transaction.x index f285506..6b10e4d 100644 --- a/Stellar-transaction.x +++ b/Stellar-transaction.x @@ -837,7 +837,7 @@ struct ArchivalProofNode typedef ArchivalProofNode ProofLevel<>; -struct NonexistenceProofBody +struct ExistenceProofBody { ColdArchiveBucketEntry entriesToProve<>; @@ -846,7 +846,7 @@ struct NonexistenceProofBody ProofLevel proofLevels<>; }; -struct ExistenceProofBody +struct NonexistenceProofBody { LedgerKey keysToProve<>; @@ -866,9 +866,9 @@ struct ArchivalProof union switch (ArchivalProofType t) { - case EXISTENCE: - NonexistenceProofBody nonexistenceProof; case NONEXISTENCE: + NonexistenceProofBody nonexistenceProof; + case EXISTENCE: ExistenceProofBody existenceProof; } body; }; @@ -1876,7 +1876,8 @@ enum InvokeHostFunctionResultCode INVOKE_HOST_FUNCTION_TRAPPED = -2, INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, - INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 + INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5, + INVOKE_HOST_FUNCTION_INVALID_CREATION_PROOF = -6 }; union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) @@ -1920,7 +1921,8 @@ enum RestoreFootprintResultCode // codes considered as "failure" for the operation RESTORE_FOOTPRINT_MALFORMED = -1, RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, - RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 + RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3, + RESTORE_FOOTPRINT_INVALID_PROOF = -4 }; union RestoreFootprintResult switch (RestoreFootprintResultCode code)