feat: handle ChainEvent::Reorg in SubscriptionTask#97
Merged
Conversation
…mission Replace the no-op reorg arm in SubscriptionTask::task_future with proper handling that filters removed logs against subscription criteria and emits them with `removed: true` per the Ethereum JSON-RPC spec. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
77c27e5 to
62016a2
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Evalir
reviewed
Mar 11, 2026
Evalir
approved these changes
Mar 11, 2026
Fraser999
reviewed
Mar 11, 2026
Address review feedback: - Replace `removed_hashes`/`removed_logs` with per-block `RemovedBlock` structs carrying headers, so removed logs include `block_hash`, `block_number`, and `block_timestamp` per the Ethereum JSON-RPC spec. - Use `let else` instead of match for early return (Evalir). - Take `ReorgNotification` by value in `filter_reorg_for_sub` to avoid intermediate `collect` and per-log clones. - Use `into_inner()` on `SealedHeader` instead of `inner().clone()`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fraser999
approved these changes
Mar 12, 2026
Evalir
approved these changes
Mar 12, 2026
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.
Summary
InterestKind::filter_reorg_for_subto filter removed logs from reorg notifications against subscription criteria, emitting matching logs withremoved: trueper the Ethereum JSON-RPC specChainEvent::Reorgarm inSubscriptionTask::task_futurewith proper handling that buffers filtered removed logs for emission to subscribersCloses ENG-1970 (subticket 4 of ENG-1900).
Stack
This PR includes commits from #96. Review only the top commit.
BlockTags::rewind_tofor reorg tag updatesSubscriptionTaskreorg handlingget_filter_changesreorg watermark (includes feat: update BlockTags during reorgs to prevent stale tag window #96, feat: handle ChainEvent::Reorg in SubscriptionTask #97)Test plan
removed: truecargo clippy -p signet-rpc --all-features --all-targetsclean🤖 Generated with Claude Code