Chapter 09 · ~16 min

How we know it works

Six rungs from a smoke test to the chaos rig — and why consensus ships test-first.

What you’ll walk away with

The ladder of who can fix it

Think about what a serious bug costs, in three worlds.

World one: the single sequencer. You ship a bug and the chain halts. That’s sad — users notice, a postmortem is owed — but the fix is a hotfix: one binary, one machine, one operator, minutes. You own the box.

World two: you run a fleet of external nodes. The bug crash-loops all of them. Sadder — more machines, more angry dashboards — but they’re still your machines. Your deploy pipeline, your ssh keys, your rollback. An expensive evening.

World three: a committee. N validators, run by independent operators — different companies, different time zones, different change-management processes. A bug halts the chain, and now the “hotfix” is a coordinated, multi-organization deployment, negotiated over a bridge call, while the chain is down and every user watches. There is no ssh that works everywhere. Nobody can fix it alone — that was the point of the committee, remember: no single party can change what the chain does. The property you bought for safety prices your incident response.

When the deployment is decentralized, the fix path is the slow path — so the only acceptable time to find a consensus bug is before it ships.

That’s the sentence this chapter stands on, and it explains a discipline you’ll see enforced rather than aspired to: consensus code without a test demonstrating it is not reviewable here. The harness isn’t quality assurance after the fact; it’s part of the feature. What follows is how that discipline is organized — not a tour of every test, but the shape: what each layer is for, what it deliberately ignores, and why so many layers earn their keep for this one subsystem.

One rule, six rungs

Every layer below answers one question: what class of bug is this the cheapest place to catch? Each rung sees more of reality than the one below it — and pays for that sight in speed, precision, and reproducibility. Which is why one sorting rule governs the whole ladder:

If a case can be expressed at a lower layer, it must be. An integration test that could have been a simulation scenario is a review finding — not because integration tests are bad, but because the lower rung runs it faster, replays it exactly, and never flakes.

Click through the ladder. For each rung, read the “deliberately cannot see” line — then look one rung up: every blind spot is the next layer’s job.

The floor, and the cheap seats

The bottom rung answers an embarrassingly basic question that deserves a permanent answer: does the library even turn? The smoke test wires commonware’s raw simplex engine — no marshal, no blocks, no node, payloads that are just hashes — and proves four things: the pinned version runs in this workspace at all; the engine can be wired end-to-end (scheme, elector, channels, journals, the integration traits); five validators finalize with no forks and no evidence; and the deterministic runtime is bit-exact per seed. When a monthly library upgrade lands, this is the first thing that either turns or doesn’t.

One rung up, plain unit tests hold the pure logic: validity-rule tables, the startup-guard matrices, overlay bookkeeping — and the golden fixtures, which deserve a special mention because they invert your intuition about severity. “Certificate bytes changed after an upgrade” sounds like a five-alarm incident; the goldens make it a forty-line test failing on the first pull request, before anything runs. The cheapest rung catches some of the scariest bugs. Severity and layer are different axes.

The main surface: committees in a bottle

Here the pyramid inverts from the usual shape: the primary testing surface for consensus is not unit tests and not integration tests — it’s deterministic simulation: entire committees of the production stack (real engine, real marshal, real journals, real backfill) over the seeded runtime and a scripted network. You already hold the key idea from chapter 6 — same code, two universes, twin fingerprints — so just add scale: a corpus of scenarios organized by capability (steady state, crashes and restarts, partitions, byzantine peers of both flavors, late joiners, migrations, epoch changes), each run across seeds, each seed run twice with audit fingerprints compared, so nondeterminism fails loudly instead of becoming a flaky test.

Three properties make this rung the workhorse:

Real boxes: the wiring layer

Simulation deliberately cannot see sockets, disks, processes, or configuration — so one rung up, the integration suite boots real nodes: RocksDB, real consensus networking, a local L1. Its territory is wiring truths: does it boot, does configuration parse and migrate, does a restart over real storage recover, do the RPC surfaces serve, does settlement settle — and the drills: chain migration, committee changes, settlement failover. Its discipline is telling: assertions use generous poll-until bounds, never timing-tuned sleeps (timing-sensitive integration tests are flaky by construction), and it refuses to test byzantine behavior or partitions — those are expressible below, so the rule sends them below.

The chaos rig: a fuzzer for operational reality

Everything so far shares one quiet limitation: it tests the failure space someone modeled. Deterministic simulation is exhaustive about the interleavings you thought to script; integration checks the wiring you knew to check. The last rung exists for the rest of it. The chaos rig is best understood as a fuzzer whose input space is operational reality: a containerized committee built from the production image, a seeded schedule of faults — kill, graceful stop, freeze, partition, packet loss and delay — running for hours or days of real wall-clock time, under real transaction load funded through real L1 deposits.

Random abuse alone would be noise. Two design choices make it an instrument:

And two ground rules define its place in the ladder. Telescope, not gate: the rig never runs in CI, because its findings are probabilistic and its runs are hours long — it’s pointed at the system by a human, like an instrument. And a finding freezes the scene: on the first violated expectation the rig stops healing, captures the journal, the findings, and every container’s logs, and exits nonzero — because a healed-away anomaly is an anomaly you can’t study. What it reliably catches is exactly what no other rung can see: teardown races that need thousands of genuine process deaths to fire, rate-and-drift interactions that need real elapsed time to accumulate, recovery paths that only exist once a chain has actually aged, leaks. Each finding is then reproduced, understood, and pinned as a deterministic regression at the lowest layer that can express it. The rig discovers; the lower rungs pin; tomorrow’s corpus is smarter. (Even the library-upgrade procedure ends with a soak — the one rung that catches what a changed runtime does to timing and teardown, which is precisely the shape of change a runtime release carries.)

Step through one soak below — the committee strip, the driver’s journal, and the watcher’s verdicts. Missions:

  1. Step the clean run end to end. At the sanctioned outage, read the watcher’s verdict carefully: no progress, and no finding — because the journal said so.
  2. Now press the villain button and rerun. Same schedule — but this time a validator dies with no journal entry covering it. Watch what changes, and watch what the rig does next: nothing heals anymore. The scene is evidence.
  3. Read the last narration twice: the finding’s afterlife is a deterministic regression at a lower rung. The rig’s output is not green dashboards — it’s better lower rungs.

Your turn: file it at the right layer

You now know the ladder well enough to use it the way reviewers here use it: as a sorting question. Six bug shapes below — for each, commit to the lowest rung that can catch it before you reveal the answer. Missions:

  1. Sort all six. Two will land at unit — notice how scary one of them sounds.
  2. For both chaos bugs, read the “pinned at” line: the rig never keeps its own catches.
  3. Whichever you misfile, ask why you over- or under-shot: too high usually means “I forgot the lower rung could model that”; too low usually means “I forgot what that rung deliberately cannot see”.

The four things to keep

Where this lives in our stack

Next: the last chapter has no widgets — it has a terminal. You’ll bring up a real committee on your machine, kill validators, break quorum on purpose — and point the very rig you just met at a chain you built, expecting (and getting) zero findings. Everything this guide taught you, held to receipts.