Repository navigation
Description
Component
node
Version
v0.3.1
Network
Arbitrum Sepolia testnet (our fleet, 8 nodes)
Problem
Every boot enumeration pins its reads to head - SNAPSHOT_LAG_MARGIN_BLOCKS (256 blocks, about 64 s on Arbitrum) through chain_events::shared_head::snapshot_block. The pin keeps the reads clear of load-balancer upstream lag (#2164). Three bootstraps use it: the CapacityBond registry (dht/capacity_bond_registry.rs), the slash watcher (slash_watcher.rs) and the blacklist watcher (blacklist_watcher.rs). The periodic re-enumerations use it too.
snapshot_block first calls eth_getCode(contract) at the lagged block. If the RPC endpoint does not keep state that far back, that call fails, and every later attempt fails the same way. BootRetry classes the error as transient. The boot spends the whole 600 s BOOT_CHAIN_RETRY_BUDGET, the process exits, and systemd restarts it into the same loop. Fail-closed holds, so nothing unsafe is served, but the node never comes up while the endpoint stays like this.
The SNAPSHOT_LAG_MARGIN_BLOCKS docs already name the case: "A full node that prunes state within 256 blocks (geth keeps 128) answers every pinned read with a transient error, so a boot against one spends its retry budget." No fallback handles it.
Observed on the fleet (2026-11-01)
At 12:08:35 UTC all 8 nodes restarted. The RPC preflight and the deployment preflight passed: both read at latest, including eth_getCode(PaymentPool). The CapacityBond registry snapshot then failed on every attempt:
read the CapacityBond registry snapshot block: server returned an error response:
error code 27: Unknown state. First available state is 1
Each node gave up after 15 attempts in about 543 s, exited, and did the same again on the next start. The third start, at 12:31:51, was ready in about 9 s. The endpoint served latest state but not state 256 blocks back. All 8 nodes were down for about 23 minutes. Their metrics were dark for the same window (#2819).
Options
- Pin at head when the lagged state is unavailable. This mirrors the existing no-code fallback in
snapshot_block, which already pins at head when the contract has no code at the lagged block. The hard part is detection: "state unavailable" has no standard JSON-RPC code. We see27/ "Unknown state" here, geth says "missing trie node", and Nitro and other providers word it differently. One provider-independent approach: if the laggedeth_getCodefails but the same call atlatestsucceeds, treat the lagged block as unservable and pin at head. A head pin is exposed to upstream lag again (node: boot enumeration snapshots pinned to exact head fail behind load-balanced RPCs with lagging upstreams #2164), butBootRetryalready retries that, and the head is the only block such an endpoint can serve. - Walk the margin down. Retry the lagged read at smaller margins (256 → 64 → 16 → 0) until one resolves. This keeps as much lag protection as the endpoint allows, at the cost of more reads and more code.
- Make it an operator requirement. Document that
blockchain.rpc_urlmust serve state at leastSNAPSHOT_LAG_MARGIN_BLOCKSback. Fail fast at boot with a clear message, as a deterministicBootFaultinstead of a 10-minute transient spin, when the lagged read fails andlatestsucceeds. The node still does not come up, but the operator sees the cause in seconds.
Options 1 and 3 share the same probe (lagged fails, latest succeeds). They differ only in whether the node then continues or exits.
Scope notes
- Whatever is chosen must keep fail-closed boot: no ALPN opens before a clean blacklist enumeration and enforcement pass.
- The periodic re-enumerations call the same
snapshot_block, so a running node pointed at such an endpoint would fail those too. Not observed yet; the fix should cover both paths. - Update the
SNAPSHOT_LAG_MARGIN_BLOCKSandsnapshot_blockdocs, plus any operator doc that lists RPC requirements.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity