From 3538e9c346ef7bacf62fd76874d41548a4be46ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Grze=C5=9Bkiewicz?= Date: Tue, 11 Jun 2024 14:32:34 +0200 Subject: [PATCH] fix(eth-sender): Don't resend already sent transactions in the same block (#2208) Signed-off-by: tomg10 --- core/node/eth_sender/src/eth_tx_manager.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/node/eth_sender/src/eth_tx_manager.rs b/core/node/eth_sender/src/eth_tx_manager.rs index a158889f26f7..d732c4bb27ba 100644 --- a/core/node/eth_sender/src/eth_tx_manager.rs +++ b/core/node/eth_sender/src/eth_tx_manager.rs @@ -540,9 +540,15 @@ impl EthTxManager { .eth_sender_dal() .get_block_number_on_first_sent_attempt(tx.id) .await - .unwrap() - .unwrap_or(l1_block_numbers.latest.0); - return Ok(Some((tx, first_sent_at_block))); + .unwrap(); + // the transaction may still be included in block, we shouldn't resend it yet + if first_sent_at_block == Some(l1_block_numbers.latest.0) { + continue; + } + return Ok(Some(( + tx, + first_sent_at_block.unwrap_or(l1_block_numbers.latest.0), + ))); } // If on finalized block sender's nonce was > tx.nonce,