Skip to content

op-reth: fix filtered flashblock log streams - #23336

Closed
joshklop wants to merge 1 commit into
joshklop/update-reth-v2.6.0from
joshklop/flashblock-logs-bloom
Closed

joshklop wants to merge 1 commit into
joshklop/update-reth-v2.6.0from
joshklop/flashblock-logs-bloom

Conversation

@joshklop

@joshklop joshklop commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #23046. Fixes finding 4 in this review: since paradigmxyz/reth#26946 added a logs-bloom prefilter to matching_block_logs_with_tx_hashes, OpEthApi::flashblock_receipts_stream returned no logs for any filter with an address or topic, because its synthetic header has a zero bloom. Only the empty filter still worked. Only downstream users of this public API are affected; nothing in-tree calls it.

The header's bloom is now all ones. The receipts are scanned right after the bloom check, so a bloom computed from them (the fix suggested in the review) would cost a hash per log per subscriber and save nothing.

rust-code-reviewer found no issues with this change. Separately, it found that the stream reports transactionIndex/logIndex in tx-hash order. That predates this PR and is tracked in ethereum-optimism/protocol-team#453.

🤖 Generated with Claude Code

reth #26946 made `matching_block_logs_with_tx_hashes` return early when the
filter does not match the header's logs bloom. The synthetic header that
`flashblock_receipts_stream` builds left the bloom zeroed, so every filter
with an address or topic yielded no logs.

Set the bloom to all ones so the prefilter never rejects the flashblock.
Its receipts are scanned right after, so a bloom computed from them would
save no work and only cost hashing every log for every subscriber. Also
extract the per-flashblock matching into a function so it can be unit
tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshklop
joshklop requested a review from a team as a code owner October 11, 2026 20:57
@joshklop
joshklop force-pushed the joshklop/flashblock-logs-bloom branch from 69c7ecd to e617a0a Compare October 11, 2026 21:27
@joshklop joshklop changed the title op-reth: serve pending flashblock logs and fix filtered flashblock streams op-reth: fix filtered flashblock log streams Oct 11, 2026
@joshklop

Copy link
Copy Markdown
Contributor Author

Cherry-picked onto #23046 as ec7fc1e, so this is no longer needed.

@joshklop joshklop closed this Oct 11, 2026
@joshklop
joshklop deleted the joshklop/flashblock-logs-bloom branch October 11, 2026 21:35
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