-
Notifications
You must be signed in to change notification settings - Fork 318
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
feat(crypto): CRP-2597 Extend NiDkgTag with HighThresholdForKey variant #2445
base: franzstefan/CRP-2597-move-masterpublickeyid-proto-to-types
Are you sure you want to change the base?
Changes from all commits
a4e5d35
808aa1d
9cb80e8
4461616
0ae9cdc
3a8675b
8c447fd
5e466de
b5343d6
64a7b7b
e0e60b9
26e2b6a
14fec1d
7339b90
7fda226
e98b7d8
dbaf13a
c51dc23
fce1c63
ac819a5
06f027f
6a5a578
07fb339
0c1c7a7
b17d8f9
ac37697
7cfe2f7
14cfb31
4fadc02
3ad52e4
770c4e4
cd99051
df71d3a
caccc55
4d167a8
348d4a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -507,6 +507,21 @@ pub(crate) fn get_configs_for_local_transcripts( | |
resharing_transcript.cloned(), | ||
) | ||
} | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// TODO: how to behave here? The code below is copied+adapted from the HighThreshold case. However, | ||
// this code currently won't be executed because we iterate over TAGS, which is a const that does not | ||
// and cannot contain an NiDkgTag::HighThresholdForKey entry | ||
/////////////////////////////////////////////////////////////////////////////// | ||
NiDkgTag::HighThresholdForKey(master_public_key_id) => { | ||
let resharing_transcript = reshared_transcripts | ||
.get(&NiDkgTag::HighThresholdForKey(master_public_key_id.clone())); | ||
( | ||
resharing_transcript | ||
.map(|transcript| transcript.committee.get().clone()) | ||
.unwrap_or_else(|| node_ids.clone()), | ||
resharing_transcript.cloned(), | ||
) | ||
} | ||
Comment on lines
+510
to
+524
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the behavior is correct (maybe it could even be combined with the |
||
}; | ||
let threshold = | ||
NumberOfNodes::from(tag.threshold_for_subnet_of_size(node_ids.len()) as u32); | ||
|
@@ -1206,9 +1221,13 @@ mod tests { | |
assert_eq!(conf.max_corrupt_dealers().get(), 2); | ||
assert_eq!( | ||
conf.threshold().get().get(), | ||
match *tag { | ||
match tag { | ||
NiDkgTag::LowThreshold => 3, | ||
NiDkgTag::HighThreshold => 5, | ||
///////////////////////////////////////// | ||
// TODO: check with Consensus team | ||
NiDkgTag::HighThresholdForKey(_) => panic!("not applicable"), | ||
///////////////////////////////////////// | ||
Comment on lines
+1227
to
+1230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can link CON-1417 to extend this test once we have support for vet key transcripts in registry CUPs |
||
} | ||
); | ||
} | ||
|
@@ -1311,9 +1330,13 @@ mod tests { | |
assert_eq!(conf.max_corrupt_dealers().get(), 2); | ||
assert_eq!( | ||
conf.threshold().get().get(), | ||
match *tag { | ||
match tag { | ||
NiDkgTag::LowThreshold => 3, | ||
NiDkgTag::HighThreshold => 5, | ||
///////////////////////////////////////// | ||
// TODO: check with Consensus team | ||
NiDkgTag::HighThresholdForKey(_) => panic!("not applicable"), | ||
///////////////////////////////////////// | ||
} | ||
Comment on lines
+1336
to
1340
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can link CON-1413 to extend this test once we can create local transcript configs for vetKeys that were requested by registry |
||
); | ||
|
||
|
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.
I think the idea here is to reuse the
transcripts_for_remote_subnets
field also for xnet reshares of VetKD keys. So then we would generalize this function such that it can generate the correctConsensusResponse
, depending on whether the callback ID is for a SetupInitialDKG context or a VetKD reshare context.For now, logging an error and linking the ticket to generalize this function (CON-1416) should be fine.