Skip to content

Commit

Permalink
fix(sumeragi): remove expired transaction from cache (#4922)
Browse files Browse the repository at this point in the history
Signed-off-by: Shanin Roman <[email protected]>
  • Loading branch information
Erigara authored Jul 31, 2024
1 parent 26c8323 commit a62640d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/src/gossiper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,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"),
Expand Down
2 changes: 1 addition & 1 deletion core/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl Queue {
/// # Errors
/// See [`enum@Error`]
pub fn push(&self, tx: AcceptedTransaction, state_view: &StateView) -> Result<(), Failure> {
trace!(?tx, "Pushing to the queue");
trace!(tx=%tx.as_ref().hash(), "Pushing to the queue");
if let Err(err) = self.check_tx(&tx, state_view) {
return Err(Failure { tx, err });
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/sumeragi/main_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,9 +1024,9 @@ pub(crate) fn run(
.retain(|tx| {
let expired = sumeragi.queue.is_expired(tx);
if expired {
debug!(?tx, "Transaction expired")
debug!(tx=%tx.as_ref().hash(), "Transaction expired")
}
expired
!expired
});

sumeragi.queue.get_transactions_for_block(
Expand Down
2 changes: 1 addition & 1 deletion core/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl TransactionExecutor {
));
}

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() {
Expand Down

0 comments on commit a62640d

Please sign in to comment.