diff --git a/beacon_chain/eth1/eth1_monitor.nim b/beacon_chain/eth1/eth1_monitor.nim index 2f505cc97..2d9d3ecd6 100644 --- a/beacon_chain/eth1/eth1_monitor.nim +++ b/beacon_chain/eth1/eth1_monitor.nim @@ -134,6 +134,7 @@ type depositsChain: Eth1Chain eth1Progress: AsyncEvent + exchangedConfiguration*: bool terminalBlockHash*: Option[BlockHash] terminalBlockNumber*: Option[Quantity] @@ -588,8 +589,17 @@ proc exchangeTransitionConfiguration*(p: Eth1Monitor): Future[EtcStatus] {.async localValue = consensusCfg.terminalTotalDifficulty return EtcStatus.mismatch + if not p.exchangedConfiguration: + # Log successful engine configuration exchange once at startup + p.exchangedConfiguration = true + info "Exchanged engine configuration", + ttd = executionCfg.terminalTotalDifficulty, + terminalBlockHash = executionCfg.terminalBlockHash, + terminalBlockNumber = executionCfg.terminalBlockNumber.uint64 + if p.terminalBlockNumber.isSome and p.terminalBlockHash.isSome: var res = EtcStatus.match + if consensusCfg.terminalBlockNumber != executionCfg.terminalBlockNumber: warn "Engine API reporting different terminal block number", engineAPI_value = executionCfg.terminalBlockNumber.uint64, @@ -602,6 +612,13 @@ proc exchangeTransitionConfiguration*(p: Eth1Monitor): Future[EtcStatus] {.async res = EtcStatus.mismatch return res else: + if executionCfg.terminalBlockHash == default BlockHash: + # If TERMINAL_BLOCK_HASH is stubbed with + # 0x0000000000000000000000000000000000000000000000000000000000000000 then + # TERMINAL_BLOCK_HASH and TERMINAL_BLOCK_NUMBER parameters MUST NOT take + # an effect. + return EtcStatus.match + p.terminalBlockNumber = some executionCfg.terminalBlockNumber p.terminalBlockHash = some executionCfg.terminalBlockHash return EtcStatus.localConfigurationUpdated