chain/ethereum: Fix dropped block trigger when once and polling filters match same block#6530
Open
incrypto32 wants to merge 3 commits intomasterfrom
Open
chain/ethereum: Fix dropped block trigger when once and polling filters match same block#6530incrypto32 wants to merge 3 commits intomasterfrom
incrypto32 wants to merge 3 commits intomasterfrom
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
blocks_matching_polling_intervalsusedfind_mapoverpolling_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, matchingparse_block_triggers.block_trigger_types_from_intervals.