Repository navigation
Description
Problem
The multiplexed chain-event poller fails the whole tick on the first non-range eth_getLogs error. On a flaky provider this creates a feedback loop, and every watcher reports minutes of downtime although the cursor keeps advancing.
run_tick (crates/node/src/chain_events/multiplexed_poller.rs) scans [min(floor), head] in windows of span blocks. When a window fails with anything other than a range rejection, the code calls fail_whole_tick at once. There is no retry inside the tick. Windows that already succeeded advance the routes, but down_since clears only on a tick that reaches head with zero failed windows (fire_route_hooks → *_cycle_established). The loop:
- A window fails → the tick fails → backoff sleep (1 s … 60 s) on top of the next 30 s tick.
- The backlog grows, so the next tick needs more windows.
- Each extra window is another chance to fail → P(tick succeeds) = (1 − p)^windows drops → the backlog grows again.
Evidence (testnet, 2026-09-25)
- Provider: all 7 nodes use the dRPC free plan (
lb.drpc.live). The free plan capseth_getLogsat about 100 blocks: 101 blocks passes, 150 blocks fails with a misleadingcode 35 "ranges over 10000 blocks are not supported on free plan". Soget_logs_max_block_span = 100fleet-wide, anddecdn_chain_get_logs_spanholds at 100 with zero range rejections. - Chain rate: Arbitrum Sepolia makes about 4 blocks/s, so a 30 s
event_poll_interval_mscovers about 120 blocks. Every steady-state tick needs at least 2eth_getLogscalls. - Error mix: in one hour, the fleet logged 445
multiplexed poller tick errorlines. 376 werecode 19 "Temporary internal error. Please retry"and 69 werecode 30 "Request timeout on the free plan". - Direct probe from lon1 with the node's key, 30 rounds: a window
[head-99, head]failed 6/30 times, and[head-499, head-400]failed 3/30 times. Code 19 appeared only at the tip, which fits dRPC upstreams lagging head: the blacklist re-enumeration reportsUpstream height 312647894 is less than 312648109. Code 30 hit both windows. - Result:
decdn_*_watcher_down_secondspeaks of 3.5–12 min on every node.*_restarts_totalruns at about 0.04–0.08/s. All five watchers move in lockstep because they share one poller. On lon1, most ticks in a 35-minute sample failed.
No events are lost, because the cursor advances per window and applies are idempotent. The cost is observation latency plus false liveness alerts.
Proposed fix
Retry a failed window inside the tick before the code fails the whole tick:
- On a non-range
get_logserror, retry the same window up to N times (e.g. 2) after a short delay (e.g. 1–2 s, shutdown-aware), then fall back tofail_whole_tickas now. - A retry that succeeds is a plain success: no
on_backoff, no restart count, and no change todown_since. - Leave range rejections on the existing shrink path. Leave the head read and floor resolution as they are. They are already cheap and cached.
- Log each retry at
debug, and count it in a new sibling counter (e.g.decdn_chain_get_logs_retries_total) so provider flakiness stays visible after it stops showing up as downtime. Add the counter to the monitoring gate and to appendix-observability.
At the measured per-call failure rate of about 15–20%, two retries take the per-window failure rate below 1% and break the feedback loop.
Out of scope
- Multi-provider failover. That is Multi-RPC priority failover: blockchain.rpc_urls with sticky fallback #2156, which is complementary.
- A confirmation lag on the scan bound.
chain_eventsdocuments why the scan runs to head. - Changing what
down_secondsmeasures.
Ops stopgap until this lands
Set event_poll_interval_ms to about 20000, so one 100-block window covers a tick. The total number of eth_getLogs calls stays about the same. Alternatively, move off the dRPC free plan.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsDone
Activity