eth/catalyst: fix build and simplify maxPeriod calc

This commit is contained in:
Jared Wasinger 2025-03-19 15:01:05 +01:00
parent 2d1e7d47b8
commit 862ae42b6e
2 changed files with 2 additions and 1 deletions

1
core/era_backend.go Normal file
View file

@ -0,0 +1 @@
package core

View file

@ -127,7 +127,7 @@ func NewSimulatedBeacon(period uint64, feeRecipient common.Address, eth *eth.Eth
}
// cap the dev mode period to a reasonable maximum value to avoid overflowing the time.Duration (int64) that it will occupy
maxPeriod := uint64(math.Floor(math.MaxInt64 / time.Second))
maxPeriod := uint64(math.MaxInt64 / time.Second)
if period > maxPeriod {
log.Warn(fmt.Sprintf("period exceeds maximum possible value (have: %d, max: %d). Sanitizing period to maximum possible value.", period, maxPeriod))
period = maxPeriod