specborn documentation contents ↓

Checkpoint sync #

Checkpoint sync starts the consensus layer from a recent finalized beacon state instead of from genesis. In specborn it is its own command, specborn checkpoint-sync. This page explains how it works, how to obtain and verify the anchor yourself, and how to run it.

What it is today. specborn checkpoint-sync follows the consensus chain of Hoodi, Sepolia or a devnet from your anchor: forward sync, backfill, and the head over gossip. On Hoodi and Sepolia the command has no execution state, so every head stays optimistic (NOT_VALIDATED); on local devnets it can execute the payloads (below). Execution state sync by snap is a separate command, specborn el-sync. It has no JSON-RPC, no beacon API, no transaction pool and no validator options, and it is a separate command from specborn run (which syncs from genesis). See Networks.

Why there is no default checkpoint provider #

specborn ships no checkpoint-sync URL, on purpose: a built-in provider is a central party that every node trusts by default, and the node would contact it without the operator choosing to. In specborn the anchor is always the operator's input: two SSZ files you obtained yourself, from a source you chose. Without them the command does not start; the alternative that needs no one's state is syncing from genesis (specborn run, on the networks where that is possible, see Networks).

The anchor is TRUSTED: the node cannot prove that a state you hand it is the real chain's. What it does check is listed below.

Obtaining an anchor #

You need, from the same moment:

  1. the finalized BeaconState, SSZ-encoded (Fulu or Gloas; earlier forks are refused);
  2. its SignedBeaconBlock, SSZ-encoded.

The usual way is the standard beacon API of a consensus node you run or trust (another client on your own machine, a friend's node, a provider you chose):

API=http://127.0.0.1:5052    # a beacon node you trust
curl -sf -H 'Accept: application/octet-stream' "$API/eth/v2/debug/beacon/states/finalized" -o state.ssz
curl -sf -H 'Accept: application/octet-stream' "$API/eth/v2/beacon/blocks/finalized" -o block.ssz

Finality can advance between the two requests; the node then refuses the pair because the block's state_root is not the state's root. Fetch both again.

Verifying the anchor yourself #

Do not trust a single source. Before starting:

  1. Note the finalized checkpoint (block root and epoch) your source reports, for example "$API/eth/v1/beacon/states/finalized/finality_checkpoints".
  2. Ask at least one independent source for the same thing: a second beacon node operated by someone else, a block explorer, a friend. The roots must agree for the same epoch.
  3. Give the node that independently obtained checkpoint as --ws-checkpoint ROOT:EPOCH (root as 0x…, epoch as a decimal number).

This is the weak-subjectivity checkpoint of the consensus specifications (phase0 "Weak Subjectivity Sync Procedure"): the node then checks that the block at that epoch on its finalized chain has that root.

The checkpoint authenticates the anchor only when its root is the anchor itself or a confirmed descendant of it (Specborn/Node/Checkpoint/Anchor.lean, reading A2). So take the second source's checkpoint at the anchor's epoch or later — the finalized checkpoint it reports when you fetch the anchor, or shortly after, does that — not an older one.

What the node checks #

At start and while running (docs/pieces/cpsync.md §7, §12.1):

Not checked: whether the anchor is within the weak-subjectivity period. The library has the period computation (isWithinWsPeriod in Specborn/Node/Checkpoint/WeakSubjectivity.lean), but the command does not call it. Use a recent finalized state.

Running it #

specborn checkpoint-sync \
  --network ./hoodi --anchor-state ./state.ssz --anchor-block ./block.ssz \
  --bootnodes ./hoodi/bootstrap_nodes.yaml \
  --ws-checkpoint 0xROOT:EPOCH --datadir ./cp-data

Every option is in the CLI reference. The scripts the project used live in Tests/Cpsync/live/ (cpsync-hoodi.sh shows a complete Hoodi invocation, including how it prepared config.yaml). Before piece cpsync round 27 the command ran only through the cpsync test stage; it is now in the binary.

What you will see #

One CPSLOT <slot> … line per slot. The fields that matter most:

FieldMeaning
sync=FOLLOWING once at the peers' head; SYNCING(…) before
head=… head_slot=…the fork-choice head
optimistic=true while the head's payload has not been executed (always, without the execution catch-up)
may_sign_attestation=whether a validator would be allowed to attest on this head (false on an optimistic head); the node runs no validator, this shows the gate
ws_pending=the weak-subjectivity checkpoint not yet confirmed, or none
anchor=ROOT@SLOTthe anchor you supplied
backfill_oldest=, backfilled=, backfill_done=progress of the backfill below the anchor
peers=connected peers (at most 16)
el=the state of the execution catch-up: none without an execution start; waiting_for_start_block(…) until the finalized chain confirms the start block; catching_up(…) while payloads are queued (on Gloas also until backfill is done); synced(…) once caught up; stopped(…) if it stopped. Under specborn el-sync --follow, a suffix start_final=false(start=N) while finality has not passed the engine's start block N

Optimistic sync and the execution catch-up #

The execution side has no state at the anchor. Every payload whose stateless checks pass is imported optimistically (NOT_VALIDATED), as bellatrix/optimistic-sync.md specifies, and no validator duty is taken on an optimistic head. Nothing is ever marked VALID without an engine answer.

Three execution starts turn on the execution catch-up, in which the in-process engine executes the payloads from a start block on, and heads move to VALID:

Every payload above the start block is executed: those already imported by the catch-up, and on Fulu each new payload whose parent the engine knows at import. A Fulu payload whose parent the engine does not know is dropped from the catch-up (execution catch-up: payload at slot … dropped: its parent … is not known to the engine) and stays NOT_VALIDATED. The catch-up queue holds at most 65,536 payloads and 1 GiB; beyond that the catch-up stops.

None of this reaches Hoodi, Sepolia or mainnet with this command: their genesis is neither Fulu nor Gloas, and the node cannot obtain a Hoodi execution state today (docs/pieces/hoodiel.md §3.5). Execution state sync by snap is the separate command specborn el-sync; its --follow mode runs this command's node from a Gloas anchor (a Fulu anchor is refused) and executes the payloads above the downloaded state.

The start block waits for the finalized chain. The block the catch-up starts from (the execution genesis of --el-genesis, Fulu or Gloas, or the block of an --el-state file) is not trusted on its own. The engine that knows it is installed only once the finalized chain confirms it: at start, when the anchor names it (Fulu: the anchor's payload or its parent; Gloas: the anchor state's latest execution block hash), or later, when a backfilled finalized block builds on it (execution catch-up: start block … confirmed by the payload of backfilled block at slot …; engine installed, on Gloas … by the bid of …; at start the node says when it waits: checkpoint sync: the start block … is not the anchor's payload or its parent: … or checkpoint sync: the execution genesis … is not named by the anchor: …). The state the node persisted itself is installed at once, without this confirmation. Until then the status line shows el=waiting_for_start_block(…) and every head stays NOT_VALIDATED. If backfill finishes and no finalized block has confirmed the start block (a genesis or state file of another chain, or a state below the backfill), the catch-up stops with execution catch-up: stopped: … ; payloads stay NOT_VALIDATED and el=stopped(…); the node keeps following the consensus chain optimistically. Check that the file matches the network, then restart. With --no-backfill there is no backfill to finish, so an unconfirmed start block keeps the catch-up waiting until its queue limit stops it: give an --el-state at the anchor's payload or its parent.

Evidence #

Limits #