Skip to content

Commit 77b7715

Browse files
authored
Don't record block metrics when preprocessing. (#4519)
## Motivation Now that we have sparse chains, `handle_confirmed_certificate` can be called for blocks higher than `next_block_height`. Those won't be _executed_, but we still store their blobs and events etc. ## Proposal Only record block metrics for the blocks that actually get executed. ## Test Plan We should see more reasonable metrics. ## Release Plan - These changes should be backported to the latest `testnet` branch, then - be released in a validator hotfix. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 7ba8e2c commit 77b7715

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

linera-core/src/worker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,11 +840,8 @@ where
840840
.tip_state
841841
.get()
842842
.next_block_height
843-
> certificate.block().header.height
843+
== certificate.block().header.height
844844
{
845-
// Block already processed, no metrics to report.
846-
None
847-
} else {
848845
Some((
849846
certificate.inner().to_log_str(),
850847
certificate.round.type_name(),
@@ -856,6 +853,9 @@ where
856853
.map(|(validator_name, _)| validator_name.to_string())
857854
.collect::<Vec<_>>(),
858855
))
856+
} else {
857+
// Block already processed or will only be preprocessed, no metrics to report.
858+
None
859859
};
860860

861861
let result = self

0 commit comments

Comments
 (0)