chain/ethereum: Fix dropped block trigger when once and polling filters match same block (#6530)
* chain/ethereum: Fix dropped trigger when once and polling filters match 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. * chain/ethereum: Extract block_trigger_types_from_intervals helper 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. * chain/ethereum: Add tests for block_trigger_types_from_intervals 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.
K
Krishnanand V P committed
4ed1afe834680a86686487d86356b59958892a03
Parent: 6848b54
Committed by GitHub <noreply@github.com>
on 4/22/2026, 2:02:42 PM