diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index 39e49d6cde..0bb4287a5b 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -249,6 +249,14 @@ macro_rules! impl_runtime_apis_plus_common { for ext in extrinsics.into_iter() { match &ext.0.function { RuntimeCall::Ethereum(transact { transaction }) => { + + // Reset the previously consumed weight when tracing multiple transactions. + // This is necessary because EVM tracing introduces additional + // (ref_time) overhead, which differs from the production runtime behavior. + // Without resetting the block weight, the extra tracing overhead could + // leading to some transactions to incorrectly fail during tracing. + frame_system::BlockWeight::::kill(); + let tx_hash = &transaction.hash(); if known_transactions.contains(&tx_hash) { // Each known extrinsic is a new call stack.