From c0210061c8a52c8f23e7cf8a9ac338ef1e5d02b5 Mon Sep 17 00:00:00 2001 From: philip-morlier Date: Tue, 17 Oct 2023 15:00:09 -0700 Subject: [PATCH] Expanded is1559() further into core/state_transition.go --- core/state_transition.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index cb9287a82..d8d325c0a 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -290,7 +290,9 @@ func (st *StateTransition) preCheck() error { } // Make sure that transaction gasFeeCap is greater than the baseFee (post london) - if st.evm.ChainConfig().IsLondon(st.evm.Context.BlockNumber) { + // begin PluGeth injection + if st.evm.ChainConfig().Is1559(st.evm.Context.BlockNumber) { + // end PluGeth injection // Skip the checks if gas fields are zero and baseFee was explicitly disabled (eth_call) if !st.evm.Config.NoBaseFee || msg.GasFeeCap.BitLen() > 0 || msg.GasTipCap.BitLen() > 0 { if l := msg.GasFeeCap.BitLen(); l > 256 { @@ -433,7 +435,11 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) { } effectiveTip := msg.GasPrice if rules.IsLondon { - effectiveTip = cmath.BigMin(msg.GasTipCap, new(big.Int).Sub(msg.GasFeeCap, st.evm.Context.BaseFee)) + // begin PluGeth injection + if st.evm.ChainConfig().Is1559(st.evm.Context.BlockNumber) { + // end PluGeth injection + effectiveTip = cmath.BigMin(msg.GasTipCap, new(big.Int).Sub(msg.GasFeeCap, st.evm.Context.BaseFee)) + } } if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {