Restore the ETH display in the status bar

This commit is contained in:
Zahary Karadjov 2020-11-28 20:53:51 +02:00
parent d7dc11d96d
commit bf2673abc4
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
4 changed files with 10 additions and 15 deletions

View File

@ -208,7 +208,8 @@ type
"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;" &
"time: $epoch:$epoch_slot ($slot);" & "time: $epoch:$epoch_slot ($slot);" &
"sync: $sync_status|" "sync: $sync_status|" &
"ETH: $attached_validators_balance"
desc: "Textual template for the contents of the status bar" desc: "Textual template for the contents of the status bar"
name: "status-bar-contents" }: string name: "status-bar-contents" }: string

View File

@ -259,22 +259,22 @@ declareCounter nbc_gossip_messages_sent,
declareCounter nbc_gossip_messages_received, declareCounter nbc_gossip_messages_received,
"Number of gossip messages received by this peer" "Number of gossip messages received by this peer"
declarePublicCounter nbc_successful_dials, declareCounter nbc_successful_dials,
"Number of successfully dialed peers" "Number of successfully dialed peers"
declarePublicCounter nbc_failed_dials, declareCounter nbc_failed_dials,
"Number of dialing attempts that failed" "Number of dialing attempts that failed"
declarePublicCounter nbc_timeout_dials, declareCounter nbc_timeout_dials,
"Number of dialing attempts that exceeded timeout" "Number of dialing attempts that exceeded timeout"
declarePublicGauge nbc_peers, declareGauge nbc_peers,
"Number of active libp2p peers" "Number of active libp2p peers"
declarePublicCounter nbc_successful_discoveries, declareCounter nbc_successful_discoveries,
"Number of successfull discoveries" "Number of successfull discoveries"
declarePublicCounter nbc_failed_discoveries, declareCounter nbc_failed_discoveries,
"Number of failed discoveries" "Number of failed discoveries"
const delayBuckets = [1.0, 5.0, 10.0, 20.0, 40.0, 60.0] const delayBuckets = [1.0, 5.0, 10.0, 20.0, 40.0, 60.0]

View File

@ -982,13 +982,7 @@ when hasPrompt:
slotStr slotStr
of "attached_validators_balance": of "attached_validators_balance":
var balance = uint64(0) formatGwei(attached_validator_balance_total.value.uint64)
# TODO slow linear scan!
for idx, b in node.chainDag.headState.data.data.balances:
if node.getAttachedValidator(
node.chainDag.headState.data.data, ValidatorIndex(idx)) != nil:
balance += b
formatGwei(balance)
of "sync_status": of "sync_status":
if isNil(node.syncManager): if isNil(node.syncManager):

View File

@ -42,7 +42,7 @@ declareCounter beacon_blocks_proposed,
declareGauge(attached_validator_balance, declareGauge(attached_validator_balance,
"Validator balance at slot end of the first 64 validators, in Gwei", "Validator balance at slot end of the first 64 validators, in Gwei",
labels = ["pubkey"]) labels = ["pubkey"])
declareGauge(attached_validator_balance_total, declarePublicGauge(attached_validator_balance_total,
"Validator balance of all attached validators, in Gwei") "Validator balance of all attached validators, in Gwei")
logScope: topics = "beacval" logScope: topics = "beacval"