Skip to content

Commit

Permalink
Only record metrics after block verified
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Jul 4, 2024
1 parent d84e3e3 commit cde3fad
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cde3fad

Please sign in to comment.