From c2528ce223008d0d6adc84f3654029f4e6c7215a Mon Sep 17 00:00:00 2001 From: sprites0 <199826320+sprites0@users.noreply.github.com> Date: Sun, 26 Oct 2025 06:41:27 +0000 Subject: [PATCH] fix: Support certain types of system tx --- src/node/types/mod.rs | 13 +++++++++++++ src/node/types/reth_compat.rs | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/node/types/mod.rs b/src/node/types/mod.rs index aaf112b31..b25eac527 100644 --- a/src/node/types/mod.rs +++ b/src/node/types/mod.rs @@ -127,6 +127,19 @@ pub struct SystemTx { pub receipt: Option, } +impl SystemTx { + pub fn gas_limit(&self) -> u64 { + use reth_compat::Transaction; + match &self.tx { + Transaction::Legacy(tx) => tx.gas_limit, + Transaction::Eip2930(tx) => tx.gas_limit, + Transaction::Eip1559(tx) => tx.gas_limit, + Transaction::Eip4844(tx) => tx.gas_limit, + Transaction::Eip7702(tx) => tx.gas_limit, + } + } +} + #[derive( Debug, Clone, diff --git a/src/node/types/reth_compat.rs b/src/node/types/reth_compat.rs index 11e93a89e..27cf6b114 100644 --- a/src/node/types/reth_compat.rs +++ b/src/node/types/reth_compat.rs @@ -117,6 +117,9 @@ impl SealedBlock { receipts: Vec, chain_id: u64, ) -> HlBlock { + // NOTE: Filter out system transactions that may be rejected by the EVM (tracked by #97, testnet only). + let system_txs: Vec<_> = system_txs.into_iter().filter(|tx| tx.gas_limit() != 0).collect(); + let mut merged_txs = vec![]; merged_txs.extend(system_txs.iter().map(|tx| system_tx_to_reth_transaction(tx, chain_id))); merged_txs.extend(self.body.transactions.iter().map(|tx| tx.to_reth_transaction()));