feat(flashblocks): shift atomic gossip op, wspub on seq after p2p gossip#210
feat(flashblocks): shift atomic gossip op, wspub on seq after p2p gossip#210
Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude review this PR |
|
Claude finished @sieniven's task in 3m 31s —— View job PR Review: feat(flashblocks): shift atomic gossip op, wspub on seq after p2p gossip
SummaryGood architectural direction — removing 🔴 Critical: WS publishes before p2p gossip in
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… flag Rename p2p/ module to broadcast/ to better reflect its dual role (p2p gossip + WS publishing). Move wspub.rs into broadcast/, remove the p2p_enabled config flag so the broadcast node always runs, fix WS publish ordering to run after p2p gossip, and improve error handling so ws_pub failures warn instead of crashing the node. Update stale comments referencing the removed p2p_enabled flag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@claude please help to review again, check that all your previous mentioned points have been resolved |
|
Claude finished @sieniven's task in 2m 13s —— View job PR Re-Review: feat(flashblocks): shift atomic gossip op, wspub on seq after p2p gossip
All three previously raised issues have been resolved. Details below. ✅ Fixed: WS publish ordering (was 🔴 Critical)
if let Err(e) = outgoing_streams_handler.broadcast_message(message.clone()).await {
warn!(...) // p2p first
}
if let Message::OpFlashblockPayload(ref fb_payload) = message {
match ws_pub.publish(fb_payload) { ... } // WS second
}
✅ Fixed:
|
Summary
Fixes the websocket publishing logic on the flashblocks builder into the p2p node service instead. This ensures zero re-org on subscribed flashblocks RPC nodes by ensuring p2p gossip to follower sequencers is a blocking successful operation first before gossiping the flashblocks to RPC nodes.
This allows for atomicity on flashblocks replay during sequencer switches / failures of the leader sequencer, to replay consistent gossiped flashblocks across RPC nodes. This ensures flashblocks re-org is guaranteed protected on RPC nodes.