← Back to all chapters

Chapter 15Down the Rabbit Hole: How Ethereum Agrees on History

8 min read
rabbit-holeconsensusdistributed-systemsblockchain

When an exchange credits your Ethereum deposit, it usually waits for the block to be "finalized", around 13 minutes. Your wallet shows the transaction about 12 seconds after it lands. Rollups like Optimism, Arbitrum and Base derive their "final" from the same signal, and execution clients expose it as the finalized and safe block tags.

Two answers to "is this done?", from two protocols running at once. That's Gasper, the Beacon Chain's consensus since the Merge in September 2022. LMD-GHOST picks which chain to follow right now. Casper FFG periodically declares a checkpoint so firmly agreed that reversing it would burn a third of all staked ETH.

I wanted to know why you'd need two. I came out appreciating how much of the head-picking half is patches.

Why not just use BFT?#

Classical BFT (Tendermint) gives deterministic finality, but halts if a third or more of validators go offline and needs all-to-all voting per block. That doesn't scale to hundreds of thousands of validators with open membership. Nakamoto longest-chain keeps going whoever is offline, but finality is only probabilistic.

Ethereum wanted both: a chain that grows whenever anyone is online, plus slashable finality on top that may stall without killing the chain. Neu, Tas and Tse named this an "ebb-and-flow" protocol: the available chain and the finalized prefix degrade independently.

One vote, two jobs#

Slots are 12 seconds, grouped into 32-slot epochs (6.4 minutes). Each slot has one proposer. Every active validator attests once per epoch, in committees with a target size of 128. A single attestation does both jobs:

{ slot, index,
  beacon_block_root = B_e,                         <- LMD-GHOST head vote
  source = justified checkpoint (epoch e-1, root S),
  target = (epoch e, epoch-boundary block root) }  <- Casper FFG link S -> T
t=0s            t=4s                    t=8s               t=12s
├───────────────┼───────────────────────┼──────────────────┤
proposer        attesters sign          aggregators combine  next slot
publishes       (wait up to 4 s         BLS signatures for
block           for the block)          the next proposer
Inside one 12-second slot

The head: follow the latest votes#

LMD-GHOST: Latest Message Driven, Greediest Heaviest Observed SubTree. Start at the last justified checkpoint. At each fork step into the child whose subtree has the most weight: the stake of validators whose latest vote points at that block or a descendant.

J954234justifiedheadC branch 4 < B branch 5number = stake whose latest vote is that block or a descendant
LMD-GHOST walks from the justified checkpoint, always into the heavier child. Weights are illustrative.
The spec's get_head, and how clients really do it
def get_head(store):
    blocks = get_filtered_block_tree(store)
    head = store.justified_checkpoint.root
    while True:
        children = [r for r in blocks if blocks[r].parent_root == head]
        if not children:
            return head
        head = max(children, key=lambda r: (get_weight(store, r), r))

Only each validator's latest message counts, so state scales with validators rather than votes ever cast. The filter at the top drops branches whose justified and finalized checkpoints disagree with the store's, so following the head never pushes an honest validator into a slashable vote.

Real clients (Lighthouse, Prysm, Teku, Nimbus, Lodestar) use proto-array: nodes in a flat array in parent-before-child order, weight deltas applied in one backward pass that bubbles changes up. Each node caches its best descendant, so head lookup is O(1) after an O(N) pass.

Finality: the one equation#

A checkpoint is justified when validators with at least two-thirds of active stake vote for the same link to it (target_balance * 3 >= total_active_balance * 2). It's finalized when its direct child checkpoint is also justified via a link from it.

epoch Njustifiedepoch N+1finalizedepoch N+2justifiedepoch N+3pending2/3 of stake2/3 of stake2/3 of stakeN+1 is finalized because its direct child N+2 was justified by a link from it
Justification links (arcs) between checkpoints. Each arc needs votes from at least two-thirds of active stake.
How a checkpoint becomes final. Click a box.

Now suppose two conflicting checkpoints both get finalized. Each needed a two-thirds set of signers. With total stake n:

|V1 ∩ V2|  ≥  2n/3 + 2n/3 − n  =  n/3
all stake = nV1: 2n/3V2: 2n/3overlap at least n/3 signed both
Two conflicting finalized checkpoints each need a two-thirds set of signers. The sets must overlap by at least a third. Positions schematic.

At least a third of all stake signed both. Casper FFG has two slashing rules built so any such overlap breaks one:

# double vote: two different votes for the same target epoch
data_1 != data_2 and data_1.target.epoch == data_2.target.epoch
 
# surround vote: one link strictly wraps another
data_1.source.epoch < data_2.source.epoch and data_2.target.epoch < data_1.target.epoch

That's accountable safety: not "it can't happen" but "if it does, we know exactly who did it and they pay."

Why two-thirds, and why two rounds
  • Two-thirds, not half. With half, two quorums can fail to overlap. Two-thirds is the smallest threshold where any two quorums overlap by a third, while fewer than a third faulty validators still leave enough honest ones for a quorum.
  • Two rounds, not one. Justification alone says "two-thirds voted for this link", but a conflicting justification could exist from different sources without anyone double-voting. Requiring the next checkpoint to be justified from this one means any conflict must surround or double-vote against that link.

When a third goes dark#

If more than a third of validators go offline, FFG can't justify anything. The chain keeps growing via LMD-GHOST, but nothing becomes final. The fix is the inactivity leak.

After a grace period of 4 epochs without finality, an offline validator's inactivity score grows by 4 per epoch, and its penalty is proportional to the score. Penalty rate is linear in time, so the balance decays like a Gaussian:

dB/dt = −B · 4t / (4 · 2^24)   ⇒   B(t) = B0 · exp(−t² / (2 · 2^24))

Losses are quadratic in outage length. A one-hour outage costs almost nothing; halving takes about 4,800 epochs, roughly 21 days. The dive's toy simulation (uniform offline validators, post-Bellatrix quotient 2^24):

OfflineFinality returns afterCost per offline validator
34%1,005 epochs (4.5 days)0.94 ETH
40%3,111 epochs8 ETH
50% or 60%4,826 epochs (about 21.4 days): validators hit the 16 ETH ejection pointejected

The offline stake bleeds out until the online part is two-thirds again.

  • 34% offline1,005 epochs
  • 40% offline3,111 epochs
  • 50% or 60% offline4,826 epochs
How long finality takes to return, by share of validators offline (toy simulation).

Where the head rule breaks#

FFG has a clean safety proof. LMD-GHOST has no safety proof against adversaries below a third of stake, and much of its history is attacks and patches. The cause is the word "latest": if old votes can be overwritten, an attacker controls which votes are latest at the moment that matters.

The balancing attack (Neu, Tas and Tse, 2021) needs a few percent of stake per slot. Withhold votes, release them one at a time to keep two forks tied, and no block becomes decisive.

The fix is proposer boost. A current-slot block that arrives before the 4-second deadline gets temporary extra weight equal to 40% of one slot's committee, reset next slot. A timely honest block wins whenever the boost exceeds the withheld-vote lead. The dive's toy simulation, 100-vote committee:

Adversary releasesOutcome
10 or 30 withheld votesHonest branch wins
39Lead equals the boost; tie goes to the attacker on the block-root tiebreak
41Honest block loses outright
any, with no boostHonest never wins

The boost is a dial with a cost on both sides. Raise it and a single proposer can force its late block over a majority of attestations. Lower it and balancing comes back.

Other attacks followed:

  • Ex-ante reorgs: an adversary with consecutive proposals pre-arranges votes across slots, which a slot-local boost can't stop.
  • Avalanche attack: fixed by discarding votes from validators caught equivocating.
  • Bouncing attack on justification.
  • Commitment attacks (Sarenche et al., 2024): no withheld votes needed. A proposer publicly commits to including only attestations that vote its way, so attesters in the previous slot face a reward threat.

Sarenche et al., Fig. 1(b): three slots. The honest block B_t in slot t points to B_(t-1). The adversary's block B_A in slot t+1 also points directly to B_(t-1), skipping B_t, and includes only the compliant (green) votes for B_(t-1) in its attestation list. The non-compliant red votes for B_t are below the boost weight W_p.

Figure 1(b) from Sarenche et al., "Commitment Attacks on Ethereum's Reward Mechanism", 2024, arXiv:2407.19479, licensed CC BY 4.0. Cropped and recompressed.

In the successful case, enough attesters comply that the holdouts' votes fall below the boost weight, and the adversary's block reorgs the honest one out. The mitigation is still unresolved.

The question underneath#

Is there a dynamically available head rule that provably can't be reorged by an adversary with less than a third of stake? Any rule built on latest messages lets withheld votes act later, and every patch closes one door. Candidates replace the rule: RLMD-GHOST with vote expiry, view-merge, and Available Attestation (Zhang, Li, Lu and Duan, USENIX Security 2025), which swaps HLMD-GHOST for a stable-chain rule secure against the known reorg attacks under synchrony.

A bigger rewrite is in view: the 3-slot finality protocol (D'Amato, Saltini, Tran and Zanolini, 2024) would finalize within 3 slots instead of 64 to 95, shrinking the window for reorg games. The cost is message load: a million signers voting every slot needs much better signature aggregation, which is what Orbit SSF and Wonderboom are about.

And beneath it all, a result from the ebb-and-flow paper: you can't have both dynamic participation and safety under network partitions. Gasper's two layers aren't an accident. They're the best known compromise with an impossibility.

Sources#

© 2026 Bharat Kaurav. Built with Next.js & Tailwind.

>_ bk@netherwatcheresc to close

Welcome, reader. Type help to see what this shell can do.