chore: refactor to use builtin max/min (#15817)

* passed the tests with inbuilt max func

* tested min changes

* fix bazel files

* added changelog
This commit is contained in:
Sahil Sojitra
2025-10-08 00:32:47 +05:30
committed by GitHub
parent 537f3cb863
commit 9805e90d73
26 changed files with 26 additions and 139 deletions

View File

@@ -46,7 +46,6 @@ go_library(
"//crypto/hash:go_default_library",
"//crypto/rand:go_default_library",
"//encoding/bytesutil:go_default_library",
"//math:go_default_library",
"//monitoring/tracing:go_default_library",
"//monitoring/tracing/trace:go_default_library",
"//network/httputil:go_default_library",

View File

@@ -4,7 +4,6 @@ import (
"context"
"time"
"github.com/OffchainLabs/prysm/v6/math"
"github.com/OffchainLabs/prysm/v6/monitoring/tracing"
"github.com/OffchainLabs/prysm/v6/monitoring/tracing/trace"
"github.com/OffchainLabs/prysm/v6/time/slots"
@@ -65,7 +64,7 @@ func (v *validator) retryWaitForActivation(ctx context.Context, span octrace.Spa
attempts := activationAttempts(ctx)
log.WithError(err).WithField("attempts", attempts).Error(message)
// Reconnection attempt backoff, up to 60s.
time.Sleep(time.Second * time.Duration(math.Min(uint64(attempts), 60)))
time.Sleep(time.Second * time.Duration(min(uint64(attempts), 60)))
// TODO: refactor this to use the health tracker instead for reattempt
return v.WaitForActivation(incrementRetries(ctx))
}