Skip to content

Make Flashblocks Generic over Payload #20014

@rezbera

Description

@rezbera

Describe the feature

Currently, many teams are looking at pre-confirmations. Most solutions are variations of Flashblocks (e.g. Gattaca's Frags).
Rather than everyone recreating the wheel, I believe Reth would be the optimal place for a modular implementation.

The optimal modular solution would look as follows:

  1. rblib for custom payload building with Flashblocks when the sequencer builds blocks. The Flashbots team sees no reason this could be uncoupled from the Optimism payload types. This would be responsible for transmitting encoded flashblocks over websocket.
  2. Reth for ingesting and serving flashblocks state. High level, this involves
    1. Decoding JSON bytes into the FlashBlock type. This is hardcoded to OpFlashblockPayload which could be modularized. src
    2. Inserting the Flashblock(s) into a pending sequence state src
    3. Pending Block Building, responsible for creating a PendingFlashBlock. This seems fairly flexible already except requiring NextBlockEnvCtx: From<OpFlashblockPayloadBase>. I don't believe this is needed. src
    4. Finally in the RPC layer, the PendingFlashBlock is observed and state is read from the internal PendingBlock. Both of these types don't seem to be Optimism specific. src

Let me know if there's appetite for something like this and I can whip up a PR

Additional context

No response

Metadata

Metadata

Assignees

Labels

A-op-rethRelated to Optimism and op-rethA-sdkRelated to reth's use as a libraryC-enhancementNew feature or request

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions