Sync with Eth1 even when there are no validators attached

This commit is contained in:
Zahary Karadjov 2021-11-25 19:08:02 +02:00 committed by zah
parent ef1de66316
commit 7902e7684c
2 changed files with 6 additions and 6 deletions

View File

@ -941,6 +941,11 @@ proc onSlotStart(
await node.handleValidatorDuties(lastSlot, wallSlot)
if node.eth1Monitor != nil and (wallSlot mod SLOTS_PER_EPOCH) == 0:
let finalizedEpochRef = node.dag.getFinalizedEpochRef()
discard node.eth1Monitor.trackFinalizedState(
finalizedEpochRef.eth1_data, finalizedEpochRef.eth1_deposit_index)
await onSlotEnd(node, wallSlot)
proc handleMissingBlocks(node: BeaconNode) =
@ -1187,7 +1192,7 @@ proc start(node: BeaconNode) {.raises: [Defect, CatchableError].} =
waitFor node.initializeNetworking()
if node.eth1Monitor != nil and node.attachedValidators[].count > 0:
if node.eth1Monitor != nil:
node.eth1Monitor.start()
else:
notice "Running without execution chain monitor, block producation partially disabled"

View File

@ -1049,11 +1049,6 @@ proc handleValidatorDuties*(node: BeaconNode, lastSlot, slot: Slot) {.async.} =
await handleSyncCommitteeContributionsFut
await sendAggregatedAttestationsFut
if node.eth1Monitor != nil and (slot mod SLOTS_PER_EPOCH) == 0:
let finalizedEpochRef = node.dag.getFinalizedEpochRef()
discard node.eth1Monitor.trackFinalizedState(
finalizedEpochRef.eth1_data, finalizedEpochRef.eth1_deposit_index)
proc sendAttestation*(node: BeaconNode,
attestation: Attestation): Future[SendResult] {.async.} =
# REST/JSON-RPC API helper procedure.