From 9fd5782120bb808a2fa5b7bf3aaa065396b17b80 Mon Sep 17 00:00:00 2001 From: bear Date: Fri, 28 Jul 2023 19:04:17 +0800 Subject: [PATCH] Fix refund base fee (#1118) (#1120) Co-authored-by: tgmichel --- frame/evm/src/runner/stack.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frame/evm/src/runner/stack.rs b/frame/evm/src/runner/stack.rs index 071b569732222..7af212593aa01 100644 --- a/frame/evm/src/runner/stack.rs +++ b/frame/evm/src/runner/stack.rs @@ -261,15 +261,20 @@ where _ => used_gas.into(), }; let actual_fee = effective_gas.saturating_mul(total_fee_per_gas); + let actual_base_fee = effective_gas.saturating_mul(base_fee); log::debug!( target: "evm", - "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, is_transactional: {}]", + "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}]", reason, source, value, gas_limit, actual_fee, + used_gas, + effective_gas, + base_fee, + total_fee_per_gas, is_transactional ); // The difference between initially withdrawn and the actual cost is refunded. @@ -298,7 +303,7 @@ where // Actual fee after evm execution, including tip. actual_fee, // Base fee. - executor.fee(base_fee), + actual_base_fee, // Fee initially withdrawn. fee, );