Skip to content

Commit

Permalink
Hot Archive types (#200) (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirTyson authored Aug 8, 2024
1 parent 78ef986 commit 93e8e3e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ struct ConfigUpgradeSet {
ConfigSettingEntry updatedEntry<>;
};

enum BucketListType
{
LIVE = 0,
HOT_ARCHIVE = 1,
COLD_ARCHIVE = 2
};

/* Entries used to define the bucket list */
enum BucketEntryType
{
Expand All @@ -168,6 +175,16 @@ enum BucketEntryType
INITENTRY = 2 // At-and-after protocol 11: only created.
};

enum HotArchiveBucketEntryType
{
HOT_ARCHIVE_METAENTRY = -1, // Bucket metadata, should come first.
HOT_ARCHIVE_ARCHIVED = 0, // Entry is Archived
HOT_ARCHIVE_LIVE = 1, // Entry was previously HOT_ARCHIVE_ARCHIVED, or HOT_ARCHIVE_DELETED, but
// has been added back to the live BucketList.
// Does not need to be persisted.
HOT_ARCHIVE_DELETED = 2 // Entry deleted (Note: must be persisted in archive)
};

struct BucketMetadata
{
// Indicates the protocol version used to create / merge this bucket.
Expand All @@ -178,6 +195,8 @@ struct BucketMetadata
{
case 0:
void;
case 1:
BucketListType bucketListType;
}
ext;
};
Expand All @@ -194,6 +213,18 @@ case METAENTRY:
BucketMetadata metaEntry;
};

union HotArchiveBucketEntry switch (HotArchiveBucketEntryType type)
{
case HOT_ARCHIVE_ARCHIVED:
LedgerEntry archivedEntry;

case HOT_ARCHIVE_LIVE:
case HOT_ARCHIVE_DELETED:
LedgerKey key;
case HOT_ARCHIVE_METAENTRY:
BucketMetadata metaEntry;
};

enum TxSetComponentType
{
// txs with effective fee <= bid derived from a base fee (if any).
Expand Down

0 comments on commit 93e8e3e

Please sign in to comment.