Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot Archive types (#200) #201

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading