Skip to content

Commit

Permalink
Remove log for skipping upgrade proposal (#3498)
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-es authored Jul 26, 2024
1 parent ba87d32 commit 51d995c
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions crates/task-impls/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,9 @@ pub struct UpgradeTaskState<TYPES: NodeType, I: NodeImplementation<TYPES>> {
}

impl<TYPES: NodeType, I: NodeImplementation<TYPES>> UpgradeTaskState<TYPES, I> {
/// Check if the version has been upgraded.
/// Check if we have decided on an upgrade certificate
async fn upgraded(&self) -> bool {
if let Some(cert) = self.decided_upgrade_certificate.read().await.clone() {
return cert.data.new_version == TYPES::Upgrade::VERSION;
}
false
self.decided_upgrade_certificate.read().await.is_some()
}

/// main task event handler
Expand Down Expand Up @@ -263,15 +260,6 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> UpgradeTaskState<TYPES, I> {

self.cur_view = *new_view;

// Skip proposing if the version has already been upgraded.
if self.upgraded().await {
info!(
"Already upgraded to {:?}, skip proposing.",
TYPES::Upgrade::VERSION
);
return None;
}

let view: u64 = *self.cur_view;
let time = SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
Expand All @@ -283,6 +271,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> UpgradeTaskState<TYPES, I> {
&& view < self.stop_proposing_view
&& time >= self.start_proposing_time
&& time < self.stop_proposing_time
&& !self.upgraded().await
&& self
.quorum_membership
.leader(TYPES::Time::new(view + UPGRADE_PROPOSE_OFFSET))
Expand Down Expand Up @@ -310,6 +299,8 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> UpgradeTaskState<TYPES, I> {
)
.expect("Failed to sign upgrade proposal commitment!");

warn!("Sending upgrade proposal:\n\n {:?}", upgrade_proposal);

let message = Proposal {
data: upgrade_proposal,
signature,
Expand Down

0 comments on commit 51d995c

Please sign in to comment.