Skip to content

Commit

Permalink
refactor(torii-core): ignore invalid txs that are included in the pen…
Browse files Browse the repository at this point in the history
…ding block (dojoengine#2081)

* refactor(torii-core): ignore invalid txs that are included in the pending block txs

* fmt
  • Loading branch information
Larkooo authored Jun 19, 2024
1 parent 4db8ae0 commit 30e9803
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/torii/core/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,11 @@ impl<P: Provider + Sync> Engine<P> {
Err(e) => {
match e.to_string().as_str() {
"TransactionHashNotFound" => {
warn!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction.");
// We failed to fetch the transaction, which might be due to us indexing
// the pending transaction too fast. We will
// fail silently and retry processing the transaction in the next
// iteration.
return Ok(pending_block_tx);
// 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.");
}
_ => {
error!(target: LOG_TARGET, error = %e, transaction_hash = %format!("{:#x}", transaction.transaction_hash()), "Processing pending transaction.");
Expand Down

0 comments on commit 30e9803

Please sign in to comment.