Skip to content

Commit

Permalink
fix(torii-core): silently retry fetching pending txn until we have it (
Browse files Browse the repository at this point in the history
…#2125)

* fix(torii-core): silently retry fetching pending txn until we have it

* fmt

* chore: warn message
  • Loading branch information
Larkooo authored Jul 1, 2024
1 parent ed0c677 commit 8f5ee1d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/torii/core/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ impl<P: Provider + Sync> Engine<P> {
match e.to_string().as_str() {
"TransactionHashNotFound" => {
// We failed to fetch the transaction, which is because
// the transaction might not have passed the validation stage.
// So we can safely ignore this transaction and not process it, as it
// rejected.
warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Ignored failed pending transaction.");
// the transaction might not have been processed fast enough by the
// provider. So we can fail silently and try
// again in the next iteration.
warn!(target: LOG_TARGET, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Retrieving pending transaction receipt.");
return Ok(pending_block_tx);
}
_ => {
error!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction.");
Expand Down

0 comments on commit 8f5ee1d

Please sign in to comment.