feat(crypto): CRP-2609 Introduce master key ID variant for vetKD - #2108
Merged
fspreiss merged 16 commits intoOct 29, 2024
Conversation
Sawchord
reviewed
Oct 18, 2024
eichhorl
reviewed
Oct 18, 2024
fspreiss
marked this pull request as ready for review
October 24, 2024 08:13
mraszyk
approved these changes
Oct 24, 2024
aterga
approved these changes
Oct 24, 2024
adambratschikaye
approved these changes
Oct 24, 2024
eichhorl
reviewed
Oct 28, 2024
eichhorl
approved these changes
Oct 28, 2024
eichhorl
reviewed
Oct 28, 2024
rumenov
approved these changes
Oct 29, 2024
maksymar
reviewed
Oct 29, 2024
maksymar
approved these changes
Oct 29, 2024
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 29, 2024
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 29, 2024
fspreiss
deleted the
franzstefan/CRP-2609-introduce-vetkd-master-key-id
branch
October 29, 2024 14:49
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.
Adds a variant for vetKD in the
MasterPublicKeyIdin theregistry protobuf definitions,
where it is used in the
KeyConfig(which is used in theChainKeyConfig, which is used in theSubnetRecord).management canister types,
where it is used in the
ComputeInitialIDkgDealingsArgs(which will be generalized in a later step, e.g., toReshareChainKeyArgs).registry canister API (registry.did),
where it is used in the
KeyConfig(which is used in theKeyConfigRequest, which is used in theInitialChainKeyConfig, which is used inCreateSubnetPayloadandRecoverSubnetPayload), and in theUpdateSubnetPayload'schain_key_signing_enable/chain_key_signing_disable.This is the very first step for the vetKeys feature.
As discussed with the Consensus team, various consensus tests related to pre-signatures are adapted so that the tests panic if the vetKD variant is used, because vetKD doesn't have pre-signatures.
Registry API backwards-compatibility
The changes in the registry canister API should be safe/backwards-compatible based on the following argumentation (see Can I add a variant alternative?):
The
MasterPublicKeyIdvariant inregistry.didis extended with a new alternative as follows:This variant is used in two places:
key_idis optional.chain_key_signing_enableandchain_key_signing_disableare not (directly) optional variant fields (because they are contained in avec), adding the alternative is safe, given that theMasterPublicKeyIdvariant is only ever used (as part ofUpdateSubnetPayload) in method arguments but never as method result.This argumentation is also supported by the fact that the
//rs/registry/canister:registry-canister_did_git_testtest passes.Registry protobuf backwards-compatibility
The changes in the registry protocol buffer definitions is backwards-compatible. On the one hand, adding a new field to a
oneofis generally backward-compatible in Protocol Buffers (with some nuances that are not relevant here). On the other hand, the new field/variant in theMasterPublicKeyIdis not yet written by any code, and this new variant won't be written for many weeks to come. In particular, it will only be written to the registry once subnets will actually hold master public keys for vetKD, which will only happen in 2025.Crypto Algorithm ID
For the time being, we don't need a particular
AlgorithmIdfor vetKD, so we use theAlgorithmId::Placeholder. In any case, the exact algorithm also doesn't matter for now because neither the intended Crypto APIs will use an algorithm ID nor will this algorithm be persisted anywhere (e.g., in the registry or in a key store).