port `nextExchangeTransitionCfg` to LC (#4130)

Port changes to `nextExchangeTransitionConfiguration` from BN to LC:
- 60 seconds delay before initial exchange
- 45 seconds interval between followup exchanges
- Only exchange post Bellatrix
This commit is contained in:
Etan Kissling 2022-09-17 00:48:53 +02:00 committed by GitHub
parent 5677816df3
commit 31a777af74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -202,14 +202,16 @@ programMain:
blocksGossipState = targetGossipState
var nextExchangeTransitionConfTime: Moment
var nextExchangeTransitionConfTime = Moment.now + chronos.seconds(60)
proc onSecond(time: Moment) =
let wallSlot = getBeaconTime().slotOrZero()
# engine_exchangeTransitionConfigurationV1
if time > nextExchangeTransitionConfTime and eth1Monitor != nil:
nextExchangeTransitionConfTime = time + chronos.minutes(1)
traceAsyncErrors eth1Monitor.exchangeTransitionConfiguration()
nextExchangeTransitionConfTime = time + chronos.seconds(45)
if wallSlot.epoch >= cfg.BELLATRIX_FORK_EPOCH:
traceAsyncErrors eth1Monitor.exchangeTransitionConfiguration()
let wallSlot = getBeaconTime().slotOrZero()
if checkIfShouldStopAtEpoch(wallSlot, config.stopAtEpoch):
quit(0)