From 8b3180d8a72f9c04d24df0bcfd338fade12dfb22 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Wed, 13 Dec 2023 17:51:19 +0330 Subject: [PATCH] revert gas refund --- core/state_transition.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 311bd7fda1..165fbd853e 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -470,20 +470,8 @@ func (st *StateTransition) refundGas(refundQuotient uint64) uint64 { st.gasRemaining += refund // Return ETH for remaining gas, exchanged at the original rate. - gasRemaining := new(big.Int).SetUint64(st.gasRemaining) - if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) { - // Split into burnt gas and tip gas to refund. - burnt := new(big.Int).Mul(gasRemaining, st.evm.Context.BaseFee) - // TODO: rename to unburnt - st.state.AddBalance(st.msg.From, burnt, state.BalanceChangeBurnRefund) - effectiveTip := cmath.BigMin(st.msg.GasTipCap, new(big.Int).Sub(st.msg.GasFeeCap, st.evm.Context.BaseFee)) - tip := new(big.Int).Mul(gasRemaining, effectiveTip) - st.state.AddBalance(st.msg.From, tip, state.BalanceChangeGasRefund) - } else { - remaining := new(big.Int).Mul(gasRemaining, st.msg.GasPrice) - // TODO: rename to unusedTip - st.state.AddBalance(st.msg.From, remaining, state.BalanceChangeGasRefund) - } + remaining := new(big.Int).Mul(new(big.Int).SetUint64(st.gasRemaining), st.msg.GasPrice) + st.state.AddBalance(st.msg.From, remaining, state.BalanceChangeGasRefund) if st.evm.Config.Tracer != nil && st.gasRemaining > 0 { st.evm.Config.Tracer.OnGasChange(st.gasRemaining, 0, vm.GasChangeTxLeftOverReturned)