delay first exchangeTransitionConfiguration (#4114)

This commit is contained in:
tersec 2022-09-15 15:00:23 +02:00 committed by GitHub
parent 23fb596779
commit 0b93eeeaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -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

View File

@ -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(