Skip to content

Allow configuring zero delay#1541

Merged
elopez merged 2 commits intomasterfrom
fix-gendelay-lower-bound
Mar 23, 2026
Merged

Allow configuring zero delay#1541
elopez merged 2 commits intomasterfrom
fix-gendelay-lower-bound

Conversation

@elopez
Copy link
Member

@elopez elopez commented Mar 18, 2026

No description provided.

elopez added 2 commits March 17, 2026 20:53
genDelay used getRandomR(1, maxDelay) which caused undefined behavior
when maxDelay was 0 (inverted bounds). In practice this leaked delay=1
even when the user configured maxTimeDelay or maxBlockDelay to 0.

Change the lower bound to 0, which fixes the inverted bounds issue and
also allows zero delays naturally (consecutive txs in same block/time),
consistent with how genValue already uses getRandomR(0, ...).
Test that with maxTimeDelay: 0 and maxBlockDelay: 0, block numbers
and timestamps remain consistent across transactions (no delay leaks).
@elopez elopez marked this pull request as ready for review March 20, 2026 12:37
@elopez elopez requested a review from arcz as a code owner March 20, 2026 12:37
@elopez elopez merged commit 1cc7120 into master Mar 23, 2026
17 checks passed
@elopez elopez deleted the fix-gendelay-lower-bound branch March 23, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants