Skip to content

Conversation

@0xForerunner
Copy link
Collaborator

Our team was discussing today what the optimal way to distribute flashblocks to consuming nodes is. I feel the websocket proxy method feels a bit forced like pushing web2 apis on something that should really be web3 based. As well, a websocket proxy could be vulnerable do a DDOS attack where some bad actor consumes all available connections on the proxy and is able to take advantage of MEV opportunities without competition.

I've got a very WIP implementation of what distributing flashblocks over the p2p layer could look like instead! Basic flow:

  • rollup-boost should be in charge of authorizing who has permission to build blocks
  • rollup-boost signs a message authorizing a builder to build a block with a specific payload_id
  • signed Authorization is included in modified ForkChoiceUpdated with attrs call to builder
  • builder receives Authorization, begins building blocks and publishes them over the flashblocks peering layer as a new libp2p capability utilizing the existing peer set
  • flashblocks published over the peering layer contain the builders signature along with it's authorization for that payload_id
  • nodes receive the flashblocks and validate their authorization

I'm posting a draft PR here just in case you're curious to take a look. It's absolutely not ready so please don't leave any comments on implementation. I'm really please with how easy it is to add p2p capabilities on top of reth!

@vercel
Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
rollup-boost Ignored Ignored Preview Dec 17, 2025 0:29am

@haardikk21
Copy link
Contributor

I wonder if we can have the optionality of choosing between websocket and p2p, or both rather than entirely replacing it. For example, consumers consume from the websocket stream primarily since it's faster and fallback to p2p messages if they get disconnected/rate-limited etc on the WS stream.

RUN cargo install cargo-chef --version ^0.1

RUN apt-get update \
&& apt-get install -y clang libclang-dev
Copy link
Collaborator

@0xOsiris 0xOsiris Dec 17, 2025

Choose a reason for hiding this comment

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

Is this necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have this now:

RUN apt-get update \
    && apt-get install -y clang libclang-dev gcc

Should be fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah I'm asking is this a necessary addition. It was working previously, so what addition made this a necessary change

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TBH it was a while ago and I'm not sure :p

hex = "0.4"

# Reth deps, use 4231f4b to get latest op-alloy
reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "4231f4b" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

These dependencies should be pinned to v1.9.3

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

1.9.3 doesn't have the latest op-alloy which is causing problems

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we just match the alloy versions from reth?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd have to downgrade op_alloy_rpc_types_engine since we're already depending on the newer version here.

Co-authored-by: 0xOsiris <djosiris@proton.me>
@0xForerunner 0xForerunner marked this pull request as ready for review December 17, 2025 00:29
Copilot AI review requested due to automatic review settings December 17, 2025 00:29
Copy link

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 introduces a P2P-based flashblocks propagation mechanism to replace the WebSocket-based approach. The implementation uses libp2p to distribute flashblocks across nodes with cryptographic authorization, improving fault tolerance for HA sequencer setups. The key innovation is using signed authorization tokens from rollup-boost to control which builder can publish flashblocks, with graceful failover support through StartPublish/StopPublish messages.

Key Changes:

  • Adds P2P flashblocks protocol specification with authorization and security model
  • Implements cryptographic authorization using ed25519 signatures
  • Adds RLP encoding/decoding for flashblocks and authorization structures
  • Introduces FlashblocksP2PArgs for configuring P2P mode alongside existing WebSocket mode
  • Refactors RpcClient to support optional flashblocks authorization keys

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
specs/flashblocks_p2p.md Comprehensive specification for P2P flashblocks protocol including authorization, security, and multi-builder coordination
crates/rollup-boost/src/server.rs Refactors server initialization to support both WebSocket and P2P flashblocks modes
crates/rollup-boost/src/client/rpc.rs Adds FlashblocksP2PKeys and authorization logic to fork choice updates
crates/rollup-boost/src/flashblocks/args.rs Splits flashblocks args into WebSocket and P2P variants with validation
crates/rollup-boost/src/cli.rs Adds extensive CLI argument parsing tests for P2P configuration
crates/rollup-boost-types/src/authorization.rs Implements Authorization structure with signing, verification, and RLP encoding
crates/rollup-boost-types/src/flashblocks.rs Adds manual RLP encoding/decoding for FlashblocksPayloadV1
Cargo.toml Adds ed25519-dalek, blake3, hex dependencies and updates reth to rev 4231f4b

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

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.

4 participants