Skip to content

chain/ethereum: Fix dropped block trigger when once and polling filters match same block#6530

Open
incrypto32 wants to merge 3 commits intomasterfrom
krishna/fix-polling-interval-trigger-collision
Open

chain/ethereum: Fix dropped block trigger when once and polling filters match same block#6530
incrypto32 wants to merge 3 commits intomasterfrom
krishna/fix-polling-interval-trigger-collision

Conversation

@incrypto32
Copy link
Copy Markdown
Member

blocks_matching_polling_intervals used find_map over polling_intervals, which short-circuits on the first matching entry. Since the once and polling conditions are mutually exclusive within a single entry, a block matching both rule kinds via different entries only got one trigger.

Replace with two independent .any() scans, matching parse_block_triggers.

  • Extract shared logic into block_trigger_types_from_intervals.
  • Add unit tests for the collision and baseline cases.

…ch same block

blocks_matching_polling_intervals used find_map over polling_intervals,
which short-circuits after the first matching entry. Since a single
(start_block, interval) tuple satisfies at most one of the once/polling
conditions, a block that should emit both Start and End only got one.
HashSet iteration order made which trigger survived non-deterministic
across process restarts, causing PoI divergence.

Replace with two independent any() scans so both conditions are
evaluated across all entries, matching parse_block_triggers on the
BlockFinality::NonFinal (reorg-window) path.
Both blocks_matching_polling_intervals (JSON-RPC path) and
parse_block_triggers (Firehose path) now compute the same
once/polling match logic. Pull it into a shared pure function
so the two paths cannot drift out of sync.
Cover the determinism-critical cases the new helper guards against:
once-only, polling-only, once + polling sharing a start_block,
cross-datasource collision where a polling schedule lands on another
datasource's once block, and the empty/no-match cases.
@incrypto32 incrypto32 requested a review from lutter April 21, 2026 11:18
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.

1 participant