-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update justification verification #727
Conversation
@@ -26,14 +30,23 @@ | |||
@Log | |||
@NoArgsConstructor(access = AccessLevel.PRIVATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NoArgsConstructor(access = AccessLevel.PRIVATE) | |
@UtilityClass |
And then we can remove the static from flag from the methods.
log.log(Level.WARNING, "Duplicated signature"); | ||
return false; | ||
} | ||
seenPublicKeys.add(preCommit.getAuthorityPublicKey()); | ||
seenPublicKeys.add(signedVote.getAuthorityPublicKey()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per Spec:
A valid justification must only contain up to one valid vote from each voter and must not contain more than two equivocatory votes from each voter.
We can group them up beforehand using https://www.baeldung.com/java-groupingby-collector. Then check if any of the keys have > 3 votes and return false directly instead of checking a seen list.
Quality Gate passedIssues Measures |
Description
Fixes: #655 & #648