From 3dada2e7167bd7707e16080d5c996d5e28dfc215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Fri, 16 Oct 2026 12:19:55 -0400 Subject: [PATCH 1/3] Name the transaction when its type cannot be traced The node still stops: dropping the transaction would emit a block that differs from the chain, and failing execution would reject a valid block. --- crates/firehose/src/mapper.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/firehose/src/mapper.rs b/crates/firehose/src/mapper.rs index 3a5f8f3856c..2efa49c0fd1 100644 --- a/crates/firehose/src/mapper.rs +++ b/crates/firehose/src/mapper.rs @@ -220,11 +220,20 @@ pub fn signed_tx_to_tx_event( where Tx: alloy_consensus::Transaction + TxHashRef, { + // A transaction the block model cannot represent must stop the node: dropping it would emit + // a block that differs from the chain, and failing block execution would make the node + // reject a valid block. + let tx_type = tx.ty().try_into().unwrap_or_else(|_| { + panic!( + "Firehose cannot trace transaction {} of type {:#x}: the block model has no such \ + transaction type, so this node cannot emit this block", + tx.tx_hash(), + tx.ty() + ) + }); + TxEvent { - // FIXME: That is not true, what about Optimism specialized transaction types? We might - // to have a special mapper that knows the chain and as such is aware of some types - // that could not exists anywhere else. We will need to deal with this. - tx_type: tx.ty().try_into().expect("All transaction types handled for now"), + tx_type, hash: *tx.tx_hash(), from: signer, to: tx.to(), From 2a66ed4cad188580a567fb509ea339800e11d53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Mon, 9 Nov 2026 21:53:31 -0500 Subject: [PATCH 2/3] Trace Optimism post-exec transactions firehose-tracer 5.5.1 adds the post-exec transaction type (0x7d), so the mapper no longer stops the node on it. --- Cargo.toml | 2 +- crates/firehose/src/mapper.rs | 98 +++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 0fad62c100b..93dff4ed92d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -665,7 +665,7 @@ vergen-git2 = "10.0.1" ipnet = "2.11" ## Firehose Additions -firehose-tracer = "5.5.0" +firehose-tracer = "5.5.1" reth-firehose = { path = "crates/firehose" } reth-firehose-tests = { path = "crates/firehose-tests" } diff --git a/crates/firehose/src/mapper.rs b/crates/firehose/src/mapper.rs index 2efa49c0fd1..8702e62c3df 100644 --- a/crates/firehose/src/mapper.rs +++ b/crates/firehose/src/mapper.rs @@ -383,3 +383,101 @@ fn map_signed_authorization( s: B256::new(auth.s().to_be_bytes::<32>()), } } + +#[cfg(test)] +mod tests { + use super::*; + use alloy_consensus::{transaction::TxHashRef, Transaction, Typed2718}; + use alloy_eips::{eip2930::AccessList, eip7702::SignedAuthorization}; + use alloy_primitives::{ChainId, TxKind}; + use firehose_tracer::types::TxType; + + /// An unsigned transaction with the OP Stack post-exec type byte (0x7d), shaped like + /// `op_alloy_consensus::TxPostExec`: no gas, no value, the payload as input. + #[derive(Debug)] + struct PostExecTx { + hash: B256, + input: Bytes, + } + + impl Typed2718 for PostExecTx { + fn ty(&self) -> u8 { + 0x7d + } + } + + impl TxHashRef for PostExecTx { + fn tx_hash(&self) -> &B256 { + &self.hash + } + } + + impl Transaction for PostExecTx { + fn chain_id(&self) -> Option { + None + } + fn nonce(&self) -> u64 { + 0 + } + fn gas_limit(&self) -> u64 { + 0 + } + fn gas_price(&self) -> Option { + None + } + fn max_fee_per_gas(&self) -> u128 { + 0 + } + fn max_priority_fee_per_gas(&self) -> Option { + None + } + fn max_fee_per_blob_gas(&self) -> Option { + None + } + fn priority_fee_or_price(&self) -> u128 { + 0 + } + fn effective_gas_price(&self, _: Option) -> u128 { + 0 + } + fn is_dynamic_fee(&self) -> bool { + false + } + fn kind(&self) -> TxKind { + TxKind::Call(Address::ZERO) + } + fn is_create(&self) -> bool { + false + } + fn value(&self) -> U256 { + U256::ZERO + } + fn input(&self) -> &Bytes { + &self.input + } + fn access_list(&self) -> Option<&AccessList> { + None + } + fn blob_versioned_hashes(&self) -> Option<&[B256]> { + None + } + fn authorization_list(&self) -> Option<&[SignedAuthorization]> { + None + } + } + + #[test] + fn maps_optimism_post_exec_transaction() { + let tx = PostExecTx { hash: B256::repeat_byte(0x7d), input: Bytes::from_static(&[0xc0]) }; + + let event = + signed_tx_to_tx_event(&tx, Address::ZERO, 3, B256::ZERO, B256::ZERO, Bytes::new()); + + assert_eq!(event.tx_type, TxType::OptimismPostExec); + assert_eq!(event.hash, tx.hash); + assert_eq!(event.from, Address::ZERO); + assert_eq!(event.input, tx.input); + assert_eq!(event.gas, 0); + assert_eq!(event.index, 3); + } +} From b2bcd0b9c3b018688814b23fa9ecd353dea22354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ste=CC=81phane=20Duchesneau?= Date: Tue, 10 Nov 2026 15:58:43 -0500 Subject: [PATCH 3/3] Lock firehose-tracer 5.5.1 and add changelog entry --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae8e8955f5b..78469e52487 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ This changelog covers Firehose-specific changes only. For upstream reth changes, The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## world-chain-v2.8.1-fh3.1-1 + +### Fixed + +- Optimism post-exec transactions (type `0x7d`, activated by the OP Stack Lagoon upgrade) are + traced as `TRX_TYPE_OPTIMISM_POST_EXEC` instead of stopping the node. `firehose-tracer` moves + to 5.5.1. + ## world-chain-v2.8.1-fh3.1 ### Changed diff --git a/Cargo.lock b/Cargo.lock index bff9aa92b9e..7b0b4dbdc3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4036,9 +4036,9 @@ checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" [[package]] name = "firehose-tracer" -version = "5.5.0" +version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53eb86c6d17bd4e5517e46f56498d33d128d0641d78d15b86cf2c0605c814ee" +checksum = "60329ed1f8cb98a459733b8f756f1787629234a1b3be8025768397ce836690b9" dependencies = [ "alloy-consensus", "alloy-eips",