Skip to content

node: retry a transient eth_getLogs window failure inside the poller tick instead of failing every watcher #2161

Closed

Description

@thiras

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:

  1. A window fails → the tick fails → backoff sleep (1 s … 60 s) on top of the next 30 s tick.
  2. The backlog grows, so the next tick needs more windows.
  3. 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 caps eth_getLogs at about 100 blocks: 101 blocks passes, 150 blocks fails with a misleading code 35 "ranges over 10000 blocks are not supported on free plan". So get_logs_max_block_span = 100 fleet-wide, and decdn_chain_get_logs_span holds at 100 with zero range rejections.
  • Chain rate: Arbitrum Sepolia makes about 4 blocks/s, so a 30 s event_poll_interval_ms covers about 120 blocks. Every steady-state tick needs at least 2 eth_getLogs calls.
  • Error mix: in one hour, the fleet logged 445 multiplexed poller tick error lines. 376 were code 19 "Temporary internal error. Please retry" and 69 were code 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 reports Upstream height 312647894 is less than 312648109. Code 30 hit both windows.
  • Result: decdn_*_watcher_down_seconds peaks of 3.5–12 min on every node. *_restarts_total runs 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_logs error, 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 to fail_whole_tick as now.
  • A retry that succeeds is a plain success: no on_backoff, no restart count, and no change to down_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

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.

Activity

  1. added
    kind:bug
    rust
    area:node
    on Sep 25, 2026
  2. self-assigned this
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:nodekind:bugrust

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions