Consider this an informal guide to reading the Solana snapshot format. This guide is written for Solana Labs versions v1.14 through v1.17.
You are probably reading this because you want to read the accounts in a snapshot without going through the pain of interfacing with the Solana Labs codebase.
We assume general familiarity with the Solana ledger.
| # Only package specifics to tracking | |
| [dev-dependencies] | |
| colored = "=2.2.0" # Bring some colors to the terminal | |
| ctor = "=0.2.9" # Used to execute a function when tests finishes | |
| once_cell = "=1.20.2" | |
| lazy_static = "=1.5.0" |
For this deconstruction, we will be researching fib.so, a hand-rolled sBPF assembly program that calculates the fibonacci number based upon a u8 input.
The structure of an sBPF program has 4 sections:
The starting point of the file, describing the overall file format, target environment, and offsets for program and section headers.
Define the memory segments and their attributes (readable, writable, executable) for runtime execution.