This commit is contained in:
Eugene Kabanov 2022-08-17 01:14:32 +03:00 committed by GitHub
parent e732b080f7
commit cd9b50bbbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,13 +184,26 @@ proc checkSync(vc: ValidatorClientRef,
return return
node.syncInfo = some(syncInfo) node.syncInfo = some(syncInfo)
node.status = node.status =
block:
let optimistic =
if syncInfo.is_optimistic.isNone():
"none"
else:
$syncInfo.is_optimistic.get()
if not(syncInfo.is_syncing) or (syncInfo.sync_distance < SYNC_TOLERANCE): if not(syncInfo.is_syncing) or (syncInfo.sync_distance < SYNC_TOLERANCE):
if not(syncInfo.is_optimistic.get(false)):
info "Beacon node is in sync", sync_distance = syncInfo.sync_distance, info "Beacon node is in sync", sync_distance = syncInfo.sync_distance,
head_slot = syncInfo.head_slot head_slot = syncInfo.head_slot, is_opimistic = optimistic
RestBeaconNodeStatus.Online RestBeaconNodeStatus.Online
else:
warn "Beacon node is optimistically synced only",
sync_distance = syncInfo.sync_distance,
head_slot = syncInfo.head_slot, is_opimistic = optimistic
RestBeaconNodeStatus.NotSynced
else: else:
warn "Beacon node not in sync", sync_distance = syncInfo.sync_distance, warn "Beacon node not in sync", sync_distance = syncInfo.sync_distance,
head_slot = syncInfo.head_slot head_slot = syncInfo.head_slot, is_opimistic = optimistic
RestBeaconNodeStatus.NotSynced RestBeaconNodeStatus.NotSynced
proc checkOnline(node: BeaconNodeServerRef) {.async.} = proc checkOnline(node: BeaconNodeServerRef) {.async.} =