Skip to content

Commit f736abe

Browse files
committed
nits(core): saturate delay overflow
Signed-off-by: AvhiMaz <avhimazumder5@outlook.com>
1 parent 06e8141 commit f736abe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/core/src/runloops

crates/core/src/runloops/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ pub async fn start_block_production_runloop(
496496
// Apply random execution delay to simulate out-of-order processing
497497
if let Some(max_delay_ms) = transaction_execution_delay_ms {
498498
if max_delay_ms > 0 {
499-
let delay = rand::random::<u64>() % (max_delay_ms + 1);
499+
let delay = rand::random::<u64>() % max_delay_ms.saturating_add(1);
500500
tokio::time::sleep(std::time::Duration::from_millis(delay)).await;
501501
}
502502
}

0 commit comments

Comments
 (0)