mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
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:
@@ -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",
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user