core: bug fix (fixed issue where we send the tip twice)

This commit is contained in:
Pratik Patil 2025-05-14 08:01:25 +05:30
parent 8bd8b33fcb
commit d5d106344f
No known key found for this signature in database
GPG key ID: AFDCA496554874B3
2 changed files with 0 additions and 19 deletions

View file

@ -20,7 +20,6 @@ import (
"bytes"
"context"
"errors"
"fmt"
"math/big"
"math/rand"
"reflect"
@ -102,8 +101,6 @@ func TestSimulatedBackend(t *testing.T) {
if isPending {
t.Fatal("transaction should not have pending status")
}
fmt.Println("PSP - here")
}
var testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")

View file

@ -574,22 +574,6 @@ func (st *stateTransition) execute(interruptCtx context.Context) (*ExecutionResu
effectiveTip = msg.GasTipCap
}
}
effectiveTipU256, _ := uint256.FromBig(effectiveTip)
if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {
// Skip fee payment when NoBaseFee is set and the fee fields
// are 0. This avoids a negative effectiveTip being applied to
// the coinbase when simulating calls.
} else {
fee := new(uint256.Int).SetUint64(st.gasUsed())
fee.Mul(fee, effectiveTipU256)
st.state.AddBalance(st.evm.Context.Coinbase, fee, tracing.BalanceIncreaseRewardTransactionFee)
// add the coinbase to the witness iff the fee is greater than 0
if rules.IsEIP4762 && fee.Sign() != 0 {
st.evm.AccessEvents.AddAccount(st.evm.Context.Coinbase, true)
}
}
// TODO(raneet10): Double check. We might want to inculcate this fix in a separate condition
// if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {