From f2d970924d9c3a7f4ea6cff067bb589ce8b991a5 Mon Sep 17 00:00:00 2001 From: Dzejkop Date: Mon, 12 Feb 2024 13:06:17 +0100 Subject: [PATCH] Remove transaction simulation --- src/tasks/broadcast.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/tasks/broadcast.rs b/src/tasks/broadcast.rs index 673c02f..3e6664b 100644 --- a/src/tasks/broadcast.rs +++ b/src/tasks/broadcast.rs @@ -109,33 +109,14 @@ async fn broadcast_relayer_txs( .fill_transaction(&mut typed_transaction, None) .await?; - tracing::debug!(tx_id = tx.id, "Simulating transaction"); - - // Simulate the transaction - match middleware.call(&typed_transaction, None).await { - Ok(_) => { - tracing::info!( - tx_id = tx.id, - "Transaction simulated successfully" - ); - } - Err(err) => { - tracing::error!(tx_id = tx.id, error = ?err, "Failed to simulate transaction"); - - // If we fail while broadcasting a tx with nonce `n`, - // it doesn't make sense to broadcast tx with nonce `n + 1` - return Ok(()); - } - }; - // Get the raw signed tx and derive the tx hash let raw_signed_tx = middleware .signer() .raw_signed_tx(&typed_transaction) .await?; - let tx_hash = H256::from(ethers::utils::keccak256(&raw_signed_tx)); + tracing::debug!(tx_id = tx.id, "Saving transaction"); app.db .insert_tx_broadcast( &tx.id,