From 0b93eeeaaf462f23634b696345ece659b17f5695 Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 15 Sep 2022 15:00:23 +0200 Subject: [PATCH] delay first exchangeTransitionConfiguration (#4114) --- beacon_chain/eth1/eth1_monitor.nim | 13 ++++++++++++- beacon_chain/nimbus_beacon_node.nim | 8 +++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index 2d9d3ecd6..c18415775 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -1539,7 +1539,9 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} = BELLATRIX_FORK_EPOCH = m.cfg.BELLATRIX_FORK_EPOCH, totalDifficulty = $nextBlock.totalDifficulty, ttd = $m.cfg.TERMINAL_TOTAL_DIFFICULTY, - terminalBlockHash = m.terminalBlockHash + terminalBlockHash = m.terminalBlockHash, + candidateBlockHash = terminalBlockCandidate.hash, + candidateBlockNumber = distinctBase(terminalBlockCandidate.number) if terminalBlockCandidate.totalDifficulty >= m.cfg.TERMINAL_TOTAL_DIFFICULTY: while not terminalBlockCandidate.parentHash.isZeroMemory: @@ -1551,6 +1553,15 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} = m.terminalBlockHash = some terminalBlockCandidate.hash m.terminalBlockNumber = some terminalBlockCandidate.number + debug "startEth1Syncing: found merge terminal block", + currentEpoch = m.currentEpoch, + BELLATRIX_FORK_EPOCH = m.cfg.BELLATRIX_FORK_EPOCH, + totalDifficulty = $nextBlock.totalDifficulty, + ttd = $m.cfg.TERMINAL_TOTAL_DIFFICULTY, + terminalBlockHash = m.terminalBlockHash, + candidateBlockHash = terminalBlockCandidate.hash, + candidateBlockNumber = distinctBase(terminalBlockCandidate.number) + if shouldProcessDeposits: if m.latestEth1BlockNumber <= m.cfg.ETH1_FOLLOW_DISTANCE: continue diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index b6686e0d8..4b95be041 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -742,7 +742,13 @@ proc init*(T: type BeaconNode, beaconClock: beaconClock, validatorMonitor: validatorMonitor, stateTtlCache: stateTtlCache, - nextExchangeTransitionConfTime: Moment.now, + nextExchangeTransitionConfTime: + # https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.1/src/engine/specification.md#specification-3 + # Consensus Layer client software **SHOULD** poll this endpoint every + # 60 seconds. + # Delay first call by that time to allow for EL syncing to begin; it can + # otherwise generate an EL warning by claiming a zero merge block. + Moment.now + chronos.seconds(60), dynamicFeeRecipientsStore: newClone(DynamicFeeRecipientsStore.init())) node.initLightClient(