go-ethereum
go-ethereum copied to clipboard
core: effectiveTip = `GasPrice - BaseFee` instead of `GasFeeCap - BaseFee`
In buyGas, GasPrice is used to conduct the gas cost.
However when computing effectiveTip, GasFeeCap is used instead.
In theory, GasFeeCap >= GasPrice, so it may happen that the tip fee is larger than it should be.
This PR tries to reduce such confusion by computing effectiveTip by GasPrice - BaseFee instead of GasFeeCap - BaseFee.
Note that for all tx types, GasFeeCap == GasPrice always holds, so there's no problem for tx. But it's still better to make it consistent .