From e0d81d1e993ad6dc3e618cd06e56b7be916efd8e Mon Sep 17 00:00:00 2001 From: maradini77 <140460067+maradini77@users.noreply.github.com> Date: Tue, 18 Nov 2025 18:54:53 +0100 Subject: [PATCH] eth: fix panic in randomDuration when min equals max (#33193) Fixes a potential panic in `randomDuration` when `min == max` by handling the edge case explicitly. --- eth/dropper.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/dropper.go b/eth/dropper.go index 51f2a7a95a..dada5d07c0 100644 --- a/eth/dropper.go +++ b/eth/dropper.go @@ -145,6 +145,9 @@ func randomDuration(min, max time.Duration) time.Duration { if min > max { panic("min duration must be less than or equal to max duration") } + if min == max { + return min + } return time.Duration(mrand.Int63n(int64(max-min)) + int64(min)) }