This document proposes extensions to crates/optimism/flashblocks/:
All changes integrate into the existing FlashBlockService rather than creating a parallel execution pipeline.
Flashblocks are partial block updates streamed via WebSocket from the sequencer. They arrive with lower latency than canonical blocks, which propagate through P2P gossip. A typical OP Stack block period (2 seconds) produces multiple flashblocks at 200ms intervals, each containing the transactions processed since the previous update. The complete set of flashblocks for a single canonical block is called a sequence.
This latency difference creates an opportunity: nodes can act on flashblock data before the corresponding canonical block arrives, improving responsiveness for downstream consumers. A trading bot, for example, can observe a pending transaction 500ms before that transaction becomes part of a canonical block.
However, this opportunity comes with complexity. Flashblocks may arrive out of order. The canonical chain may diverge from what flashblocks predicted (a reorg). Pending state must be reconciled when canonical blocks eventually arrive.
The reth-optimism-flashblocks crate processes incoming flashblocks and executes their transactions to produce pending state. The flow works as follows:
SequenceManagernext_buildable_args() which checks if any sequence's parent hash matches the canonical tipPendingFlashBlockThe produced PendingFlashBlock serves two purposes:
reth-optimism-rpc crate integrates with flashblocks via LoadPendingBlock, allowing eth_getBalance(addr, "pending") and similar queries to return flashblock stateFlashBlockConsensusClient submits completed sequences to the Engine API via engine_newPayload and engine_forkChoiceUpdated, advancing the chain before canonical blocks arrive via P2P