From 8156c90ea8b9dbb96131f9548e4af231c03e11f3 Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Tue, 3 Sep 2024 11:11:22 +0200 Subject: [PATCH] rusk: change EST to not discard not ready moonlight txs --- rusk/src/lib/node/rusk.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rusk/src/lib/node/rusk.rs b/rusk/src/lib/node/rusk.rs index df65da6347..0d3495b975 100644 --- a/rusk/src/lib/node/rusk.rs +++ b/rusk/src/lib/node/rusk.rs @@ -9,6 +9,7 @@ use std::sync::{mpsc, Arc, LazyLock}; use std::time::{Duration, Instant}; use std::{fs, io}; +use execution_core::transfer::PANIC_NONCE_NOT_READY; use parking_lot::RwLock; use sha3::{Digest, Sha3_256}; use tokio::task; @@ -180,6 +181,16 @@ impl Rusk { err, }); } + Err(PiecrustError::Panic(val)) + if val == PANIC_NONCE_NOT_READY => + { + // If the transaction panic due to a not yet valid nonce, + // we should not discard the transactions since it can be + // included in future. + + // TODO: Try to process the transaction as soon as the + // nonce is unlocked + } Err(e) => { info!("discard tx {tx_id} due to {e:?}"); // An unspendable transaction should be discarded