Skip to content

Commit

Permalink
Allow replacement txs with exactly price bump (paradigmxyz#13161)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaziciahmet authored Dec 5, 2024
1 parent 56624f8 commit 4fe5c2a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/transaction-pool/src/validate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4fe5c2a

Please sign in to comment.