reth
reth copied to clipboard
feat(flashblocks): Flashblocks engine sidecar
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
FlashBlockConsensusClientwhen flashblocks are enabled - Wired up
beacon_engine_handleto enable payload submission
crates/node/builder/src/rpc.rs
- Exposed
beacon_engine_handleinEthApiCtxfor 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 forOpExecutionData) - 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