Skip to content

Commit

Permalink
Revert "added more debug info for timeoutqc verification"
Browse files Browse the repository at this point in the history
This reverts commit 632377d.
  • Loading branch information
brunoffranca committed Dec 10, 2024
1 parent 632377d commit 9fd93df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion node/components/bft/src/chonky_bft/proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ impl StateMachine {

// Update the state machine.
self.view_number = message.view().number;
metrics::METRICS.replica_view_number.set(self.view_number.0);
self.phase = validator::Phase::Commit;
self.high_vote = Some(commit_vote.clone());
match &message.justification {
Expand Down
6 changes: 4 additions & 2 deletions node/components/bft/src/chonky_bft/timeout.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::StateMachine;
use std::collections::HashSet;
use crate::metrics;
use std::{cmp::max, collections::HashSet};
use zksync_concurrency::{ctx, error::Wrap, time};
use zksync_consensus_network::io::ConsensusInputMessage;
use zksync_consensus_roles::validator;
Expand Down Expand Up @@ -141,7 +142,7 @@ impl StateMachine {
.await
.wrap("process_commit_qc()")?;
}
self.high_timeout_qc = self.high_timeout_qc.clone().max(Some(timeout_qc.clone()));
self.high_timeout_qc = max(Some(timeout_qc.clone()), self.high_timeout_qc.clone());

// Start a new view.
self.start_new_view(ctx, message.view.number.next()).await?;
Expand Down Expand Up @@ -179,6 +180,7 @@ impl StateMachine {

// Log the event.
tracing::info!("Timed out at view {}", self.view_number);
metrics::METRICS.replica_view_number.set(self.view_number.0);

Ok(())
}
Expand Down
1 change: 1 addition & 0 deletions node/components/bft/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub(crate) struct ProcessingLatencyLabels {
#[metrics(prefix = "consensus")]
pub(crate) struct ConsensusMetrics {
/// Number of the current view of the replica.
#[metrics(unit = Unit::Seconds)]
pub(crate) replica_view_number: Gauge<u64>,
/// Number of the last finalized block observed by the node.
pub(crate) finalized_block_number: Gauge<u64>,
Expand Down
6 changes: 3 additions & 3 deletions node/libs/roles/src/validator/messages/leader_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl ProposalJustification {
.map_err(ProposalJustificationVerifyError::Commit),
ProposalJustification::Timeout(qc) => qc
.verify(genesis)
.map_err(|err|ProposalJustificationVerifyError::Timeout(err,qc.clone())),
.map_err(ProposalJustificationVerifyError::Timeout),
}
}

Expand Down Expand Up @@ -130,8 +130,8 @@ impl ProposalJustification {
#[derive(thiserror::Error, Debug)]
pub enum ProposalJustificationVerifyError {
/// Invalid timeout QC.
#[error("Invalid timeout QC: {0:#}: {1:?}")]
Timeout(TimeoutQCVerifyError,TimeoutQC),
#[error("Invalid timeout QC: {0:#}")]
Timeout(TimeoutQCVerifyError),
/// Invalid commit QC.
#[error("Invalid commit QC: {0:#}")]
Commit(CommitQCVerifyError),
Expand Down

0 comments on commit 9fd93df

Please sign in to comment.