Merge branch 'dev/etan/vd-incprop' into feat/splitview

This commit is contained in:
Etan Kissling 2024-03-25 22:29:03 +01:00
commit 58383d1ca0
No known key found for this signature in database
GPG Key ID: B21DA824C5A3D03D
1 changed files with 15 additions and 2 deletions

View File

@ -1567,8 +1567,21 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
# If the chain has halted, we have to ensure that the EL gets synced
# so that we can perform validator duties again
if not node.dag.head.executionValid and not node.dag.chainIsProgressing():
let beaconHead = node.attestationPool[].getBeaconHead(head)
discard await node.consensusManager.updateExecutionClientHead(beaconHead)
let
beaconHead = node.attestationPool[].getBeaconHead(head)
blck = node.dag.getForkedBlock(beaconHead.blck.bid)
if blck.isSome:
withBlck(blck.get):
when consensusFork >= ConsensusFork.Bellatrix:
if forkyBlck.message.is_execution_block and
not forkyBlck.message.body.execution_payload.block_hash.isZero:
# Both `engine_newPayload` and `engine_forkchoiceUpdated` are
# needed because the EL may have discarded the block since the
# last time that the stale branch was requested to be head
discard await node.elManager
.newExecutionPayload(forkyBlck.message)
discard await node.consensusManager
.updateExecutionClientHead(beaconHead)
# If the chain head is far behind, we have to advance it incrementally
# to avoid lag spikes when performing validator duties