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

Add more validations on QC's votes #475

Merged
merged 18 commits into from
Aug 12, 2024
Merged

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Aug 5, 2024

Add more validations on QC's votes:

  • Verify a finalizer does not vote both strong and weak for the same block
  • Verify a dual finalizer (which votes on both active and pending finalizer policies) votes the same way
  • Verify at least one of strong and weak bitsets present in QC signature
  • Add tests for dual finalizer validation

Resolves #467

@linh2931 linh2931 requested review from heifner and greg7mdp August 5, 2024 20:26
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Additional validations on QC's votes.
Note:end

pending_vote_index);
}

// returns true if ithe other and I vote iin the same way on my_vote_index
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// returns true if ithe other and I vote iin the same way on my_vote_index
// returns true iff the other and I voted the same way

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

for (size_t i=0; i<strong_votes->size(); ++i) {
// at most one is true
EOS_ASSERT( !((*strong_votes)[i] && (*weak_votes)[i]), invalid_qc_claim,
"finalizer (bit index ${i}) votes both strong and weak",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"finalizer (bit index ${i}) votes both strong and weak",
"finalizer (bit index ${i}) voted both strong and weak",

Comment on lines 39 to 40
// We have already verified the same index is not voted on both strong
// and weak for a given qc_sig_t (I or other).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// We have already verified the same index is not voted on both strong
// and weak for a given qc_sig_t (I or other).
// We have already verified the same index has not voted both strong
// and weak for a given qc_sig_t (I or other).

@linh2931 linh2931 merged commit ea5c025 into main Aug 12, 2024
36 checks passed
@linh2931 linh2931 deleted the verify_active_pending_policies branch August 12, 2024 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify dual finalizers in active and pending finalizer policies vote in the same way in received QCs
4 participants