Skip to content

Commit ba5f552

Browse files
fjljagdeep sidhu
authored andcommitted
core: check effective tip in txpool pricelimit validation (ethereum#23855)
The price limit is supposed to exclude transactions with too low fee amount. Before EIP-1559, it was sufficient to check the limit against the gas price of the transaction. After 1559, it is more complicated because the concept of 'transaction gas price' does not really exist. When mining, the price limit is used to exclude transactions below a certain effective fee amount. This change makes it apply the same check earlier, in tx validation. Transactions below the specified fee amount cannot enter the pool. Fixes ethereum#23837
1 parent 8352429 commit ba5f552

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/tx_pool.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,9 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
627627
if err != nil {
628628
return ErrInvalidSender
629629
}
630-
// Drop non-local transactions under our own minimal accepted gas price or tip
631-
if !local && tx.GasTipCapIntCmp(pool.gasPrice) < 0 {
630+
// Drop non-local transactions under our own minimal accepted gas price or tip.
631+
pendingBaseFee := pool.priced.urgent.baseFee
632+
if !local && tx.EffectiveGasTipIntCmp(pool.gasPrice, pendingBaseFee) < 0 {
632633
return ErrUnderpriced
633634
}
634635
// Ensure the transaction adheres to nonce ordering

0 commit comments

Comments
 (0)