Skip to content

feat: introduce ChainEvent enum and update ChainNotifier broadcast type#94

Merged
prestwich merged 2 commits intodevelopfrom
feat/chain-event-enum
Mar 9, 2026
Merged

feat: introduce ChainEvent enum and update ChainNotifier broadcast type#94
prestwich merged 2 commits intodevelopfrom
feat/chain-event-enum

Conversation

@prestwich
Copy link
Member

Summary

  • Introduces ChainEvent enum wrapping NewBlock(Box<NewBlockNotification>) and Reorg(ReorgNotification) so the broadcast channel can carry both event types
  • Updates ChainNotifier to broadcast ChainEvent instead of NewBlockNotification directly (send_notificationsend_event)
  • Updates SubscriptionTask receiver to destructure ChainEvent::NewBlock; Reorg variant is skipped for now (handling in later subtickets)
  • No behavior change for non-reorg paths

Refs: ENG-1967

Test plan

  • cargo clippy -p signet-rpc --all-features --all-targets — clean
  • cargo clippy -p signet-node --all-features --all-targets — clean
  • cargo +nightly fmt — clean
  • cargo t -p signet-rpc — 35 tests + 3 doctests pass

🤖 Generated with Claude Code

@prestwich prestwich requested a review from a team as a code owner March 9, 2026 15:38
prestwich and others added 2 commits March 9, 2026 12:03
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>
@prestwich prestwich force-pushed the feat/chain-event-enum branch from a5a144e to 2048d52 Compare March 9, 2026 16:06
@prestwich prestwich requested a review from Evalir March 9, 2026 16:20
@prestwich prestwich enabled auto-merge (squash) March 9, 2026 16:22
@prestwich prestwich merged commit e6c8b7e into develop Mar 9, 2026
6 checks passed
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.

2 participants