From 5decae1d9be435ef24511ee0037778d2dca60f28 Mon Sep 17 00:00:00 2001 From: Shanin Roman <40040452+Erigara@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:29:27 +0300 Subject: [PATCH] fix(sumeragi): remove expired transaction from cache (#4922) Signed-off-by: Shanin Roman --- core/src/gossiper.rs | 6 +++--- core/src/sumeragi/main_loop.rs | 2 +- core/src/tx.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/gossiper.rs b/core/src/gossiper.rs index b1315631e6d..247d9b717d5 100644 --- a/core/src/gossiper.rs +++ b/core/src/gossiper.rs @@ -122,16 +122,16 @@ impl TransactionGossiper { tx, err: crate::queue::Error::InBlockchain, }) => { - iroha_logger::debug!(tx_payload_hash = %tx.as_ref().hash(), "Transaction already in blockchain, ignoring...") + iroha_logger::debug!(tx = %tx.as_ref().hash(), "Transaction already in blockchain, ignoring...") } Err(crate::queue::Failure { tx, err: crate::queue::Error::IsInQueue, }) => { - iroha_logger::trace!(tx_payload_hash = %tx.as_ref().hash(), "Transaction already in the queue, ignoring...") + iroha_logger::trace!(tx = %tx.as_ref().hash(), "Transaction already in the queue, ignoring...") } Err(crate::queue::Failure { tx, err }) => { - iroha_logger::error!(?err, tx_payload_hash = %tx.as_ref().hash(), "Failed to enqueue transaction.") + iroha_logger::error!(?err, tx = %tx.as_ref().hash(), "Failed to enqueue transaction.") } }, Err(err) => iroha_logger::error!(%err, "Transaction rejected"), diff --git a/core/src/sumeragi/main_loop.rs b/core/src/sumeragi/main_loop.rs index 9f5d31c6b19..856dcb969d0 100644 --- a/core/src/sumeragi/main_loop.rs +++ b/core/src/sumeragi/main_loop.rs @@ -1032,7 +1032,7 @@ pub(crate) fn run( if expired { debug!(tx=%tx.as_ref().hash(), "Transaction expired") } - expired + !expired }); sumeragi.queue.get_transactions_for_block( diff --git a/core/src/tx.rs b/core/src/tx.rs index df83e850b4a..c3b2c5c1c10 100644 --- a/core/src/tx.rs +++ b/core/src/tx.rs @@ -226,7 +226,7 @@ impl StateBlock<'_> { )); } - debug!("Validating transaction: {:?}", tx); + debug!(tx=%tx.as_ref().hash(), "Validating transaction"); Self::validate_with_runtime_executor(tx.clone(), state_transaction)?; if let (authority, Executable::Wasm(bytes)) = tx.into() {