Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

Commit 9489853

Browse files
authored
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 ad11691 commit 9489853

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
@@ -621,8 +621,9 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
621621
if err != nil {
622622
return ErrInvalidSender
623623
}
624-
// Drop non-local transactions under our own minimal accepted gas price or tip
625-
if !local && tx.GasTipCapIntCmp(pool.gasPrice) < 0 {
624+
// Drop non-local transactions under our own minimal accepted gas price or tip.
625+
pendingBaseFee := pool.priced.urgent.baseFee
626+
if !local && tx.EffectiveGasTipIntCmp(pool.gasPrice, pendingBaseFee) < 0 {
626627
return ErrUnderpriced
627628
}
628629
// Ensure the transaction adheres to nonce ordering

0 commit comments

Comments
 (0)