feat: handle ChainEvent::Reorg in SubscriptionTask#97
Open
feat: handle ChainEvent::Reorg in SubscriptionTask#97
Conversation
This was referenced Mar 10, 2026
…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
Comment on lines
+106
to
+109
| let filter = match self.as_filter() { | ||
| Some(f) => f, | ||
| None => return self.empty_sub_buffer(), | ||
| }; |
Evalir
approved these changes
Mar 11, 2026
Fraser999
reviewed
Mar 11, 2026
Comment on lines
+103
to
+104
| /// Block subscriptions return an empty buffer — removed block headers | ||
| /// are not available from the reorg notification. |
Contributor
There was a problem hiding this comment.
Could we update ReorgNotification to hold removed headers rather than removed hashes? That way, we could populate the logs' hash, number and timestamp fields.
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