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 24, 2024
1 parent 482ed02 commit 669d3b3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ enum EnvelopeType
ENVELOPE_TYPE_CONTRACT_ID = 8,
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
};
}

enum BucketListType
{
Expand Down Expand Up @@ -795,3 +794,4 @@ case COLD_ARCHIVE_BOUNDARY_LEAF:
case COLD_ARCHIVE_HASH:
ColdArchiveHashEntry hashEntry;
};
}
19 changes: 18 additions & 1 deletion Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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<>;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 669d3b3

Please sign in to comment.