Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ed/update-view-sync' into bf/tim…
Browse files Browse the repository at this point in the history
…eout-task
  • Loading branch information
bfish713 committed Dec 14, 2023
2 parents 4904090 + 34c0641 commit b346b2a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/task-impls/src/view_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,12 @@ impl<
self.num_timeouts_tracked, *view_number
);

if self.num_timeouts_tracked > 3 {
if self.num_timeouts_tracked >= 3 {
error!("Too many consecutive timeouts! This shouldn't happen");
}

if self.num_timeouts_tracked > 2 {
if self.num_timeouts_tracked >= 2 {
error!("Starting view sync protocol for view {}", *view_number + 1);
// Start polling for view sync certificates
self.network
.inject_consensus_info(ConsensusIntentEvent::PollForViewSyncCertificate(
Expand All @@ -507,9 +508,9 @@ impl<
let subscribe_view = if self.membership.get_leader(TYPES::Time::new(next_view))
== self.public_key
{
next_view
} else {
next_view + 1
} else {
next_view
};
// Subscribe to the next view just in case there is progress being made
self.network
Expand Down Expand Up @@ -756,6 +757,12 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, A: ConsensusApi<TYPES, I> +
.publish(HotShotEvent::ViewSyncFinalizeVoteSend(vote))
.await;
}

error!(
"View sync protocol has received view sync evidence to update the view to {}",
*self.next_view
);

self.event_stream
.publish(HotShotEvent::ViewChange(self.next_view))
.await;
Expand Down

0 comments on commit b346b2a

Please sign in to comment.