Skip to content

feat: publish synced flashblocks to ws#310

Merged
noot merged 2 commits intomainfrom
noot/sync-ws-pub
Nov 3, 2025
Merged

feat: publish synced flashblocks to ws#310
noot merged 2 commits intomainfrom
noot/sync-ws-pub

Conversation

@noot
Copy link
Contributor

@noot noot commented Oct 31, 2025

📝 Summary

  • publish synced flashblocks via websocket as well

✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

Copilot AI review requested due to automatic review settings October 31, 2025 23:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the flashblocks feature to publish synced flashblocks via WebSocket in addition to the existing P2P publishing mechanism. The main architectural change moves WebSocket publisher initialization to the service level so it can be shared between the payload builder (for locally built blocks) and payload handler (for synced blocks).

Key Changes:

  • WebSocket publisher is now instantiated at the service level and passed to both payload builder and handler components
  • Payload handler enhanced to publish received/synced flashblocks via WebSocket after successful execution
  • Refactored OpPayloadBuilder::new() to accept pre-initialized WebSocket publisher instead of creating it internally

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
service.rs Instantiates WebSocket publisher at service level and passes it to payload builder and handler
payload_handler.rs Adds WebSocket publishing for synced flashblocks with metrics recording
payload.rs Refactors constructor to accept WebSocket publisher as parameter instead of creating it
ctx.rs Adds accessor method for metrics used in publishing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SozinM
Copy link
Collaborator

SozinM commented Nov 3, 2025

What's the point of this?
I see that it's a little bit useful once we have consensus between builders, but right now seems like it's not usable (we would just post flashblocks from different builders?)

@noot
Copy link
Contributor Author

noot commented Nov 3, 2025

@SozinM it would allow RPC providers to get the flashblock stream from non-active builders as well, and allows us to easily ensure that the non-active builders are syncing properly.

@noot noot merged commit 21046aa into main Nov 3, 2025
4 checks passed
@noot noot deleted the noot/sync-ws-pub branch November 3, 2025 16:03
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.

5 participants