distinguish between optimistic and non-optimistic sync progress (#3987)

* distinguish between optimistic and non-optimistic sync progress

* use consistent optimistic formatting for sync
This commit is contained in:
tersec 2022-08-18 13:22:22 +00:00 committed by GitHub
parent 3ad1d251ef
commit 2f62567624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1340,12 +1340,16 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
await node.updateGossipStatus(slot + 1)
func syncStatus(node: BeaconNode): string =
let optimistic_head = node.dag.is_optimistic(node.dag.head.root)
if node.syncManager.inProgress:
node.syncManager.syncStatus
if optimistic_head:
node.syncManager.syncStatus & "/opt"
else:
node.syncManager.syncStatus
elif node.backfiller.inProgress:
"backfill: " & node.backfiller.syncStatus
elif node.dag.is_optimistic(node.dag.head.root):
"opt synced"
elif optimistic_head:
"synced/opt"
else:
"synced"