-
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
Draft
fspreiss
wants to merge
31
commits into
franzstefan/CRP-2597-move-masterpublickeyid-proto-to-types
Choose a base branch
from
franzstefan/CRP-2597-extend-nidkg-tag-with-keyid-variant
base: franzstefan/CRP-2597-move-masterpublickeyid-proto-to-types
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+468
−88
Conversation
This file contains 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
fspreiss
changed the base branch from
franzstefan/CRP-2597-move-masterpublickeyid-proto-to-types-ontopof-non-copy-ni-dkg-id
to
franzstefan/CRP-2597-move-masterpublickeyid-proto-to-types
November 6, 2024 08:38
…r_public_key_when_parsing_proto
fspreiss
changed the title
feat(crypto): CRP-2597-extend-nidkg-tag-with-high-threshold-for-keyid-variant
feat(crypto): CRP-2597 Extend NiDkgTag with HighThresholdForKey variant
Nov 6, 2024
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.
Extends the
NiDkgTag
with a new variantNiDkgTag::HighThresholdForKey
that holds aMasterPublicKeyId
.Notes:
Makes the representation for
NiDkgTag
explicit with#[repr(isize)]
because a#[repr(inttype)]
must be provided on an enum if it has a non-unit variant with a discriminant (E0732). The representation should be the same as it was before, given thatisize
is the default representation for enums.Note that casting
NiDkgTag
withas
, e.g., toi32
or evenisize
is no longer possible because "anas
expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less" (see Enumeration casting and E0605).The conversion
impl TryFrom<i32> for NiDkgTag
had to be removed, because it is no longer possible, because ani32
itself is no longer sufficient for instantiating anNiDkgTag
.This conversion was used in two places: (1)
impl TryFrom<NiDkgIdProto> for NiDkgId
and (2)build_tagged_transcripts_map
. There, the conversion is now implemented directly.No longer Implements
EnumIter
forNiDkgTag
because this would require aDefault
implementation forMasterPublicKeyId
, which does not make sense, at least in production. Instead implementsEnumCount
.TODOs:
//rs/tests/consensus/orchestrator:cup_compatibility_test
failsNiDkgTag::HighThresholdForKey
vsNiDkgTag::HighThresholdForKeyId
optional
in new protobuf fields?: Rust struct definitions are the same#[allow(clippy::result_large_err)]
in crypto coders/crypto/src/sign/threshold_sig/store.rs