Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix some of TODOs in code #142

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions code/common/src/signed_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use core::fmt;

use crate::{Context, Signature, Vote};

// TODO: Do we need to abstract over `SignedVote` as well?

/// A signed vote, ie. a vote emitted by a validator and signed by its private key.
pub struct SignedVote<Ctx>
where
Expand Down
7 changes: 4 additions & 3 deletions code/driver/src/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ where
// Store the proposal
self.proposal = Some(proposal.clone());

// Determine if there is a polka for the proposal
let polka_for_pol = self.vote_keeper.is_threshold_met(
&proposal.pol_round(),
VoteType::Prevote,
Threshold::Value(proposal.value().id()),
);

// Determine if the polka is for a previous round
let polka_previous = proposal.pol_round().is_defined()
&& polka_for_pol
&& proposal.pol_round() < self.round_state.round;
Expand All @@ -124,12 +126,12 @@ where

// We have a valid proposal.
// L49
// TODO: check if not already decided
if self.vote_keeper.is_threshold_met(
&proposal.round(),
VoteType::Precommit,
Threshold::Value(proposal.value().id()),
) {
) && !self.round_state.step.eq(&Step::Commit)
{
return Some(RoundInput::ProposalAndPrecommitValue(proposal));
}

Expand All @@ -153,7 +155,6 @@ where

// L28
if self.round_state.step == Step::Propose && polka_previous {
// TODO: Check proposal vr is equal to threshold vr
return Some(RoundInput::ProposalAndPolkaPrevious(proposal));
}

Expand Down
1 change: 0 additions & 1 deletion code/test/src/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ impl Vote {
}
}

// TODO: Use a canonical vote
pub fn to_bytes(&self) -> Vec<u8> {
let vtpe = match self.typ {
VoteType::Prevote => 0,
Expand Down
Loading