only show upcoming fork info if one is scheduled (#5751)
This ensures that information about the next scheduled fork is only displayed if one is actually scheduled. Current fork name is no longer shown.
This commit is contained in:
parent
3541cfe020
commit
39a2a91003
|
@ -439,8 +439,7 @@ type
|
||||||
desc: "Textual template for the contents of the status bar"
|
desc: "Textual template for the contents of the status bar"
|
||||||
defaultValue: "peers: $connected_peers;" &
|
defaultValue: "peers: $connected_peers;" &
|
||||||
"finalized: $finalized_root:$finalized_epoch;" &
|
"finalized: $finalized_root:$finalized_epoch;" &
|
||||||
"head: $head_root:$head_epoch:$head_epoch_slot;" &
|
"head: $head_root:$head_epoch:$head_epoch_slot$next_consensus_fork;" &
|
||||||
"fork: $consensus_fork;" &
|
|
||||||
"time: $epoch:$epoch_slot ($slot);" &
|
"time: $epoch:$epoch_slot ($slot);" &
|
||||||
"sync: $sync_status|" &
|
"sync: $sync_status|" &
|
||||||
"ETH: $attached_validators_balance"
|
"ETH: $attached_validators_balance"
|
||||||
|
|
|
@ -1473,17 +1473,17 @@ proc onSlotEnd(node: BeaconNode, slot: Slot) {.async.} =
|
||||||
|
|
||||||
await node.updateGossipStatus(slot + 1)
|
await node.updateGossipStatus(slot + 1)
|
||||||
|
|
||||||
func formatForkSchedule(node: BeaconNode): string =
|
func formatNextConsensusFork(node: BeaconNode): Opt[string] =
|
||||||
let consensusFork =
|
let consensusFork =
|
||||||
node.dag.cfg.consensusForkAtEpoch(node.dag.head.slot.epoch)
|
node.dag.cfg.consensusForkAtEpoch(node.dag.head.slot.epoch)
|
||||||
var res = $consensusFork
|
if consensusFork == ConsensusFork.high:
|
||||||
if consensusFork != ConsensusFork.high:
|
return Opt.none(string)
|
||||||
let
|
let
|
||||||
nextConsensusFork = consensusFork.succ()
|
nextConsensusFork = consensusFork.succ()
|
||||||
nextForkEpoch = node.dag.cfg.consensusForkEpoch(nextConsensusFork)
|
nextForkEpoch = node.dag.cfg.consensusForkEpoch(nextConsensusFork)
|
||||||
if nextForkEpoch != FAR_FUTURE_EPOCH:
|
if nextForkEpoch == FAR_FUTURE_EPOCH:
|
||||||
res.add " (next: " & $nextConsensusFork & ":" & $nextForkEpoch & ")"
|
return Opt.none(string)
|
||||||
res
|
Opt.some($nextConsensusFork & ":" & $nextForkEpoch)
|
||||||
|
|
||||||
func syncStatus(node: BeaconNode, wallSlot: Slot): string =
|
func syncStatus(node: BeaconNode, wallSlot: Slot): string =
|
||||||
let optimistic_head = not node.dag.head.executionValid
|
let optimistic_head = not node.dag.head.executionValid
|
||||||
|
@ -1528,16 +1528,21 @@ proc onSlotStart(node: BeaconNode, wallTime: BeaconTime,
|
||||||
|
|
||||||
node.processingDelay = Opt.some(nanoseconds(delay.nanoseconds))
|
node.processingDelay = Opt.some(nanoseconds(delay.nanoseconds))
|
||||||
|
|
||||||
info "Slot start",
|
block:
|
||||||
slot = shortLog(wallSlot),
|
logScope:
|
||||||
epoch = shortLog(wallSlot.epoch),
|
slot = shortLog(wallSlot)
|
||||||
fork = node.formatForkSchedule(),
|
epoch = shortLog(wallSlot.epoch)
|
||||||
sync = node.syncStatus(wallSlot),
|
sync = node.syncStatus(wallSlot)
|
||||||
peers = len(node.network.peerPool),
|
peers = len(node.network.peerPool)
|
||||||
head = shortLog(node.dag.head),
|
head = shortLog(node.dag.head)
|
||||||
finalized = shortLog(getStateField(
|
finalized = shortLog(getStateField(
|
||||||
node.dag.headState, finalized_checkpoint)),
|
node.dag.headState, finalized_checkpoint))
|
||||||
delay = shortLog(delay)
|
delay = shortLog(delay)
|
||||||
|
let nextConsensusForkDescription = node.formatNextConsensusFork()
|
||||||
|
if nextConsensusForkDescription.isNone:
|
||||||
|
info "Slot start"
|
||||||
|
else:
|
||||||
|
info "Slot start", nextFork = nextConsensusForkDescription.get
|
||||||
|
|
||||||
# Check before any re-scheduling of onSlotStart()
|
# Check before any re-scheduling of onSlotStart()
|
||||||
if checkIfShouldStopAtEpoch(wallSlot, node.config.stopAtEpoch):
|
if checkIfShouldStopAtEpoch(wallSlot, node.config.stopAtEpoch):
|
||||||
|
@ -1964,8 +1969,12 @@ when not defined(windows):
|
||||||
of "attached_validators_balance":
|
of "attached_validators_balance":
|
||||||
formatGwei(node.attachedValidatorBalanceTotal)
|
formatGwei(node.attachedValidatorBalanceTotal)
|
||||||
|
|
||||||
of "consensus_fork":
|
of "next_consensus_fork":
|
||||||
node.formatForkSchedule()
|
let nextConsensusForkDescription = node.formatNextConsensusFork()
|
||||||
|
if nextConsensusForkDescription.isNone:
|
||||||
|
""
|
||||||
|
else:
|
||||||
|
" (scheduled " & nextConsensusForkDescription.get & ")"
|
||||||
|
|
||||||
of "sync_status":
|
of "sync_status":
|
||||||
node.syncStatus(node.currentSlot)
|
node.syncStatus(node.currentSlot)
|
||||||
|
|
Loading…
Reference in New Issue