reth icon indicating copy to clipboard operation
reth copied to clipboard

feat(flashblocks): Flashblocks engine sidecar

Open 0x00101010 opened this issue 2 weeks ago • 6 comments
trafficstars

Towards: https://github.com/paradigmxyz/reth/issues/18255, see bottom for follow up needed.

feat(op-reth): integrate flashblocks with consensus engine

Summary

This PR completes the integration of flashblocks with the consensus engine by:

  • Adding structured conversion infrastructure from flashblock sequences to execution payloads
  • Automatically spawning the consensus client when flashblocks are enabled
  • Improving error handling and observability with detailed logging

Integration

crates/optimism/rpc/src/eth/mod.rs

  • Added automatic spawning of FlashBlockConsensusClient when flashblocks are enabled
  • Wired up beacon_engine_handle to enable payload submission

crates/node/builder/src/rpc.rs

  • Exposed beacon_engine_handle in EthApiCtx for RPC builders to access

examples/custom-node/src/engine.rs

  • Added example implementation of From<&FlashBlockCompleteSequence> for custom execution data types
  • Shows how to derive custom extensions from flashblock sequences

Dependencies

crates/optimism/flashblocks/Cargo.toml

  • Added: op-alloy-rpc-types-engine (required for OpExecutionData)
  • Removed: ringbuffer (no longer needed with simplified FCU logic)

Testing

  • All existing tests pass
  • New unit tests for conversion functions
  • Clippy clean with all features enabled

Follow up needed

  • ~~handle optional state root calculations scenario~~ Done
  • ~~handle Jovian upgrade situation where blob_gas_used is not 0, need to update rollup-boost, op-rbuilder, and this repo for consistent types.~~ Done
  • ~~ideally we move all the flashblocks relevant data structures into op-alloy-rpc-types-engine~~ Done
  • add functionality to work with different forks

0x00101010 avatar Nov 04 '25 01:11 0x00101010