Skip to content
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

chore(CON-1412): Avoid handling VetKdKeyIds in the IDKG component #2388

Merged
merged 28 commits into from
Nov 15, 2024

Conversation

Sawchord
Copy link
Contributor

@Sawchord Sawchord commented Nov 1, 2024

This is a PR to secure, that the IDKG protocol can only be invoked with IDKG compatible variants of the MasterPublicKeyId.

It does so by introducing a new type IDkgMasterPublicKeyId, which wraps MasterPublicKeyId and assures, that only an IDKG compatible variant is uses (Either ::Schnorr or ECDSA).
Then it changes the type at some places in the code and then makes changes upstream, such that the Key only needs to be checked once, and from then on it is guaranteed to be IDKG compatible key.

The newly introduced ::VetKD variant necessitates the introduction of this change. The VetKeys will be using the NiDKG protocol for its key generation, and therefore, a lot of the functions in the consensus::idkg submodule don't make sense to be used with the new variant.

The keys get transformed back into MasterPublicKeyId for serialization, so this change does not introduce compatibility issues.
When deserializing a IDkgMasterPublicKeyId, we need to check that it is IDKG compatible and reject otherwise. Since we did not introduce VetKeys yet (and in fact lack the code to do so), there can be no ::VetKD variants of MasterPublicKeyId yet in the state.

@Sawchord Sawchord changed the title Leon/no vetkeys in idkg chore(COn-1412): Avoid handling VetKdKeyIds in the IDKG component Nov 12, 2024
@github-actions github-actions bot added the chore label Nov 12, 2024
@Sawchord Sawchord changed the title chore(COn-1412): Avoid handling VetKdKeyIds in the IDKG component chore(CON-1412): Avoid handling VetKdKeyIds in the IDKG component Nov 12, 2024
Copy link
Contributor

@maksymar maksymar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for execution part.

Copy link
Contributor

@alin-at-dfinity alin-at-dfinity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicated state changes LGTM.

@Sawchord Sawchord added this pull request to the merge queue Nov 15, 2024
Merged via the queue into master with commit 87270d9 Nov 15, 2024
25 checks passed
@Sawchord Sawchord deleted the leon/no_vetkeys_in_idkg branch November 15, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants