Allow replacement txs with exactly price bump (#13161)

This commit is contained in:
Ahmet Yazıcı
2024-12-05 19:24:28 +01:00
committed by GitHub
parent 56624f820f
commit 4fe5c2a577

View File

@ -405,8 +405,7 @@ impl<T: PoolTransaction> ValidPoolTransaction<T> {
let price_bump = price_bumps.price_bump(self.tx_type());
// Check if the max fee per gas is underpriced.
if maybe_replacement.max_fee_per_gas() <= self.max_fee_per_gas() * (100 + price_bump) / 100
{
if maybe_replacement.max_fee_per_gas() < self.max_fee_per_gas() * (100 + price_bump) / 100 {
return true
}
@ -418,7 +417,7 @@ impl<T: PoolTransaction> ValidPoolTransaction<T> {
// Check max priority fee per gas (relevant for EIP-1559 transactions only)
if existing_max_priority_fee_per_gas != 0 &&
replacement_max_priority_fee_per_gas != 0 &&
replacement_max_priority_fee_per_gas <=
replacement_max_priority_fee_per_gas <
existing_max_priority_fee_per_gas * (100 + price_bump) / 100
{
return true
@ -429,7 +428,7 @@ impl<T: PoolTransaction> ValidPoolTransaction<T> {
// This enforces that blob txs can only be replaced by blob txs
let replacement_max_blob_fee_per_gas =
maybe_replacement.transaction.max_fee_per_blob_gas().unwrap_or_default();
if replacement_max_blob_fee_per_gas <=
if replacement_max_blob_fee_per_gas <
existing_max_blob_fee_per_gas * (100 + price_bump) / 100
{
return true