Skip to content
Draft
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
109 changes: 109 additions & 0 deletions proto/snapshot.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
syntax = "proto3";
package org.solana.sealevel.v1;
import "context.proto";
import "block.proto";
import "metadata.proto";

// Snapshot deserialization input with explicit version selection
message SnapshotContext {
// Snapshot format version (e.g. maps to DeserializableVersionedBank variants)
uint64 version = 1;

// Raw serialized snapshot bank data (bincode)
bytes data = 2;
}

message HardFork {
uint64 slot = 1;
uint64 count = 2;
}

message RentCollector {
uint64 epoch = 1;
EpochSchedule epoch_schedule = 2;
double slots_per_year = 3;
Rent rent = 4;
}

// Deserialized snapshot bank fields for comparison.
// Mirrors DeserializableVersionedBank (Agave) / fd_snapshot_manifest (Firedancer).
message SnapshotEffects {
int32 result = 1;

// Blockhash queue (ordered from oldest to newest, up to 301 entries)
repeated BlockhashQueueEntry blockhash_queue = 2;

// Ancestor slots (being removed in Agave v4.0 reads, zeroed in v4.1)
repeated uint64 ancestors = 3;

// Bank hash (32 bytes)
bytes hash = 4;

// Parent bank hash (32 bytes)
bytes parent_hash = 5;

uint64 parent_slot = 6;

repeated HardFork hard_forks = 7;

uint64 transaction_count = 8;

uint64 tick_height = 9;

uint64 signature_count = 10;

uint64 capitalization = 11;

uint64 max_tick_height = 12;

// None encoded as 0 with has_hashes_per_tick = false
bool has_hashes_per_tick = 13;
uint64 hashes_per_tick = 14;

uint64 ticks_per_slot = 15;

// uint128 encoded as 16 bytes little-endian
bytes ns_per_slot = 16;

int64 genesis_creation_time = 17;

double slots_per_year = 18;

uint64 accounts_data_len = 19;

uint64 slot = 20;

// Being removed in Agave v4.0 reads, zeroed in v4.1
uint64 epoch = 21;

uint64 block_height = 22;

// Collector pubkey (32 bytes)
bytes collector_id = 23;

// Being removed in Agave v4.0 reads, zeroed in v4.1
uint64 collector_fees = 24;

FeeRateGovernor fee_rate_governor = 25;

// Being removed in Agave v4.0 reads, zeroed in v4.1
RentCollector rent_collector = 26;

EpochSchedule epoch_schedule = 27;

Inflation inflation = 28;

repeated StakeDelegation stake_delegations = 29;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe use stakescache/epoch_stakes agave-ish types here


repeated PrevVoteAccount vote_accounts = 30;

bool is_delta = 31;

uint64 lamports_per_signature = 32;
}

message SnapshotFixture {
FixtureMetadata metadata = 1;
SnapshotContext input = 2;
SnapshotEffects output = 3;
}
Loading