Repository navigation
test(firehose): cover system calls, the pipeline path and more Amsterdam cases - #100
Merged
Merged
Conversation
…dam cases This adds tests only. - setup_guards: a Cancun block must emit the EIP-4788 system call. It fails with a clear message when system-call inspection is not on, instead of an opaque golden diff. - pipeline_trace: a prestate block run through FirehoseBlockExecutor::execute_and_trace_one with the process-wide tracer must match the run_wrapped_block golden. That covers the deferred flush in into_state. - bal_pipeline: an Amsterdam block with a transfer, a CREATE with a storage write and a storage-writing call must rebuild the same block access list as the stock executor. - firehose_live_tracing_amsterdam_validation: a second node validates Amsterdam blocks on the traced engine path, with a zero priority fee, duplicate and zero-amount withdrawals, a revert, an out-of-gas CREATE, a CREATE, an empty block, CREATE with SELFDESTRUCT and 64 transactions from one sender.
maoueh
approved these changes
Nov 12, 2026
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.
This PR adds tests only. It changes no code outside test files, and adds
alloy-eip7928,alloy-signerandalloy-signer-localas dev-dependencies ofreth-firehose-tests.What the tests cover
crates/firehose-tests/tests/setup_guards.rs: a Cancun block must emit the EIP-4788 beacon root system call. When system-call inspection is not on, evm2 runs system calls without the inspector, the Firehose block has no system calls and every later ordinal shifts. A golden diff shows that only as an opaque mismatch. This guard fails with a message that names the cause.crates/firehose-tests/tests/pipeline_trace.rs: thenop_transferprestate block runs throughFirehoseBlockExecutor::execute_and_trace_onewith the process-wide tracer, as staged sync runs it. The emitted block must match the same golden asrun_wrapped_block. This covers the deferred flush ininto_state, whichbatch_executor.rschecks only by countingFIRE BLOCKlines.crates/firehose-tests/tests/bal_pipeline.rs: an Amsterdam block with a transfer, a CREATE with a storage write, and a call that writes storage runs through the stockBasicBlockExecutorto get the reference block access list hash. Then it runs throughrun_wrapped_block. The rebuilt list must match that hash, and the emitted RLP must hash to the header's hash. The single-transaction fixture ofstaged_sync_bal.rscannot catch a block access index that is wrong only for later transactions.crates/engine/tree/tests/firehose_live_tracing_amsterdam_validation.rs: one node builds Amsterdam blocks and a second node validates them on the traced engine path, so the second node sees each block only throughengine_newPayload. The blocks cover a plain transfer, a zero priority fee, nonzero, duplicate and zero-amount withdrawals, a revert and an out-of-gas CREATE, a CREATE, an empty block, CREATE with SELFDESTRUCT, and 64 transactions from one sender. For each block, the validator must returnVALID, emit the block once, and emit the BAL hash, a BAL RLP that hashes to it, and the slot number.I put the two-node test in its own file next to
firehose_live_tracing_amsterdam.rs, not in that file. Each file installs the process-wide tracer, andinit_tracer_with_bufferruns only once per process, so a second test in the same binary cannot install its own buffer.Evidence
The new tests pass on
release/reth-2.x, because they test existing behavior. To show that each one can fail, I ran negative controls:set_inspect_system_calls(false)inFirehoseWrappedExecutor::with_hooks:setup_guardsfails with its message, andpipeline_tracefails on the golden.FirehoseBlockExecutor::into_statedrops the pending tracer instead ofmark_verified:pipeline_tracefails (no block emitted).run_wrapped_blockdoes not enable the BAL builder:bal_pipelinefails.block_access_list_rlpinto the header: the two-node test fails with "emitted no BAL RLP".cargo +nightly fmt --checkis clean for the touched files.zepter run checkanddprint checkpass.cargo clippy -p reth-firehose-tests -p reth-engine-tree --all-targets -- -D warningsfails onrelease/reth-2.xalready, on lines this PR does not touch (thereth-firehoselint set,type_repetition_in_boundsandneedless_pass_by_ref_mutinpayload_validator.rs,unused_mutincrates/rpc/rpc/src/debug.rs). With those lints allowed, clippy is clean.Left out
Cargo.lockfor thestreamingfast/evm2fork. Sincereth-v2.11.0-fh3.1, evm2 comes from upstream, so I dropped it.bin/reth/src/firehose.rsalready refuses--jit.