Skip to content

feat: add sequencer/rpc mode for flashblock preconfirmations#214

Draft
fridrik01 wants to merge 4 commits intorezbera/use-modular-flashblocksfrom
sequencer-dev
Draft

feat: add sequencer/rpc mode for flashblock preconfirmations#214
fridrik01 wants to merge 4 commits intorezbera/use-modular-flashblocksfrom
sequencer-dev

Conversation

@fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Feb 6, 2026

This PR adds flashblock support to bera-reth and introduces two modes:

  • Sequencer mode: the node produces flashblocks at ~200ms intervals during block building and broadcasts signed partial blocks over WebSocket.
  • RPC mode: the node subscribes to a sequencers websocket stream and serves in-progress flashblock data through the standard Eth JSON-RPC layer, enabling transaction preconfirmations.

Sequencer mode (--sequencer-enabled)

  • --flashblock-signing-key <path> Path to BLS secret key file (required)
  • --flashblock-ws-addr <addr> WebSocket bind address (default: 0.0.0.0:8548)
  • --flashblock-interval-ms <ms> Emission interval (default: 200)

The payload builder runs a loop that (as in line with preconf notion doc):

  1. Checks stop conditions and exits when:
  • getPayload is called (block finalization requested)
  • Deadline exceeded (--builder.deadline)
  • Gas limit reached (block full)
  1. Emits flashblocks every 200ms and publishes current progress regardless of transaction activity (empty flashblocks serve as heartbeats)
  2. Pulls txs from mempool, executes them, tracks gas and fees
  3. Emits final flashblock on loop exit with is_last: true so RPC nodes know no more updates are coming

Each flashblock contains:

  • payload_id / index Identifies position in the block building sequence
  • base Block header fields (only in index 0)
  • diff Incremental transactions, receipts, and state changes
  • signature BLS signature over the diff for authentication
  • is_last Signals final flashblock for this payload

Also, a single publisher broadcasts to all connected WebSocket subscribers.

RPC consumer mode (--flashblocks-url )

RPC nodes connect to a sequencer's WebSocket endpoint and subscribe to flashblocks. Incoming flashblocks are processed and used to override the Eth JSON-RPC layer so that latest and pending queries reflect sub-block state. Blocks, transaction counts, receipts, state, gas price, and call execution all serve in-progress flashblock data without the node needing to run as a sequencer.

Test plan

See test plan in berachain/beacon-kit#3005

@fridrik01 fridrik01 self-assigned this Feb 6, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sequencer-dev

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fridrik01 fridrik01 changed the title feat: add sequencer mode for flashblock preconfirmations feat: add sequencer/rpc mode for flashblock preconfirmations Feb 18, 2026
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.

1 participant