Skip to content

Commit 61b606a

Browse files
committed
Restore nuclear option
1 parent 4705e18 commit 61b606a

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

crates/batcher/src/lib.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,12 +1952,23 @@ impl Batcher {
19521952

19531953
// If batch finalization failed, restore the proofs to the queue
19541954
if let Err(e) = batch_finalization_result {
1955-
error!(
1956-
"Batch finalization failed, restoring proofs to queue: {:?}",
1957-
e
1958-
);
1959-
self.restore_proofs_after_batch_failure(&finalized_batch)
1960-
.await;
1955+
error!("Batch finalization failed: {:?}", e);
1956+
1957+
// Don't restore proofs for insufficient balance errors - the queue was already flushed
1958+
match &e {
1959+
BatcherError::TransactionSendError(
1960+
TransactionSendError::SubmissionInsufficientBalance(_),
1961+
) => {
1962+
info!(
1963+
"Queue was flushed due to insufficient balance - not restoring proofs"
1964+
);
1965+
}
1966+
_ => {
1967+
info!("Restoring proofs to queue after batch failure");
1968+
self.restore_proofs_after_batch_failure(&finalized_batch)
1969+
.await;
1970+
}
1971+
}
19611972
return Err(e);
19621973
}
19631974
}

0 commit comments

Comments
 (0)