diff --git a/crates/task-impls/src/network.rs b/crates/task-impls/src/network.rs index 05ba43a133..f9cbcff865 100644 --- a/crates/task-impls/src/network.rs +++ b/crates/task-impls/src/network.rs @@ -309,11 +309,16 @@ impl< consensus: Arc>>, view: ::View, ) -> std::result::Result<(), ()> { - if let Some(action) = maybe_action { + if let Some(mut action) = maybe_action { if !consensus.write().await.update_action(action, view) { tracing::warn!("Already actioned {:?} in view {:?}", action, view); return Err(()); } + // If the action was view sync record it as a vote, but we don't + // want to limit to 1 View sycn vote above so change the action here. + if matches!(action, HotShotAction::ViewSyncVote) { + action = HotShotAction::Vote; + } match storage.write().await.record_action(view, action).await { Ok(()) => Ok(()), Err(e) => { @@ -460,6 +465,7 @@ impl< )) } HotShotEvent::ViewSyncCommitVoteSend(vote) => { + *maybe_action = Some(HotShotAction::ViewSyncVote); let view_number = vote.view_number() + vote.date().relay; let leader = match self.quorum_membership.leader(view_number, self.epoch) { Ok(l) => l, @@ -482,6 +488,7 @@ impl< )) } HotShotEvent::ViewSyncFinalizeVoteSend(vote) => { + *maybe_action = Some(HotShotAction::ViewSyncVote); let view_number = vote.view_number() + vote.date().relay; let leader = match self.quorum_membership.leader(view_number, self.epoch) { Ok(l) => l, diff --git a/crates/types/src/event.rs b/crates/types/src/event.rs index ca833c9f5d..f9d48779e8 100644 --- a/crates/types/src/event.rs +++ b/crates/types/src/event.rs @@ -184,6 +184,8 @@ pub enum EventType { pub enum HotShotAction { /// A quorum vote was sent Vote, + /// View Sync Vote + ViewSyncVote, /// A quorum proposal was sent Propose, /// DA proposal was sent