mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-22 20:42:13 +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"
|
cat = "fork_choice"
|
||||||
|
|
||||||
# A reasonable criterion for "reorganizations of the chain"
|
# A reasonable criterion for "reorganizations of the chain"
|
||||||
try:
|
beacon_reorgs_total.inc()
|
||||||
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
|
|
||||||
else:
|
else:
|
||||||
info "Updated head block",
|
info "Updated head block",
|
||||||
stateRoot = shortLog(pool.headState.data.root),
|
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
|
# 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,
|
# 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).
|
# and this avoids the early-return issue (could also use defer, etc).
|
||||||
try:
|
beacon_pending_deposits.set(
|
||||||
beacon_pending_deposits.set(
|
state.eth1_data.deposit_count.int64 - state.eth1_deposit_index.int64)
|
||||||
state.eth1_data.deposit_count.int64 - state.eth1_deposit_index.int64)
|
beacon_processed_deposits_total.set(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
|
# Adds nontrivial additional computation, but only does so when metrics
|
||||||
# enabled.
|
# enabled.
|
||||||
beacon_current_live_validators.set(toHashSet(
|
beacon_current_live_validators.set(toHashSet(
|
||||||
mapIt(state.current_epoch_attestations, it.proposerIndex)).len.int64)
|
mapIt(state.current_epoch_attestations, it.proposerIndex)).len.int64)
|
||||||
beacon_previous_live_validators.set(toHashSet(
|
beacon_previous_live_validators.set(toHashSet(
|
||||||
mapIt(state.previous_epoch_attestations, it.proposerIndex)).len.int64)
|
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
|
|
||||||
|
|
||||||
if not process_block_header(state, blck, flags, stateCache):
|
if not process_block_header(state, blck, flags, stateCache):
|
||||||
notice "Block header not valid", slot = shortLog(state.slot)
|
notice "Block header not valid", slot = shortLog(state.slot)
|
||||||
|
@ -452,16 +452,13 @@ proc process_epoch*(state: var BeaconState) {.nbench.}=
|
|||||||
process_final_updates(state)
|
process_final_updates(state)
|
||||||
|
|
||||||
# Once per epoch metrics
|
# Once per epoch metrics
|
||||||
try:
|
beacon_finalized_epoch.set(state.finalized_checkpoint.epoch.int64)
|
||||||
beacon_finalized_epoch.set(state.finalized_checkpoint.epoch.int64)
|
beacon_finalized_root.set(state.finalized_checkpoint.root.toGaugeValue)
|
||||||
beacon_finalized_root.set(state.finalized_checkpoint.root.toGaugeValue)
|
beacon_current_justified_epoch.set(
|
||||||
beacon_current_justified_epoch.set(
|
state.current_justified_checkpoint.epoch.int64)
|
||||||
state.current_justified_checkpoint.epoch.int64)
|
beacon_current_justified_root.set(
|
||||||
beacon_current_justified_root.set(
|
state.current_justified_checkpoint.root.toGaugeValue)
|
||||||
state.current_justified_checkpoint.root.toGaugeValue)
|
beacon_previous_justified_epoch.set(
|
||||||
beacon_previous_justified_epoch.set(
|
state.previous_justified_checkpoint.epoch.int64)
|
||||||
state.previous_justified_checkpoint.epoch.int64)
|
beacon_previous_justified_root.set(
|
||||||
beacon_previous_justified_root.set(
|
state.previous_justified_checkpoint.root.toGaugeValue)
|
||||||
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
|
|
||||||
|
@ -131,17 +131,11 @@ proc advance_slot*(state: var HashedBeaconState, nextStateRoot: Opt[Eth2Digest])
|
|||||||
let is_epoch_transition = (state.data.slot + 1).isEpoch
|
let is_epoch_transition = (state.data.slot + 1).isEpoch
|
||||||
if is_epoch_transition:
|
if is_epoch_transition:
|
||||||
# Note: Genesis epoch = 0, no need to test if before Genesis
|
# Note: Genesis epoch = 0, no need to test if before Genesis
|
||||||
try:
|
beacon_previous_validators.set(get_epoch_validator_count(state.data))
|
||||||
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
|
|
||||||
process_epoch(state.data)
|
process_epoch(state.data)
|
||||||
state.data.slot += 1
|
state.data.slot += 1
|
||||||
if is_epoch_transition:
|
if is_epoch_transition:
|
||||||
try:
|
beacon_current_validators.set(get_epoch_validator_count(state.data))
|
||||||
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
|
|
||||||
|
|
||||||
if nextStateRoot.isSome:
|
if nextStateRoot.isSome:
|
||||||
state.root = nextStateRoot.get()
|
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