From 676200638360275f18a5025f6124ff78e1707521 Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Thu, 19 Jun 2025 17:43:24 +0800 Subject: [PATCH] core: simplify effectiveTip calculation (#31771) Since we have the effective gas price in the message, we can compute tip by simply subtracting the basefee. No need to recompute the effective price. --------- Co-authored-by: Felix Lange --- core/state_transition.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 4f172682d0..3ec718c52c 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -534,10 +534,7 @@ func (st *stateTransition) execute() (*ExecutionResult, error) { effectiveTip := msg.GasPrice if rules.IsLondon { - effectiveTip = new(big.Int).Sub(msg.GasFeeCap, st.evm.Context.BaseFee) - if effectiveTip.Cmp(msg.GasTipCap) > 0 { - effectiveTip = msg.GasTipCap - } + effectiveTip = new(big.Int).Sub(msg.GasPrice, st.evm.Context.BaseFee) } effectiveTipU256, _ := uint256.FromBig(effectiveTip)