Chapter 10 · ~45 min

Capstone: run the real thing

A real committee on your machine. Kill things. Watch it not care.

What you’ll have done by the end

No widgets this time

Every simulator in this guide was the real logic wearing a small costume. This chapter takes the costume off: the committee you’re about to run is the production node — the same binaries, engines, journals, overlay trees, validity rules, and finality store you’ve spent nine chapters on — settling to a local L1, on your machine. The lab is a mission list in the chapter-4 spirit, with one difference: expected observations are written down, and you should hold the system to them.

You’ll need Docker (give the VM at least 8 GiB of memory) and a Rust toolchain. Budget most of an hour; the image build dominates. The canonical bring-up page — kept current with the tooling — is docs/src/setup/consensus_devnet.md; the commands below are its short version, from the zksync-os-server repository root:

# 1. Build the node image (bound the parallelism on a memory-constrained VM):
docker build -t zksync-os-server:latest --build-arg CARGO_BUILD_JOBS=4 .

# 2. Generate the cluster: keys, per-validator configs, compose file, manifest:
cargo run -p zksync_os_chaos -- setup --validators 4 --out ./devnet --repo .

# 3. Start it (anvil + 4 validators):
docker compose -f ./devnet/docker-compose.yaml up -d

Host ports per validator (RPC, status, prometheus) are in ./devnet/manifest.json. Exactly one validator runs the batcher — the settler; the setup materials pick it (the first validator, unless you move it). Keep the manifest open; every mission below says “status port” meaning that validator’s mapped one.

Mission 1 — meet the committee

Do: probe two different validators’ status endpoints.

curl -s localhost:<status-port>/status | jq .consensus

Expect, on both: committee_size: 4; a validator identity; the finalized observation fresh (its observed_unix within seconds of now); applied_height climbing if you re-run the probe; finality_certified_height tracking it within a small tail; and — hold them side by side — an identical chain_fingerprint on every node. That one string asserting “we agree on every committee-uniform fact” is chapter 8’s drift alarm at rest. The consensus runtime’s own metrics are the second scrape target, at /status/consensus-metrics.

Do: send a transaction at any validator’s RPC and watch it land regardless of who leads next (they gossip); then tail a log and find the heartbeat of the whole guide:

docker compose -f ./devnet/docker-compose.yaml logs -f validator-1 | grep "committed finalized block"

That line is chapter 7’s commit, once per height, on every validator. This is: chapter 4’s happy path, chapter 6’s two scrape targets, chapter 7’s ack-paced commits — live.

Mission 2 — the cost of a crash

Do: hard-kill a non-settler validator (no shutdown, no mercy — this is the tested path):

docker kill chaos-validator-1

Expect: the chain does not blink — applied_height keeps climbing on the survivors (quorum 3 of 4 holds). Watch the skipped views tick on the victim’s leader turns, about once per rotation: weather, not damage. Fault-evidence counters stay at zero — a crash is not a lie.

Do: bring it back and watch the recovery you read about:

docker start chaos-validator-1
docker compose -f ./devnet/docker-compose.yaml logs validator-1 | grep "Replaying WAL blocks"

Expect: a line like Replaying WAL blocks from X until Y. — the pipeline rebuilding every downstream consumer from its watermark (chapter 8’s “restarts are boring” list, item two). Within a minute or so the node’s applied_height catches the committee, its finality_certified_height briefly trails and then jumps — one live certificate covers the gap, because a certificate vouches for its whole recorded ancestry. This is: the journal story, the WAL replay, and the coverage watermark — chapter 4’s crash mission, held to receipts.

Mission 3 — kill the settler

Do: the same, but to the batcher validator (validator 0 by default):

docker kill chaos-validator-0

Expect the important thing: L2 sequencing does not care — blocks keep finalizing on the survivors, RPCs keep answering. What pauses is settlement: on the L1 side, the committed/executed batch counters freeze. Consensus made sequencing highly available; the batcher is one node’s job, and its failure is a settlement-lag incident, not a chain incident.

Do: restart it.

Expect: on startup it rediscovers the last committed/proved/executed batches from L1, recreates what it still owes, and the batch counters move again. (The grown-up version — promoting a different validator to settler when the original is truly gone — is a one-command drill in this same tooling, chaos promote-settler, choreographed in the operating doc’s failover runbook.) This is: enabling.md’s “exactly one batcher”, operating.md’s settlement failover, and chapter 8’s division between chain health and settlement health.

Mission 4 — break quorum, prove the asymmetry

Do: freeze two validators at once (SIGSTOP, the rig’s pause fault — they’re alive, just silent):

docker pause chaos-validator-1 chaos-validator-2

Expect: the chain stops. Not degrades — stops: with 2 of 4 silent, no quorum of 3 can assemble for anything, not even for skipping views. Block staleness grows past the heartbeat (this is exactly triage card 1), finalized views freeze on the survivors, evidence counters stay zero. Let it sit for a minute and feel how un-catastrophic it is.

Do: heal, then run the check that makes stall-not-fork yours — same height, every validator, compare hashes:

docker unpause chaos-validator-1 chaos-validator-2
# pick a height H from any validator, then on EACH validator's RPC port:
curl -s -X POST -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["<H-hex>",false]}' \
  localhost:<rpc-port> | jq -r .result.hash

Expect: the chain resumes on its own within a few leader timeouts — no operator choreography — and every validator returns the same hash for the same height. Two frozen validators, a full stall, a heal… and one history. This is: chapter 2’s sacrifice-liveness-never-safety, chapter 4’s split mission, with receipts.

Mission 5 — let the machine rage

Do: hand the fault schedule to the rig — and, for the full experience, put real load through the committee at the same time (two terminals):

cargo run -p zksync_os_chaos -- drive --workdir ./devnet --seed 1 --fault-interval 30s
cargo run -p zksync_os_chaos -- load  --workdir ./devnet --tps 10 --pattern sustained --spread even --duration 10m

Expect: kills, freezes, partitions, packet loss — on a seeded schedule, so the experiment replays — while the built-in watcher continuously asserts everything this guide taught you to expect: identical hashes across validators, finality and applied-height monotonicity, no progress without quorum, no unexpected deaths, and zero byzantine fault evidence. A clean run ends with exit 0 and no findings — and notice that last check: the evidence counters staying at zero through all that abuse is not a gap in the test, it’s the absence you should expect. Crashes, partitions, and packet loss are not lies, and the dashboard knows the difference. (You stepped through exactly these semantics in the last chapter — the expectation journal, the freeze — and the rig’s manual is tools/chaos/README.md, worth reading in full.)

When you’re done:

docker compose -f ./devnet/docker-compose.yaml down -v   # -v deletes the chain

The four things to keep

Where this lives in our stack

You just used most of it. The devnet page (docs/src/setup/consensus_devnet.md) stays the canonical bring-up; the rig’s manual is tools/chaos/README.md; the alarm table you triaged against is docs/src/consensus/operating.md; and the scenario corpus in lib/consensus/sim/tests/ is this whole lab, deterministic, running on every pull request.

Next: the fundamentals are behind you — and the reference docs at docs/src/consensus/, the source of truth this guide has been the intuition layer for, will now read like annotations to things you’ve done. Welcome to the committee. Three chapters remain, for when you run one in anger: how a chain can govern its own membership, and the disaster pair — the worst that can happen, and the other ways things go wrong. Nobody wants to need them. Read them anyway.