Skip to content

Commit

Permalink
Add restoration and state archival meta
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson committed Sep 25, 2024
1 parent 8c88608 commit 281b1db
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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<>;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 281b1db

Please sign in to comment.