From 399c5747e1a9acffddc0bc017b4cbdb635e82d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Grze=C5=9Bkiewicz?= Date: Thu, 11 Jul 2024 12:07:46 +0200 Subject: [PATCH] feat(eth-sender): add early return in sending new transactions to not spam logs with errors (#2425) Signed-off-by: tomg10 --- core/node/eth_sender/src/eth_tx_manager.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/node/eth_sender/src/eth_tx_manager.rs b/core/node/eth_sender/src/eth_tx_manager.rs index 7e69a23c16ff..feac9311a727 100644 --- a/core/node/eth_sender/src/eth_tx_manager.rs +++ b/core/node/eth_sender/src/eth_tx_manager.rs @@ -586,8 +586,19 @@ impl EthTxManager { .await .unwrap(); + tracing::info!( + "Sending {} {operator_type:?} new transactions", + new_eth_tx.len() + ); for tx in new_eth_tx { - let _ = self.send_eth_tx(storage, &tx, 0, current_block).await; + let result = self.send_eth_tx(storage, &tx, 0, current_block).await; + // If one of the transactions doesn't succeed, this means we should return + // as new transactions have increasing nonces, so they will also result in an error + // about gapped nonces + if result.is_err() { + tracing::info!("Skipping sending rest of new transactions because of error"); + break; + } } } }