Skip to content

Commit

Permalink
fix off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
jparr721 committed Mar 28, 2024
1 parent 385be8e commit 3e7e8cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/task-impls/src/quorum_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> QuorumProposalTaskState<TYPE
self.create_dependency_task_if_new(view, event_receiver, event_sender, event);
}
HotShotEvent::QuorumProposalRecv(proposal, _sender) => {
let view = proposal.data.get_view_number();
let view = proposal.data.get_view_number() + 1;
if view < self.latest_proposed_view {
debug!("Proposal is from an older view {:?}", proposal.data.clone());
return;
Expand Down
4 changes: 2 additions & 2 deletions crates/testing/tests/quorum_proposal_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ async fn test_quorum_proposal_task_quorum_proposal() {

let mut proposals = Vec::new();
let mut leaders = Vec::new();
for view in (&mut generator).take(3) {
for view in (&mut generator).take(2) {
proposals.push(view.quorum_proposal.clone());
leaders.push(view.leader_public_key);
}
let cert = proposals[2].data.justify_qc.clone();
let cert = proposals[1].data.justify_qc.clone();

// Run at view 2, the quorum vote task shouldn't care as long as the bookkeeping is correct
let view_2 = TestScriptStage {
Expand Down

0 comments on commit 3e7e8cd

Please sign in to comment.