Skip to content

Commit c1830ef

Browse files
authored
Add nonce stall check in EoaExecutorWorker gas bump logic (#80)
- Introduced a check to skip gas bump attempts if the transaction has not been queued long enough, enhancing transaction handling efficiency. - Added logging to warn when a transaction is skipped due to insufficient queuing time, providing better visibility into transaction states.
1 parent 4512db9 commit c1830ef

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

executors/src/eoa/worker/confirm.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,19 @@ impl<C: Chain> EoaExecutorWorker<C> {
376376
"Found newest transaction for gas bump"
377377
);
378378

379+
let time_since_queuing = EoaExecutorStore::now().saturating_sub(newest_transaction_data.created_at);
380+
381+
if time_since_queuing < NONCE_STALL_LIMIT_MS {
382+
tracing::warn!(
383+
transaction_id = ?newest_transaction_data.transaction_id,
384+
nonce = expected_nonce,
385+
time_since_queuing = time_since_queuing,
386+
stall_timeout = NONCE_STALL_LIMIT_MS,
387+
"Transaction has not been queued for long enough, skipping gas bump"
388+
);
389+
return Ok(false);
390+
}
391+
379392
// Get the latest attempt to extract gas values from
380393
// Build typed transaction -> manually bump -> sign
381394
let typed_tx = match self

0 commit comments

Comments
 (0)