Skip to content

Node event watchers hard-depend on eth_newFilter; switch to eth_getLogs polling #1106

Closed

Description

@thiras

Summary

The node's on-chain event watchers hard-depend on the stateful JSON-RPC filter methods eth_newFilter + eth_getFilterChanges. These are unsupported by the default public Arbitrum Sepolia RPC and by the majority of free/keyless RPC endpoints, so a node pointed at such an endpoint has every event watcher stuck in a permanent retry loop while the process still reports "node runtime ready". Switching the watch path to eth_getLogs polling would remove the dependency and work on virtually any endpoint (including the current public RPC) with no operator-side provider change.

Where it comes from

  • crates/node/src/runtime/mod.rs builds every chain provider with ProviderBuilder::new().connect_http(rpc_url) (HTTP-only; wss:// is not reachable, so the WS eth_subscribe path is unavailable) and sets a poll interval via with_poll_interval / client().set_poll_interval.
  • crates/node/src/chain_events.rs:47 drives the live watch with alloy's .watch_logs(&filter). Over an HTTP transport, alloy implements watch_logs with eth_newFilter + polled eth_getFilterChanges — exactly the methods that fail.

Affected watchers (all six): chain_staker_set (CapacityBond membership), slash_watcher, blacklist_watcher, payment_settlement (PaymentChannel), chain_origin_directory (PublisherRegistry), reputation_indexer. The sticky buyer-side PaymentChannel bootstrap failure is downstream of the same cause.

Evidence (Arbitrum Sepolia, chain 421614, 2026-07-12)

Runtime log on the default public RPC (https://sepolia-rollup.arbitrum.io/rpc):

WARN blacklist watcher subscription failed; retrying after backoff
     err: server returned an error response: error code -32601:
          the method eth_newFilter does not exist/is not available

Direct curl probes of keyless/free Arbitrum Sepolia endpoints:

Endpoint eth_newFilter eth_getLogs
sepolia-rollup.arbitrum.io/rpc (default) ❌ -32601 ✅
PublicNode ✅ ✅ recent only (archive gated)
Tenderly gateway (keyless) ⚠️ flaky ("filter not found" — load-balanced backends) ✅
dRPC free ❌ "not available on freetier" —
Ankr free ❌ (Enterprise-only) —

Stateful filters are structurally fragile behind load-balanced RPC gateways (the filter lives on one backend; the next poll may hit another), which is why so many providers either omit them or gate them. eth_getLogs verified working on the current public RPC and already returns this node's own Bonded/NodeRegistered events.

Impact

A freshly onboarded, correctly-bonded, on-chain-registered node silently fails to reach real operational readiness (ADR 019 Phase 3–5): it never observes membership/blacklist/slash/settlement events, its registry cache is frozen at startup state, and node→node paid pulls stay disabled — with no hard error, just a WARN loop. Operators must discover and swap to a specific keyed provider (QuickNode/Infura free tier) to work around it.

Proposed fix

Replace the watch_logs (stateful-filter) watch path with an eth_getLogs polling loop:

  • Poll eth_getLogs(fromBlock=lastScanned+1, toBlock=latest, address, topics) on the existing poll interval, advancing a persisted cursor; this reuses the same Filter construction already present (e.g. slash_watcher.rs already does get_logs for its backfill).
  • Chunk large ranges and clamp the initial from_block (or chunk the historical backfill) so a non-archive endpoint isn't asked for a 275M-block span in one call.
  • Keep reorg handling in mind (small confirmations lag / re-scan window) since polling replaces filter semantics.

Acceptance criteria

  • All six watchers operate against an endpoint that supports only eth_getLogs (e.g. the default sepolia-rollup.arbitrum.io/rpc) with no eth_newFilter calls.
  • No eth_newFilter/eth_getFilterChanges remain on the node's hot path (grep-clean, or explicitly opt-in behind config).
  • Historical backfill from a deploy block succeeds on a pruned/non-archive endpoint (chunked, or documented archive requirement).
  • node runtime ready is not emitted (or is qualified) until the watchers have actually established their event streams.

Context

Found while onboarding the internal instance node bcl (see decdn/internal-devops). The immediate operator workaround is a keyed free-tier endpoint (QuickNode or Infura) that supports stateful filters; this issue tracks the durable fix so the node works on commodity RPC endpoints.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions