mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-22 12:30:08 +00:00
bump vendor/nim-metrics
This commit is contained in:
parent
aa00e5ea61
commit
c572f61129
@ -906,10 +906,7 @@ proc updateHead*(pool: BlockPool, newHead: BlockRef) =
|
||||
cat = "fork_choice"
|
||||
|
||||
# A reasonable criterion for "reorganizations of the chain"
|
||||
try:
|
||||
beacon_reorgs_total.inc()
|
||||
except Exception as e: # TODO https://github.com/status-im/nim-metrics/pull/22
|
||||
trace "Couldn't update metrics", msg = e.msg
|
||||
beacon_reorgs_total.inc()
|
||||
else:
|
||||
info "Updated head block",
|
||||
stateRoot = shortLog(pool.headState.data.root),
|
||||
|
@ -401,19 +401,16 @@ proc process_block*(
|
||||
# https://github.com/ethereum/eth2.0-metrics/blob/master/metrics.md#additional-metrics
|
||||
# doesn't seem to specify at what point in block processing this metric is to be read,
|
||||
# and this avoids the early-return issue (could also use defer, etc).
|
||||
try:
|
||||
beacon_pending_deposits.set(
|
||||
state.eth1_data.deposit_count.int64 - state.eth1_deposit_index.int64)
|
||||
beacon_processed_deposits_total.set(state.eth1_deposit_index.int64)
|
||||
beacon_pending_deposits.set(
|
||||
state.eth1_data.deposit_count.int64 - state.eth1_deposit_index.int64)
|
||||
beacon_processed_deposits_total.set(state.eth1_deposit_index.int64)
|
||||
|
||||
# Adds nontrivial additional computation, but only does so when metrics
|
||||
# enabled.
|
||||
beacon_current_live_validators.set(toHashSet(
|
||||
mapIt(state.current_epoch_attestations, it.proposerIndex)).len.int64)
|
||||
beacon_previous_live_validators.set(toHashSet(
|
||||
mapIt(state.previous_epoch_attestations, it.proposerIndex)).len.int64)
|
||||
except Exception as e: # TODO https://github.com/status-im/nim-metrics/pull/22
|
||||
trace "Couldn't update metrics", msg = e.msg
|
||||
# Adds nontrivial additional computation, but only does so when metrics
|
||||
# enabled.
|
||||
beacon_current_live_validators.set(toHashSet(
|
||||
mapIt(state.current_epoch_attestations, it.proposerIndex)).len.int64)
|
||||
beacon_previous_live_validators.set(toHashSet(
|
||||
mapIt(state.previous_epoch_attestations, it.proposerIndex)).len.int64)
|
||||
|
||||
if not process_block_header(state, blck, flags, stateCache):
|
||||
notice "Block header not valid", slot = shortLog(state.slot)
|
||||
|
@ -452,16 +452,13 @@ proc process_epoch*(state: var BeaconState) {.nbench.}=
|
||||
process_final_updates(state)
|
||||
|
||||
# Once per epoch metrics
|
||||
try:
|
||||
beacon_finalized_epoch.set(state.finalized_checkpoint.epoch.int64)
|
||||
beacon_finalized_root.set(state.finalized_checkpoint.root.toGaugeValue)
|
||||
beacon_current_justified_epoch.set(
|
||||
state.current_justified_checkpoint.epoch.int64)
|
||||
beacon_current_justified_root.set(
|
||||
state.current_justified_checkpoint.root.toGaugeValue)
|
||||
beacon_previous_justified_epoch.set(
|
||||
state.previous_justified_checkpoint.epoch.int64)
|
||||
beacon_previous_justified_root.set(
|
||||
state.previous_justified_checkpoint.root.toGaugeValue)
|
||||
except Exception as e: # TODO https://github.com/status-im/nim-metrics/pull/22
|
||||
trace "Couldn't update metrics", msg = e.msg
|
||||
beacon_finalized_epoch.set(state.finalized_checkpoint.epoch.int64)
|
||||
beacon_finalized_root.set(state.finalized_checkpoint.root.toGaugeValue)
|
||||
beacon_current_justified_epoch.set(
|
||||
state.current_justified_checkpoint.epoch.int64)
|
||||
beacon_current_justified_root.set(
|
||||
state.current_justified_checkpoint.root.toGaugeValue)
|
||||
beacon_previous_justified_epoch.set(
|
||||
state.previous_justified_checkpoint.epoch.int64)
|
||||
beacon_previous_justified_root.set(
|
||||
state.previous_justified_checkpoint.root.toGaugeValue)
|
||||
|
@ -131,17 +131,11 @@ proc advance_slot*(state: var HashedBeaconState, nextStateRoot: Opt[Eth2Digest])
|
||||
let is_epoch_transition = (state.data.slot + 1).isEpoch
|
||||
if is_epoch_transition:
|
||||
# Note: Genesis epoch = 0, no need to test if before Genesis
|
||||
try:
|
||||
beacon_previous_validators.set(get_epoch_validator_count(state.data))
|
||||
except Exception as e: # TODO https://github.com/status-im/nim-metrics/pull/22
|
||||
trace "Couldn't update metrics", msg = e.msg
|
||||
beacon_previous_validators.set(get_epoch_validator_count(state.data))
|
||||
process_epoch(state.data)
|
||||
state.data.slot += 1
|
||||
if is_epoch_transition:
|
||||
try:
|
||||
beacon_current_validators.set(get_epoch_validator_count(state.data))
|
||||
except Exception as e: # TODO https://github.com/status-im/nim-metrics/pull/22
|
||||
trace "Couldn't update metrics", msg = e.msg
|
||||
beacon_current_validators.set(get_epoch_validator_count(state.data))
|
||||
|
||||
if nextStateRoot.isSome:
|
||||
state.root = nextStateRoot.get()
|
||||
|
2
vendor/nim-metrics
vendored
2
vendor/nim-metrics
vendored
@ -1 +1 @@
|
||||
Subproject commit 5db86514a1185620a003d1e5ea1da4c0373c3b6e
|
||||
Subproject commit b217f1d343dce8c642b24aa8fbb7887dcea0fd4a
|
Loading…
x
Reference in New Issue
Block a user