From 0eb8ecd061cf59df93080f9b32e2afdabddfd8cc Mon Sep 17 00:00:00 2001 From: sprites0 <199826320+sprites0@users.noreply.github.com> Date: Sun, 22 Jun 2025 14:53:27 -0400 Subject: [PATCH] fix: Exclude system tx from gas_used, expose is_system_transaction --- src/node/evm/executor.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/evm/executor.rs b/src/node/evm/executor.rs index 74c518459..24b6137d0 100644 --- a/src/node/evm/executor.rs +++ b/src/node/evm/executor.rs @@ -22,7 +22,7 @@ use revm::{ DatabaseCommit, }; -fn is_system_transaction(tx: &TransactionSigned) -> bool { +pub fn is_system_transaction(tx: &TransactionSigned) -> bool { let Some(gas_price) = tx.gas_price() else { return false; }; @@ -143,7 +143,9 @@ where let ResultAndState { result, mut state } = result_and_state; f(&result); let gas_used = result.gas_used(); - self.gas_used += gas_used; + if !is_system_transaction(tx.tx()) { + self.gas_used += gas_used; + } self.receipts .push(self.receipt_builder.build_receipt(ReceiptBuilderCtx { tx: tx.tx(),