Skip to content

Commit

Permalink
[consensus] Report leader/round for non-incremental timestamp on epoc…
Browse files Browse the repository at this point in the history
…h boundary (MystenLabs#10394)
  • Loading branch information
andll authored Apr 4, 2023
1 parent eb7ca51 commit ce26896
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/sui-core/src/consensus_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,16 @@ impl<T: ParentSync + Send + Sync> ExecutionState for ConsensusHandler<T> {
/* (serialized, transaction, output_cert) */
let mut transactions = vec![];
let timestamp = consensus_output.sub_dag.commit_timestamp;
let leader_author = consensus_output.sub_dag.leader.header().author();

let epoch_start = self
.epoch_store
.epoch_start_config()
.epoch_start_timestamp_ms();
let timestamp = if timestamp < epoch_start {
error!(
"Unexpected commit timestamp {timestamp} less then epoch start time {epoch_start}"
"Unexpected commit timestamp {timestamp} less then epoch start time {epoch_start}, author {leader_author}, round {round}",

);
epoch_start
} else {
Expand All @@ -163,12 +165,7 @@ impl<T: ParentSync + Send + Sync> ExecutionState for ConsensusHandler<T> {

self.metrics
.consensus_committed_subdags
.with_label_values(&[&consensus_output
.sub_dag
.leader
.header()
.author()
.to_string()])
.with_label_values(&[&leader_author.to_string()])
.inc();
for (cert, batches) in consensus_output.batches {
let author = cert.header().author();
Expand Down

0 comments on commit ce26896

Please sign in to comment.