Chapter 07 · ~15 min
How it lives in our node
Verify-before-vote, state that floats, and the proof trail that outlives everything.
What you’ll walk away with
- The division of labor: consensus decides which block — everything about what a block is stays the node’s existing machinery
- Why a validator re-executes every block before voting, and why a lying proposer therefore costs one view, not a halt
- Speculative state as an overlay tree that mostly gets thrown away — only finalized blocks ever reach disk
- The finality store: the node’s own, library-independent trail of proof
Thirty-two bytes arrive
The consensus engine — which, remember from chapter 6, deals only in digests — holds them up and asks your node one question: may I vote for this? Somewhere in the next few hundred milliseconds your validator will sign its name under someone else’s block, or quietly decline. This chapter is everything that happens between those two moments: what the node builds, what it keeps floating in memory, what it refuses to say, and what it writes down forever.
Which block, not what block
Start with what did not change. A block is still built by the machinery you already
know: the same mempool streams, the same seal policy, the same fee sourcing, the same
protocol-upgrade handling as the linear sequencer. When this validator’s turn to lead
comes, consensus calls build with exactly one new twist — the parent to build on
comes from consensus, and it may itself still be unfinalized. Returning “nothing to
propose” is legal and routine: the view times out and the next leader goes; chapter 4
taught you that’s weather, not damage.
Three small facts about the mempool under speculation are worth carrying (the builder’s module docs state them precisely):
- Building never consumes transactions from the pool — the pool updates once per block, at commit time, in final order. An abandoned proposal leaves the pool untouched, because it never touched it.
- Building on an unfinalized parent, the pool may re-offer transactions the parent already included. Execution rejects them against the parent’s speculative state (nonce too low) — wasteful in the rare case, never incorrect.
- If competing branches diverge, a transaction can occasionally be purged early — a liveness pinprick (the sender resubmits), never a safety issue.
That’s the leader path. The follower path — verify — is this chapter’s finale. In
between, both paths need somewhere to stand: state for blocks that are not final yet.
State that floats
Here’s the problem shape. Verifying block H+1 means executing it before it’s final — sometimes before its parent is final either, and sometimes for two competing candidates at the same height (notarized-is-not-finalized, live from chapter 4). But the node’s durable stores are strictly linear: one diff per block number, written only after finality. Speculation must never touch them.
The answer is a small in-memory overlay tree floating above the committed state. Each pending block’s execution writes become one overlay — keyed by the block’s digest, linked to its parent’s overlay. Reading through a branch walks its overlays newest-first and falls through to the committed base. And an overlay dies in exactly one of two ways: the block finalizes — its outputs flow into the persistence pipeline, and the overlay is simply dropped as the durable backend takes over — or the block is abandoned, and the overlay is dropped without ceremony. There is no undo, because nothing was ever done.
Two invariants carry the whole design:
- Nothing persists before finality. Disk state is always a prefix of the finalized chain — which is why rolling back to single-sequencer operation stays possible from any validator’s data, forever.
- Speculation is bounded. If the node’s persistence pipeline stalls, consensus keeps voting — a slow disk must not silence a validator — and overlays accumulate up to a cap, past which this validator withholds votes until commits drain. Memory stays bounded; the committee rides through one member’s pause.
Watch it live. The scene below is Zoe’s node, mid-consensus, on a deliberately rough
network. The green row at the bottom is her disk — finalized blocks, forever. Every
dashed card above it is an overlay: a block she has executed, writes floating in
memory, linked to its parent — almost always because she vouched for it, sometimes
(cards marked rebuilt) because verifying a child forced her to re-execute
a parent whose proposal never won her vote. That’s the ancestry walk from the next
section, live. The feed is a real seeded run of chapter 4’s protocol observed from her
seat (in the toy, her vote stands in for “verified”). View numbers on the cards can
skip — views that go nowhere birth no overlay, and when one ends with nothing at all
to show, the step log says so. Missions:
- Step through the first frames: every overlay is born the moment Zoe executes a block, and nothing floats that she didn’t execute.
- Find the
rebuiltmoment (this seed has one): a proposal missed her entirely, and its overlay appears only later — the instant verifying its child needed the parent’s state. - Find a finalization step: the floating column drains into the disk row in one sweep — and watch what happens to a losing candidate: it dies with everything built on it. Branches are abandoned whole, never one card at a time.
- Keep going until the network turns ugly: the floating stack grows while the disk stands still — finality lag, chapter 4’s stat line, now with memory cost. Then press new fate: different universe, same invariants. Disk only ever grows along one chain; overlays only ever drain or die.
What finality leaves behind
When a block finalizes, the marshal delivers it — strictly in height order — and
waits for an acknowledgement before letting more pile up. On our side a small
committer pair receives each delivery: commit hands the block’s already-computed
outputs to the node’s persistence pipeline (write-ahead log first, then state,
repositories, tree), and the acknowledgement goes back only once the block would
survive a crash. Consensus is paced by durability; it never runs unboundedly ahead of
your disk. Delivery is at-least-once — after a restart the same block can arrive
again — so commit treats a re-delivered height as a no-op, and asserts it’s the same
block: anything else would be the one thing BFT exists to prevent.
One more thing happens at that moment, quietly. Every finalization certificate — the
160-byte artifact from chapter 5 — is converted into the node’s own wire format and
written to the finality store: certificates by block digest, a height index, and
the certified watermark surfaced in /status. The consensus library keeps its own
archives too, but those are treated as a rebuildable cache. The store is the node’s
sovereign proof trail, deliberately independent of any library’s encoding — a
dependency upgrade can never strand the chain’s evidence of its own finality.
Your turn: lie to the committee
Now the finale, and the load-bearing security decision of the whole integration. Everything downstream of consensus consumes executed blocks — the write-ahead log stores replay records, external nodes sync by re-executing them, the batcher settles them. Consensus keeps that model: the leader executes while building (a proposal commits to its execution outcome), and every follower re-executes the proposal before voting, refusing unless its own outcome matches the declared one, bit for bit.
Why so expensive? Because a proposer lying about execution results is the one attack vote-counting can never catch — honest validators would happily certify a well-formed lie. Catch it before voting and the lie simply never gets votes: the view times out, the next leader proposes, and the chain lost nothing but seconds. Catch it after finality and you’d have a finalized-but-invalid block: a halt, a manual recovery, and users already told “final”. The cost is that execution sits on the vote path twice per view — noise at our block sizes, and pipelining remains the known lever if a latency-critical deployment ever needs it.
Verification is two checks in sequence. First the validity rules bound the
inputs — a leader mustn’t smuggle content that executes fine and is still wrong for
the chain: wrong chain constants (the fee collector, economically), drifting
timestamps, oversized blocks, fees outside the parent-relative bounds, and above all
the authenticity of every L1-derived input, byte for byte against this node’s own
L1 watcher. Then full re-execution proves the declared outcome. Verdicts are
three-way — Valid, Invalid (no future makes this acceptable), Withhold (“I
can’t vouch yet”, usually L1 lag) — and both negatives have the same protocol
effect with different operator labels:
A leader whose inputs the committee won’t accept costs the chain a view timeout — never a halt. And the node signs only what it has itself recomputed.
The stepper below is that pipeline, station by station. Arm a lie — or leave the block honest — then step. Missions:
- Run the honest path end to end and notice where the signature lives: last. Nothing gets signed on trust.
- Arm each lie in turn, and predict the catching station before you step. Cheap checks run before the VM spins up — most lies die at the gate.
- Read the phantom-deposit verdict twice: it’s a
Withhold, not anInvalid. Same withheld vote, different dashboard label — the line between “attack” and “my node lags L1”, drawn for the operator you’ll be in chapter 8. - Total the damage across all four lies. It’s always the same number: one view. Zero evidence, too — content lies die silently, and “no fault evidence” never means “no attack”.
The four things to keep
- Consensus decides which block; the node’s own machinery decides what —
buildborrows the sequencer wholesale, just pointed at a consensus-chosen (possibly unfinalized) parent. - Speculative state lives in digest-keyed overlays that die two ways: drained by finality or dropped on abandonment. Disk is always a prefix of the finalized chain — rollback stays possible forever.
- Verify-before-vote: bound the inputs (rules), re-execute, compare bit for bit — then sign. A lying proposer costs one view and produces no evidence; silence is not proof of honesty.
- Commits are ack-paced by durability (write-ahead log first), and every certificate lands in the node’s own finality store — proof that outlives any library.
Where this lives in our stack
This chapter is the intuition layer for exactly one reference page — read it next:
- docs/src/consensus/integration.md — the same story with every component name: the seam, execute-then-order, speculative state, the validity rule families, the life of a block, crashes and late joiners. (The chronological telling, vote by vote, is docs/src/consensus/lifecycle.md.)
- The code, in the order this chapter met it: lib/consensus/execution/src/builder.rs (the mempool-under-speculation notes are its module doc), pending_state.rs (the overlay tree, ~a screenful), env.rs (verify = rules, then re-execution; commit = pipeline hand-off), rules.rs (the authoritative, tested list of validity families), lib/consensus/core/src/committer.rs (ack-gated delivery), and finality_store.rs (whose module doc explains the watermark’s exact semantics).
- The behaviors you just poked are pinned by scenarios: lib/consensus/sim/tests/real_stf.rs runs real committees over the real VM and asserts state equality; byzantine_app.rs pins that a lying proposer wastes its turn and produces no fault evidence — executable facts, not slideware.
Next: you can read the machine; now you get paged for it. Chapter 8 is operations: quorum arithmetic as a triage tool, restarts that cannot equivocate, why rolling back a finalized block is a category error rather than a risky procedure — and how the system changes shape (protocol versions, committees, wire formats) without ever mixing histories.