Trace locally-built derivation blocks in Firehose#7
Merged
Conversation
op-node reconstructs the L1-derived (safe) chain by building each block via engine getPayload (no_tx_pool), which inserts it as canonical without passing through the traced newPayload path. Those blocks never emitted a FIRE BLOCK, leaving gaps whenever a node caught up from an old snapshot. Add a firehose_trace_built_block hook on ConfigurePostExecEvm (default no-op) that OpFirehoseEvmConfig overrides to re-execute the frozen block through the existing OpChainHooks tracing executor, reusing the exact OpPostTxExtras/OpPreTxAdjust wrapping as the pipeline and engine paths so output is byte-identical. The payload builder calls it after a Freeze, gated on is_tracer_initialized so non-firehose builds are unaffected. Re-execution is confined to these built (older, derived) blocks and never touches the live gossip newPayload path.
Author
|
Tested on unichain data over 20k blocks \o/ |
There was a problem hiding this comment.
Pull request overview
This PR addresses missing Firehose FIRE BLOCK emissions for OP derivation (no_tx_pool) blocks that are locally built via getPayload and inserted as canonical without traversing the traced newPayload path. It introduces a Firehose-specific hook in the OP EVM configuration and invokes it from the payload builder to re-execute and trace those locally-built blocks when the tracer is installed.
Changes:
- Add a default no-op
firehose_trace_built_blockhook toConfigurePostExecEvm, overridden by the Firehose EVM config to re-execute a built block throughOpChainHooks::execute_one_traced. - Invoke the hook from the payload builder after a
Freezeoutcome forno_tx_poolbuilds, gated byreth_firehose::is_tracer_initialized(). - Update the StreamingFast release workflow to remove branch-push builds, add build caching, and select the Docker build profile based on whether the ref is a tag.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/op-reth/crates/payload/src/builder.rs | Re-executes and traces no_tx_pool frozen payload blocks when Firehose tracing is active. |
| rust/op-reth/crates/payload/Cargo.toml | Adds reth-firehose dependency for tracer initialization gating. |
| rust/op-reth/crates/firehose/src/evm_config.rs | Implements the new Firehose tracing hook by running the block through the traced executor path. |
| rust/op-reth/crates/evm/src/post_exec_ext.rs | Extends ConfigurePostExecEvm with a default no-op Firehose tracing hook. |
| rust/Cargo.lock | Locks new transitive dependency inclusion (reth-firehose). |
| .github/workflows/sf-release.yml | Adjusts triggers and build behavior; adds build caching and profile selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
130
to
+136
| build-args: | | ||
| VERSION=${{ steps.extract-version.outputs.VERSION }} | ||
| FIREHOSE_ETHEREUM=${{ inputs.firehose_ethereum || 'latest' }} | ||
| # Full LTO `maxperf` is only worth its ~19m link tail for shippable | ||
| # builds (tags); PRs and manual dispatch use `fast-build` (no LTO) to | ||
| # validate faster. | ||
| BUILD_PROFILE=${{ startsWith(github.ref, 'refs/tags/') && 'maxperf' || 'fast-build' }} |
Comment on lines
+314
to
+317
| if tracer.is_genesis() { | ||
| tracer.mark_verified(); | ||
| return Ok(()); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When op-reth catches up from an old snapshot, large ranges of blocks never emit a
FIRE BLOCK. Root cause: op-node reconstructs the L1-derived (safe) chain by building each block via enginegetPayload(no_tx_pool), which inserts it as canonical without going through the tracednewPayload/validate_block_with_statepath. The laternewPayloadfor the same block short-circuits (already canonical), so it's never traced.Only two surfaces were instrumented — the staged-sync
batch_executorand the live engine validator. The payload-builder surface was not, so derivation-built blocks were invisible to Firehose. Live gossip→newPayloadblocks trace fine, which is why only the catch-up range was missing.This is OP-specific: vanilla L1 reth followers never rebuild canonical blocks via the payload builder.
Fix
firehose_trace_built_blockhook onConfigurePostExecEvm, default no-op.OpFirehoseEvmConfigoverrides it: re-execute the frozen block through the existingOpChainHooks::execute_one_traced(sameOpPostTxExtras/OpPreTxAdjustwrapping as the pipeline + engine paths -> byte-identical output), bracketed by aFirehoseBlockTracer.Freeze, gated onis_tracer_initialized().Properties
newPayloadfor a built block short-circuits without re-execution.is_tracer_initialized()false => pure no-op; non-firehose/vanilla builds unaffected.Scope
Optimism monorepo only; zero changes to the
streamingfast/rethfork. Thebaserepo needs a parallel change.