feat: introduce ChainEvent enum and update ChainNotifier broadcast type#94
Merged
feat: introduce ChainEvent enum and update ChainNotifier broadcast type#94
Conversation
prestwich
commented
Mar 9, 2026
prestwich
commented
Mar 9, 2026
Wrap NewBlockNotification in a ChainEvent enum so the broadcast channel can carry both new-block and reorg notifications. Subscribers destructure the enum and skip Reorg events for now (handling comes in later tickets). Refs: ENG-1967 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR review feedback: - Add public `send_new_block` that wraps internally - Add public `send_reorg` for reorg notifications - Make `send_event` private — callers use typed convenience methods - Add comment on Reorg skip noting future PR coverage (ENG-1968) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a5a144e to
2048d52
Compare
Evalir
approved these changes
Mar 9, 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
ChainEventenum wrappingNewBlock(Box<NewBlockNotification>)andReorg(ReorgNotification)so the broadcast channel can carry both event typesChainNotifierto broadcastChainEventinstead ofNewBlockNotificationdirectly (send_notification→send_event)SubscriptionTaskreceiver to destructureChainEvent::NewBlock;Reorgvariant is skipped for now (handling in later subtickets)Refs: ENG-1967
Test plan
cargo clippy -p signet-rpc --all-features --all-targets— cleancargo clippy -p signet-node --all-features --all-targets— cleancargo +nightly fmt— cleancargo t -p signet-rpc— 35 tests + 3 doctests pass🤖 Generated with Claude Code