Repository navigation
docs(node,common,cli): re-anchor event_poll_interval_ms docs to eth_getLogs (#1110) - #1224
Conversation
…etLogs (#1110) #1106 moved every watcher off alloy `watch_logs` (`eth_newFilter` + `eth_getFilterChanges`) onto one `eth_getLogs` polling loop, but nine doc sites still describe the deleted API. They all paraphrase one root rationale (`MIN_EVENT_POLL_INTERVAL_MS`), whose two stated justifications are both dead: there are no long-lived watcher filters, and alloy's localhost floor no longer governs log polling. The wording hid a real change: `event_poll_interval_ms` now has TWO unrelated consumers, and the docs described only the wrong one. - `resumable_watcher`'s `WatcherConfig::poll_interval` — the `eth_getLogs` tick cadence of every chain watcher. - alloy's pending-transaction receipt heartbeat, via `with_poll_interval` (`client().set_poll_interval`), consumed by `PendingTransactionBuilder::get_receipt` when the node awaits a mined settlement / channel tx. `with_poll_interval` is therefore NOT dead code, and `resolved.rs` was doubly wrong — it claimed the knob drives watcher filter polling via `with_poll_interval` when that path only reaches the receipt heartbeat. Both consumers are now named at every site, and `with_poll_interval`'s own doc is re-anchored to the heartbeat. The 250ms floor is unchanged; its rationale is rewritten: ~6 watcher loops each scanning `[cursor, head]` 4x/second trips provider rate limits just as the original flood did. Historical references explaining WHY the old API was abandoned (`resumable_watcher.rs`, `chain_events/mod.rs`, `slash_watcher.rs`, `blacklist_watcher.rs`, `chain_origin_directory.rs`) are left intact. ADRs are untouched: they are spec-level intent and do not mandate a transport. Docs only — no behavior change. fmt/clippy/doc clean; 703 common+cli and 786 node tests pass, including `resolve_blockchain_rejects_event_poll_interval_below_minimum`, which asserts the reworded message text. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe change updates configuration templates, documentation, validation messaging, and runtime comments to describe ChangesEvent Poll Interval Semantics
Estimated code review effort: 1 (Trivial) | ~5 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Gas snapshotNo gas changes vs base. |
There was a problem hiding this comment.
Code Review
This pull request updates documentation, comments, and error messages across several configuration and runtime files to reflect architectural changes introduced in #1106. Specifically, it clarifies that the event_poll_interval_ms configuration option now drives two distinct mechanisms: the eth_getLogs tick cadence for chain watchers and alloy's pending-transaction receipt heartbeat, rather than the previous eth_getFilterChanges polling. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Contracts coverageLine coverage: 88.92% (2488/2798 lines) |
There was a problem hiding this comment.
Pull request overview
This PR updates documentation/comments around blockchain.event_poll_interval_ms to reflect the post-#1106 reality: chain watchers now tick via eth_getLogs polling (WatcherConfig::poll_interval), while the provider client poll interval still affects pending-transaction receipt polling (via with_poll_interval / client().set_poll_interval).
Changes:
- Re-anchors
with_poll_intervaldocs innoderuntime to the pending-tx receipt heartbeat (not event watching). - Updates
commonconfig docs to describe the two distinct consumers ofevent_poll_interval_ms(watcher tick + receipt polling). - Refreshes the CLI sample config comment to reference
eth_getLogspolling and pending-tx receipt behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/node/src/runtime/mod.rs | Updates with_poll_interval and related comments/tests to describe client poll interval as receipt-heartbeat control. |
| crates/common/src/config/types.rs | Updates BlockchainConfig::event_poll_interval_ms docs to reflect dual consumers and eth_getLogs watcher ticks. |
| crates/common/src/config/resolved.rs | Updates ResolvedBlockchain::event_poll_interval_ms docs to explicitly list both consumers and how they’re applied. |
| crates/common/src/config/mod.rs | Updates constants/docs and the min-interval validation message to reflect eth_getLogs polling (and receipt heartbeat rationale). |
| crates/cli/src/commands/config.rs | Updates the default config template comment for event_poll_interval_ms to match the new semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "blockchain.event_poll_interval_ms={event_poll_interval_ms} would poll the \ | ||
| RPC endpoint with eth_getLogs faster than any provider tolerates \ | ||
| (minimum {MIN_EVENT_POLL_INTERVAL_MS}ms)" |
There was a problem hiding this comment.
Both points are correct. Fixed in 918a1c9.
Naming only one consumer: this was the exact failure mode the PR exists to fix — the knob drives two consumers and the docs named only one. Writing an error message that names only eth_getLogs reproduced it in the opposite direction. The message now names both.
"faster than any provider tolerates": stronger objection than stated. It contradicts the MIN_EVENT_POLL_INTERVAL_MS rationale 120 lines above it in this same PR, which keeps the floor at 250ms precisely because a dev anvil tolerates alloy's localhost cadence — and crates/e2e/src/node.rs drives one at 500ms. A provider that tolerates fast polling isn't hypothetical, it's the supported dev path. Dropped the universal claim for "too frequently", which also matches the sibling rpc_watchdog_interval_sec message's house style.
New message:
blockchain.event_poll_interval_ms={n} would poll the RPC endpoint too frequently
— it drives both the eth_getLogs watcher tick and pending-tx receipt polling
(minimum 250ms)
Same overclaim removed from the test comment at the assertion site. resolve_blockchain_rejects_event_poll_interval_below_minimum still passes — it requires the literal event_poll_interval_ms and minimum 250ms, both retained.
Coverage reportTotal: 80.51% (was 80.51%, ● 0.00%) — 47645/59181 lines
History
|
…sage (#1110) Review catch on #1224: the min-interval error message named only `eth_getLogs`, which is the exact failure mode this PR exists to fix — the knob drives two consumers, and the message named one of them. It also claimed a sub-minimum interval polls "faster than any provider tolerates". That contradicts the `MIN_EVENT_POLL_INTERVAL_MS` rationale 120 lines above it, which keeps the floor at 250ms precisely BECAUSE a dev anvil tolerates alloy's localhost cadence (and `crates/e2e` drives one at 500ms). Drop the universal claim for "too frequently", matching the sibling rpc_watchdog_interval_sec message. Same overclaim removed from the test comment. The message keeps `event_poll_interval_ms` and `minimum 250ms`, so `resolve_blockchain_rejects_event_poll_interval_below_minimum` still passes. fmt/clippy clean; 703 common+cli tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…sage (#1110) Review catch on #1224: the min-interval error message named only `eth_getLogs`, which is the exact failure mode this PR exists to fix — the knob drives two consumers, and the message named one of them. It also claimed a sub-minimum interval polls "faster than any provider tolerates". That contradicts the `MIN_EVENT_POLL_INTERVAL_MS` rationale 120 lines above it, which keeps the floor at 250ms precisely BECAUSE a dev anvil tolerates alloy's localhost cadence (and `crates/e2e` drives one at 500ms). Drop the universal claim for "too frequently", matching the sibling rpc_watchdog_interval_sec message. Same overclaim removed from the test comment. The message keeps `event_poll_interval_ms` and `minimum 250ms`, so `resolve_blockchain_rejects_event_poll_interval_below_minimum` still passes. fmt/clippy clean; 703 common+cli tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Why
#1106 moved every watcher off alloy
watch_logs(eth_newFilter+eth_getFilterChanges) onto oneeth_getLogspolling loop — but nine doc sites still describe the deleted API. They all paraphrase one root rationale (MIN_EVENT_POLL_INTERVAL_MS), whose two stated justifications are now both dead: there are no long-lived watcher filters, and alloy's localhost floor no longer governs log polling.The substantive bug the wording hid
event_poll_interval_msnow has two unrelated consumers, and the docs described only the wrong one:resumable_watcher'sWatcherConfig::poll_interval, theeth_getLogscadence of every chain watcher.with_poll_interval(client().set_poll_interval), consumed byPendingTransactionBuilder::get_receiptwhen the node awaits a mined settlement / channel tx (payment_settlement,buyer_channel).So
with_poll_intervalis not dead code, andresolved.rswas doubly wrong: it claimed the knob drives watcher filter polling viawith_poll_interval, when that path only ever reaches the receipt heartbeat. Both consumers are now named at every site, andwith_poll_interval's own doc is re-anchored to the heartbeat.The 250ms floor is unchanged; only its rationale is rewritten — ~6 watcher loops each scanning
[cursor, head]4×/second trips provider rate limits just as the original flood did.Scope
Docs only — no behavior change.
Left intact deliberately: the historical references explaining why the old API was abandoned (
resumable_watcher.rs,chain_events/mod.rs,slash_watcher.rs,blacklist_watcher.rs,chain_origin_directory.rs).ADRs untouched:
adr/022:300andadr/019:140describe the node as "subscribing" to events, but ADRs are spec-level intent and do not mandate a transport — 022 already calls the sibling mechanism "polling". Pinning an ADR to an implementation detail would be a downgrade. Flagging for reviewer confirmation.Verification
cargo fmt/clippy --all-targets/docclean. 703 common+cli and 786 node tests pass — includingresolve_blockchain_rejects_event_poll_interval_below_minimum, the only test asserting the message text (it requires the literalevent_poll_interval_msandminimum 250ms, both retained).🤖 Generated with Claude Code
Summary by CodeRabbit
event_poll_interval_msdrives both chain-event polling (viaeth_getLogswatcher cadence) and pending-transaction receipt polling/heartbeats.with_poll_intervaldocumentation to clarify its scope (client polling interval only) and that it no longer affects event-watcher timing after the referenced update.