diff --git a/proto/snapshot.proto b/proto/snapshot.proto new file mode 100644 index 0000000..7236519 --- /dev/null +++ b/proto/snapshot.proto @@ -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; + + 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; +}