From f1d02c86210bc24cb80480cf28cf09a1d953cca7 Mon Sep 17 00:00:00 2001 From: maximopalopoli Date: Thu, 28 Nov 2024 17:06:11 -0300 Subject: [PATCH] Don't increase balance in coinbase fee if it's 0 --- crates/vm/levm/src/vm.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/vm/levm/src/vm.rs b/crates/vm/levm/src/vm.rs index fb00a69ee..011ee9a6f 100644 --- a/crates/vm/levm/src/vm.rs +++ b/crates/vm/levm/src/vm.rs @@ -543,13 +543,9 @@ impl VM { .checked_mul(priority_fee_per_gas) .ok_or(VMError::BalanceOverflow)?; - self.increase_account_balance(coinbase_address, coinbase_fee)?; - - /* - if coinbase_fee.is_zero() { - self.cache.accounts.remove(&coinbase_address); - } - */ + if !coinbase_fee.is_zero() { + self.increase_account_balance(coinbase_address, coinbase_fee)?; + } report.new_state.clone_from(&self.cache);