Skip to content

docs(node,common,cli): re-anchor event_poll_interval_ms docs to eth_getLogs (#1110) - #1224

Merged
thiras merged 2 commits into
mainfrom
docs/1110-getlogs-poll-interval-docs
Jul 16, 2026
Merged

thiras merged 2 commits into
mainfrom
docs/1110-getlogs-poll-interval-docs

Conversation

@thiras

@thiras thiras commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Why

#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 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_ms now has two unrelated consumers, and the docs described only the wrong one:

  1. The watcher tick — resumable_watcher's WatcherConfig::poll_interval, the eth_getLogs cadence of every chain watcher.
  2. The pending-tx receipt heartbeat — via with_poll_interval (client().set_poll_interval), consumed by PendingTransactionBuilder::get_receipt when the node awaits a mined settlement / channel tx (payment_settlement, buyer_channel).

So with_poll_interval is 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 ever 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; 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:300 and adr/019:140 describe 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/doc clean. 703 common+cli and 786 node tests pass — including resolve_blockchain_rejects_event_poll_interval_below_minimum, the only test asserting the message text (it requires the literal event_poll_interval_ms and minimum 250ms, both retained).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified that event_poll_interval_ms drives both chain-event polling (via eth_getLogs watcher cadence) and pending-transaction receipt polling/heartbeats.
    • Updated operator-facing config template comments to show the default (7000ms) and minimum (250ms) behavior, including the “too-frequent” impact explanation.
    • Refined with_poll_interval documentation to clarify its scope (client polling interval only) and that it no longer affects event-watcher timing after the referenced update.

…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]>
Copilot AI review requested due to automatic review settings July 16, 2026 15:16
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Free

Run ID: 00d5bedf-b507-4335-90ab-378b2c544480

📥 Commits

Reviewing files that changed from the base of the PR and between e1120f0 and 918a1c9.

📒 Files selected for processing (1)
  • crates/common/src/config/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/common/src/config/mod.rs

Walkthrough

The change updates configuration templates, documentation, validation messaging, and runtime comments to describe event_poll_interval_ms as controlling eth_getLogs watcher cadence and pending-transaction receipt heartbeat polling. No runtime logic, values, types, or validation conditions changed.

Changes

Event Poll Interval Semantics

Layer / File(s) Summary
Configuration semantics and validation
crates/cli/src/commands/config.rs, crates/common/src/config/*
Configuration documentation, minimum-interval rationale, validation messaging, and related test comments now reference eth_getLogs polling and receipt heartbeats.
Runtime polling consumers
crates/common/src/config/resolved.rs, crates/node/src/runtime/mod.rs
Runtime comments describe separate watcher cadence and pending-transaction receipt heartbeat consumers, including Alloy’s local default override.

Estimated code review effort: 1 (Trivial) | ~5 minutes


Note

🎁 Summarized by CodeRabbit Free

Your 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 @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Gas snapshot

No gas changes vs base.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Contracts coverage

Line coverage: 88.92% (2488/2798 lines)
▲ +0.00pp vs base (88.92% → 88.92%)
Run: 29515571333

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_interval docs in node runtime to the pending-tx receipt heartbeat (not event watching).
  • Updates common config docs to describe the two distinct consumers of event_poll_interval_ms (watcher tick + receipt polling).
  • Refreshes the CLI sample config comment to reference eth_getLogs polling 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.

Comment on lines +1192 to +1194
"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)"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 80.51% (was 80.51%, ● 0.00%) — 47645/59181 lines

File Coverage Lines Δ
crates/cli/src/commands/config.rs 69.53% 178/256 ● 0.00%
crates/common/src/config/mod.rs 97.02% 6567/6769 ● 0.00%
crates/common/src/config/resolved.rs 100.00% 48/48 ● 0.00%
crates/node/src/runtime/mod.rs 49.61% 1083/2183 ● 0.00%
History
Commit Total Δ vs base
e1120f0 80.51% ▼ 0.02%
918a1c9 (HEAD) 80.51% ● 0.00%

thiras added a commit that referenced this pull request Jul 16, 2026
…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]>
@thiras
thiras merged commit e904b3e into main Jul 16, 2026
23 checks passed
@thiras
thiras deleted the docs/1110-getlogs-poll-interval-docs branch July 16, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants