Skip to content

chain/ethereum: OR-merge receipt requirements in EthereumLogFilter#6558

Open
incrypto32 wants to merge 2 commits intomasterfrom
receipt-merge-fix
Open

chain/ethereum: OR-merge receipt requirements in EthereumLogFilter#6558
incrypto32 wants to merge 2 commits intomasterfrom
receipt-merge-fix

Conversation

@incrypto32
Copy link
Copy Markdown
Member

Summary

EthereumLogFilter merged per-handler receipt: bool flags using overwrite semantics, so when two handlers collided on the same filter key with different receipt flags, a later false would silently drop a prior true. Handlers that declared receipt: true then ran with event.receipt == null.

Wrap the three internal collections in MergeMap / MergeGraph newtypes whose only mutators OR-combine values, and update from_data_sources, from_mapping, and extend to use them.

Triggers when a manifest has two handlers at the same effective filter key (e.g. same (contract, event)) with different receipt flags.

incrypto32 added 2 commits May 5, 2026 16:31
Cover all six insertion sites (from_data_sources arms, from_mapping,
extend) and assert OR semantics across the three internal collections
(contracts_and_events_graph, wildcard_events, events_with_topic_filters).

Tests use two assertion helpers (assert_from_data_sources_or_merges and
assert_extend_or_merges) parameterized over the match-arm or collection
variant. Each helper runs both insertion orders so order-independence
is verified per variant. The OR-semantics property test catches any
flag-sequence regression.
Wrap the three EthereumLogFilter collections in MergeMap and MergeGraph
newtypes whose only mutators (or_insert / or_add_edge) OR-combine the
bool weight with any existing value at the same key. The inner HashMap
and GraphMap are private, so callers cannot bypass the merge by going
through HashMap::insert or GraphMap::add_edge.

When two handlers collide on the same filter key with differing receipt
flags, the merged value is now the logical OR rather than the last
write. Handlers that declared receipt: true now reliably receive
transaction receipts even when another handler at the same key declared
receipt: false.
@incrypto32 incrypto32 force-pushed the receipt-merge-fix branch from b843c69 to a82f63d Compare May 5, 2026 11:02
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