Repository navigation
test(firehose): cover the mapper and pin the tracer's call-data limits - #101
Merged
maoueh merged 1 commit intoNov 12, 2026
Merged
Conversation
Unit tests cover to_block_data (header fields, withdrawals, uncles), signed_tx_to_tx_event (legacy, EIP-1559, EIP-2930 with an access list), receipt mapping, finalized_ref_from_num_hash and to_genesis_alloc. Inspector tests pin two firehose-tracer rules end to end: a KECCAK256 preimage stays only when its hash is a written storage slot, and call input and return data are cut past the per-transaction limits (50 MiB of input, 25 MiB of return data), while the root call is never cut. A tracer bump that changes FIRE output then fails here first.
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
#[cfg(test)].Mapper unit tests (
crates/firehose/src/mapper.rs)The tests cover
u64_to_trimmed_bytes,to_block_data(header fields, withdrawals, uncles),signed_tx_to_tx_event(legacy, EIP-1559, EIP-2930 with an access list),receipt_data_from_parts,to_receipt_data,finalized_ref_from_num_hashandto_genesis_alloc. Until now, these functions had coverage only through the prestate goldens, which show a wrong field as an opaque protobuf diff.Tracer-behavior tests (
crates/firehose/src/inspector/tests/call_data.rs)Two inspector tests pin firehose-tracer rules end to end through the reth inspector:
The tracer owns these rules. A tracer bump that changes this part of the FIRE output then fails here first, before downstream consumers see it.
Evidence
All 12 new tests pass on
release/reth-2.x, because they test existing behavior. To show that they can fail, I ran negative controls:max_fee_per_gasmapped asmax_fee_per_gas + 1:signed_tx_to_tx_event_eip1559fails.keccak_preimage_is_kept_only_when_it_explains_a_written_slotfails.call_input_and_return_data_are_truncated_past_the_per_tx_limitsfails.All
reth-firehosetests pass (96).cargo +nightly fmt --checkis clean.cargo clippy -p reth-firehose --all-targets -- -D warningsfails onrelease/reth-2.xalready, on lines this PR does not touch (doc_markdown,missing_const_for_fn,use_self,if_then_some_else_none,clone_on_copy). With those lints allowed, clippy is clean.