From 44738ce0832500056a2b453ab104899bacad65f6 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:45:48 -0500 Subject: [PATCH 1/2] fix: use replacement transaction hash in PoolError --- crates/transaction-pool/src/pool/txpool.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/transaction-pool/src/pool/txpool.rs b/crates/transaction-pool/src/pool/txpool.rs index c43868d36e49..7d420b71efb1 100644 --- a/crates/transaction-pool/src/pool/txpool.rs +++ b/crates/transaction-pool/src/pool/txpool.rs @@ -546,9 +546,10 @@ impl TxPool { // Update invalid transactions metric self.metrics.invalid_transactions.increment(1); match err { - InsertErr::Underpriced { existing, transaction: _ } => { - Err(PoolError::new(existing, PoolErrorKind::ReplacementUnderpriced)) - } + InsertErr::Underpriced { existing: _, transaction } => Err(PoolError::new( + *transaction.hash(), + PoolErrorKind::ReplacementUnderpriced, + )), InsertErr::FeeCapBelowMinimumProtocolFeeCap { transaction, fee_cap } => { Err(PoolError::new( *transaction.hash(), From bbc95b7b187c7c3004ee7c0b342397261f726979 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Thu, 29 Feb 2024 16:53:09 -0500 Subject: [PATCH 2/2] make clippy happy --- crates/transaction-pool/src/pool/txpool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/transaction-pool/src/pool/txpool.rs b/crates/transaction-pool/src/pool/txpool.rs index 7d420b71efb1..a90aa35717a6 100644 --- a/crates/transaction-pool/src/pool/txpool.rs +++ b/crates/transaction-pool/src/pool/txpool.rs @@ -1726,8 +1726,8 @@ pub(crate) type InsertResult = Result, InsertErr>; pub(crate) enum InsertErr { /// Attempted to replace existing transaction, but was underpriced Underpriced { - #[allow(dead_code)] transaction: Arc>, + #[allow(dead_code)] existing: TxHash, }, /// Attempted to insert a blob transaction with a nonce gap