Skip to content
24 changes: 17 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ snapshot (`States`) + diff (`StateDiffs`) pairs; `BlockRoots` and `LiveChain`
index by slot for range serving and fork choice. Attestations and gossip
signatures are not persisted; they live in in-memory `Store` buffers consumed
during the tick pipeline. See [`docs/data_storage.md`](docs/data_storage.md)
for the full reference: what each of the ten tables holds and how it's
for the full reference: what each of the eleven tables holds and how it's
keyed, the snapshot/diff reconstruction algorithm, the block-import write
sequence, pruning rules, what never changes at runtime, and startup/restore
behavior.
Expand All @@ -794,12 +794,22 @@ behavior.
which is what keeps a parked column from satisfying the availability gate.
Its only index is the chain actor's in-memory `sidecars_awaiting_parent`, so
`start_actor` clears the whole table at startup.
- `DB_VERSION` is 4: `Config` gained `PRESET_BASE` and `CONFIG_NAME` (as
`ConfigName`, a bounded string) at the front of its encoding, and it is
SSZ-encoded under `KEY_CONFIG`, so a data directory written by an earlier
version decodes into the wrong fields. (3 was the runtime keys a
`config.yaml` supplies.) `Store::from_db_state` refuses any other version
outright; there is no migration.
- `BeaconUnrealizedJustifications` (root -> `(slot, Checkpoint)`) persists the
beacon store's per-block unrealized justified checkpoint
(consensus-specs' `store.unrealized_justifications`), which used to live
only in an in-memory `BeaconScratch` map. A restart emptied that map with
nothing to refill it, so `get_voting_source` hit a hard `SpecAssert` on the
first pre-restart leaf from an older epoch and `get_head` froze. The
in-memory map stays as a write-through cache in front of the table. Pruned
on finalization to the same horizon as `LiveChain` (the finalized block's
own slot, keeping that block's own entry).
- `DB_VERSION` is 5: the new unrealized-justifications table means a
directory written by an earlier version has no row there for any block it
already imported, which would otherwise look identical to "no unrealized
justification computed yet" rather than "this directory predates the
table". (4 was `PRESET_BASE`/`CONFIG_NAME` at the front of `Config`; 3 was
the runtime keys a `config.yaml` supplies.) `Store::from_db_state` refuses
any other version outright; there is no migration.

### State Root Computation
- Always computed via `hash_tree_root()` after full state transition
Expand Down
Loading
Loading