mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Record BEACON_BLOCK_DELAY_GOSSIP metric only after a bock is verified (#6046)
* Only record metrics after block verified
This commit is contained in:
@@ -907,17 +907,19 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
get_block_delay_ms(seen_duration, block.message(), &self.chain.slot_clock);
|
||||
// Log metrics to track delay from other nodes on the network.
|
||||
|
||||
metrics::set_gauge(
|
||||
&metrics::BEACON_BLOCK_DELAY_GOSSIP,
|
||||
block_delay.as_millis() as i64,
|
||||
);
|
||||
|
||||
let verification_result = self
|
||||
.chain
|
||||
.clone()
|
||||
.verify_block_for_gossip(block.clone())
|
||||
.await;
|
||||
|
||||
if verification_result.is_ok() {
|
||||
metrics::set_gauge(
|
||||
&metrics::BEACON_BLOCK_DELAY_GOSSIP,
|
||||
block_delay.as_millis() as i64,
|
||||
);
|
||||
}
|
||||
|
||||
let block_root = if let Ok(verified_block) = &verification_result {
|
||||
verified_block.block_root
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user