Skip to content

Commit

Permalink
Merge pull request #2193 from EspressoSystems/sishan/fix_metrics_bloc…
Browse files Browse the repository at this point in the history
…k_height

[Metrics] Fix block height metric
  • Loading branch information
dailinsubjam authored Dec 11, 2023
2 parents 50a532b + 2b0dd9c commit ddb8d6f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/task-impls/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,11 +609,12 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, A: ConsensusApi<TYPES, I> +
// starting from the first iteration with a three chain, e.g. right after the else if case nested in the if case above
if new_decide_reached {
let mut leaf = leaf.clone();
consensus
.metrics
.last_synced_block_height
.set(usize::try_from(leaf.get_height()).unwrap_or(0));

if leaf.view_number == new_anchor_view {
consensus
.metrics
.last_synced_block_height
.set(usize::try_from(leaf.get_height()).unwrap_or(0));
}
// If the block payload is available for this leaf, include it in
// the leaf chain that we send to the client.
if let Some(encoded_txns) =
Expand Down

0 comments on commit ddb8d6f

Please sign in to comment.