mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-24 11:58:11 +00:00
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 <fjl@twurst.com>
This commit is contained in:
parent
4997a248ab
commit
6762006383
1 changed files with 1 additions and 4 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue