Skip to content

fix(firehose): emit the built block access list when a block has no sidecar - #99

Merged
UlysseCorbeil merged 2 commits into
streamingfast:release/reth-2.xfrom
valvecitydev:sf/bal-without-sidecar
Nov 13, 2026
Merged

UlysseCorbeil merged 2 commits into
streamingfast:release/reth-2.xfrom
valvecitydev:sf/bal-without-sidecar

Conversation

@valvecitydev

@valvecitydev valvecitydev commented Nov 12, 2026 •

Copy link
Copy Markdown

On the live path, the Firehose header gets block_access_list_rlp from the payload's BAL sidecar. A block that the engine downloads from a peer (BlockOrPayload::Block) can carry a block_access_list_hash and no sidecar. For that block the Firehose header keeps the hash and has no RLP, although the node built the list and checked it against the header.

This PR falls back to the RLP of the built list when there is no sidecar. The traced serial path enables the BAL builder whenever the block declares a BAL hash (has_block_access_list), so the built list exists for such a block. The new firehose_bal_rlp helper picks the bytes, and the payload validator calls it only while the tracer is active, before validate_post_execution consumes the built list. validate_post_execution checks the built list against the header hash before the Firehose flush, so the emitted bytes always match the header. The sidecar still wins when the block has one, so payload blocks emit exactly the same bytes as before.

Tests

Unit tests in payload_validator.rs cover the three cases: the sidecar wins over the built list, the built list is used without a sidecar, and nothing is emitted without either.

Fail before, pass after. The helper does not exist on release/reth-2.x, so the tests do not compile there. As a negative control, I changed the helper to the old behavior (sidecar only). Then firehose_bal_rlp_uses_the_built_list_without_a_sidecar fails and the other two pass. With this PR, all three pass.

tests/firehose_live_tracing_bal_without_sidecar.rs covers the downloaded block end to end. With the tracer on, the node downloads an Amsterdam block from a peer that serves no BAL. The test checks that the emitted header carries the RLP of the built BAL, and that this RLP hashes to the header's block_access_list_hash. With the payload_validator.rs changes reverted, it fails with emitted no BAL RLP. With them, it passes.

Notes

cargo clippy -p reth-engine-tree --all-targets -- -D warnings fails on release/reth-2.x already, on lines this PR does not touch: type_repetition_in_bounds (payload_validator.rs, the Evm: FirehoseLiveHooks bounds), needless_pass_by_ref_mut (payload_validator.rs), unused_mut (crates/rpc/rpc/src/debug.rs:1604), and the reth-firehose lints. With those allowed, clippy is clean. cargo +nightly fmt also wants to reformat crates/engine/tree/src/tree/payload_processor/bal/firehose.rs on release/reth-2.x. This PR leaves that file alone.

On the live path, the Firehose header gets block_access_list_rlp from
the payload's BAL sidecar. A block the engine downloads can carry a
block_access_list_hash and no sidecar. Its Firehose header then kept
the hash and had no RLP, although the node built the list and checked
it against the header.

The header now falls back to the RLP of the built list when there is
no sidecar. validate_post_execution checks the built list against the
header hash before the Firehose flush, so the emitted bytes match the
header. The sidecar still wins when the block has one.

// Firehose live path: the EIP-7928 block access list RLP for the emitted header, taken
// before `validate_post_execution` consumes the built list.
let fh_bal_rlp = fh_tracer

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests only cover firehose_bal_rlp, not this line.

Add a test that has the node download a block from a peer that serves no BAL, with the tracer on, and checks that the emitted header has the BAL bytes.

That's the case this PR fixes, and the test should fail without it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 8ad0429: crates/engine/tree/tests/firehose_live_tracing_bal_without_sidecar.rs. With the tracer on, the node downloads an Amsterdam block from a peer that serves no BAL. The test checks that the emitted header carries the BAL RLP and that it hashes to the header's block_access_list_hash. With the payload_validator.rs changes reverted, it fails with emitted no BAL RLP. With them, it passes.

…decar

Review on paradigmxyz#99: the node downloads an Amsterdam block from a peer that serves
no BAL, with the tracer on. The test checks that the emitted header carries
the RLP of the BAL the node built, and that it hashes to the header's
block_access_list_hash. It fails without the fix with "emitted no BAL RLP".
@UlysseCorbeil
UlysseCorbeil merged commit 052ddc5 into streamingfast:release/reth-2.x Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants