Merged
Conversation
ddd5746 to
830cbc8
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
==========================================
+ Coverage 77.78% 78.28% +0.49%
==========================================
Files 25 24 -1
Lines 5074 5066 -8
==========================================
+ Hits 3947 3966 +19
+ Misses 1127 1100 -27 ☔ View full report in Codecov by Sentry. |
4a41d31 to
280c37e
Compare
0f3b9f4 to
4af8017
Compare
d402183 to
f6adf83
Compare
f6adf83 to
72b8484
Compare
piotr-roslaniec
commented
Jan 30, 2024
| self.address.cmp(&other.address) | ||
| } | ||
| /// The index of the validator in the given ritual | ||
| pub share_index: u32, |
Author
There was a problem hiding this comment.
DKG expects to be provided with a share_index for every Validator
piotr-roslaniec
commented
Jan 31, 2024
| "num_shares: {num_shares}, security_threshold: {security_threshold}" | ||
| )) | ||
| }, | ||
| Error::DuplicatedShareIndex(index) => { |
piotr-roslaniec
commented
Jan 31, 2024
| .verify(dkg.0.dkg_params.shares_num(), &messages) | ||
| .is_ok()); | ||
|
|
||
| // Test negative cases |
Author
There was a problem hiding this comment.
These test cases were adapted from the server variant of tests above
piotr-roslaniec
commented
Jan 31, 2024
| } | ||
|
|
||
| #[derive(Clone, Debug, Serialize, Deserialize, Eq, PartialEq)] | ||
| pub struct DkgValidator<E: Pairing> { |
Author
There was a problem hiding this comment.
Deprecated and replaced with just Validator
piotr-roslaniec
commented
Jan 31, 2024
| } | ||
| } | ||
|
|
||
| pub fn assert_no_share_duplicates<E: Pairing>( |
Author
There was a problem hiding this comment.
Replaces validation logic for ensuring validator ordering
cygnusv
approved these changes
Feb 5, 2024
| Ok(Message::Deal(transcript)) => Ok(transcript), | ||
| Err(e) => Err(e), | ||
| _ => Err(Error::InvalidDkgStateToDeal), | ||
| } |
Author
There was a problem hiding this comment.
It's a pattern-matching expression with different cases on each line:
- The first line describes a case where we get the intended result - We just need to unwrap
transcriptfrom aMessagestruct, and specifically fromMessage::Dealvariant. I'm considering deprecatingMessageas we only use it internally. - The second line handles the error result
- The third one handles other
Messagevariants. There are two currently,Message::DealandMessage:Aggregate. We treat results other thanMessage::Dealas errors, as we don't expect the DKG to be ready to aggregate at this point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of PR:
Required reviews:
What this does:
DkgValidatorwithValidatorIssues fixed/closed:
Why it's needed:
Notes for reviewers: