Repository navigation
Description
Component
node
Version
v0.3.1
Network
Arbitrum Sepolia testnet (our fleet, 8 nodes)
Problem
decdn-node binds the /metrics listener in spawn_background_tasks (crates/node/src/runtime/mod.rs). That function runs after build_infra and build_chain_and_handlers, so the listener only starts after every startup RPC read succeeds:
- the RPC reachability preflight (
check_rpc_reachability, up to 5 attempts), - the deployment preflight (
check_deployment_preflight, 1 minBootRetrybudget), - the fail-closed boot chain reads (CapacityBond registry, slash enumeration,
usdc()self-check, blacklist enumeration, sharing the 10 minBOOT_CHAIN_RETRY_BUDGET).
While any of these retries, nothing listens on the metrics port. A node stuck in boot looks the same as a node that is down. decdn_chain_boot_read_retries_total, which counts exactly these retries, can be scraped only after boot completes. chain_events/boot_retry.rs says so in its module docs.
Observed on the fleet (2026-11-01)
- 12:08:35 UTC: all 8 nodes restarted. Each one then failed
eth_getCodeat the lagged snapshot block (error code 27: Unknown state. First available state is 1), used up the 600 s budget twice (gave up after 15 attempts in ~543s), and exited. The third start, at 12:31:51, was ready in ~9 s. - 12:31:52 to 12:36:06 UTC: lon1's RPC returned
401 Unauthorized(a fatal preflight result), and the node crash-looped about 46 times. - Prometheus has no
decdn_*samples from any node between about 12:10 and 12:32 (lon1: until 12:36). The only boot signal during the outage was the per-attemptWARNin Loki.
Proposed fix
Bind and serve the metrics listener at the top of run, before build_infra. node_metrics already exists there (the caller builds it), and metrics::serve encodes the shared registry on each scrape, so collectors registered later (iroh endpoint, probe holds, cache) appear once they attach. Move metrics_stop_tx and the serve task out of Background into the early phase, and keep the shutdown order unchanged.
Follow-up worth considering in the same change: a boot-phase gauge (for example decdn_node_boot_ready 0/1, or the current boot step), so "stuck in boot" can be alerted on directly instead of inferred from the retry counter. A new metric needs its ADR appendix-observability row and a devops panel.
Then update the boot_retry.rs module docs. The "scrapeable only once boot completes" note no longer holds.
Out of scope
- Whether the snapshot should fall back to a head pin when the endpoint has pruned state at
head - SNAPSHOT_LAG_MARGIN_BLOCKS(the cause of the 12:08 boot loop). Tracked separately if we pursue it. - The instant exit on a fatal (
4xx) preflight result. That is intended fail-fast behavior.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity
fix(node): serve /metrics during boot and export decdn_node_boot_ready (