Skip to main content

Module snap

Module snap 

Source
Available on crate features node-api and node only.
Expand description

Runs a snap/2 bootstrap as the engine’s backfill.

One task alternates header sync and snap state writes while the engine skips forkchoice, so no other writer touches the database. Each pass:

  1. Syncs headers to the target; nothing below the pivot executes.
  2. Selects a pivot under the head, or resumes the recorded attempt while its pivot is canonical.
  3. Downloads state against the pivot’s root, carried to newer pivots by block access lists.
  4. Hands the state to SnapHandoff, which rebuilds the trie and publishes it at the pivot, or abandons the attempt on a root mismatch so the next pass starts a new one.

A forkchoice update ends the current step at its next boundary, so headers catch up first. The staged pipeline then runs the stages above the pivot.

Structs§

SnapBackfillSync
Backfills canonical headers, then snap/2 state at a recent pivot.
SnapHandoff
Hands one attempt’s downloaded state over to the staged pipeline.

Enums§

EthereumBackfill
Builds the Ethereum node’s backfill: the staged pipeline, or snap sync with --snap.v2.
EthereumBackfillSync
The Ethereum node’s backfill: the staged pipeline, or snap sync.
HandoffOutcome
What a handoff did with the downloaded state.
RebuildOutcome
How a trie rebuild ended.