From 669d3b3862501203745c170b8ea2e49aa823d92f Mon Sep 17 00:00:00 2001 From: Garand Tyson Date: Tue, 24 Sep 2024 11:41:50 -0700 Subject: [PATCH] Add restoration and state archival meta --- Stellar-ledger-entries.x | 2 +- Stellar-ledger.x | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Stellar-ledger-entries.x b/Stellar-ledger-entries.x index 44d06c0..5bf4f9d 100644 --- a/Stellar-ledger-entries.x +++ b/Stellar-ledger-entries.x @@ -678,7 +678,6 @@ enum EnvelopeType ENVELOPE_TYPE_CONTRACT_ID = 8, ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 }; -} enum BucketListType { @@ -795,3 +794,4 @@ case COLD_ARCHIVE_BOUNDARY_LEAF: case COLD_ARCHIVE_HASH: ColdArchiveHashEntry hashEntry; }; +} \ No newline at end of file diff --git a/Stellar-ledger.x b/Stellar-ledger.x index 0fc03e2..6135d26 100644 --- a/Stellar-ledger.x +++ b/Stellar-ledger.x @@ -292,7 +292,8 @@ 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_STATE = 3, // value of the entry + LEDGER_ENTRY_RESTORE = 4 // archived entry was restored in the ledger }; union LedgerEntryChange switch (LedgerEntryChangeType type) @@ -305,6 +306,8 @@ case LEDGER_ENTRY_REMOVED: LedgerKey removed; case LEDGER_ENTRY_STATE: LedgerEntry state; +case LEDGER_ENTRY_RESTORE: + LedgerEntry restored; }; typedef LedgerEntryChange LedgerEntryChanges<>; @@ -497,12 +500,26 @@ struct LedgerCloseMetaExtV1 int64 sorobanFeeWrite1KB; }; +struct LedgerCloseMetaExtV2 +{ + 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