-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Adapts the `NiDkgTag`, and subsequently also the `NiDkgId` to be non-`Copy`. This is needed so that in a next step, for the vetKeys feature, we can extend the `NiDkgTag` with a variant that holds a `MasterPublicKeyId`, which is not `Copy` because it indirectly contains `name: String`. A consequence of making `NiDkgTag` and `NiDkgId` non-`Copy` is that we have to `clone` these structs at various places in the code. Compared to the cryptographic protocols in which the structs are used, the `clone`s are negligible, however. In the `NiDkgCspClient`, various `dkg_id: NiDkgId` parameters were unused, so they were directly removed to avoid unnecessary cloning. An alternative to making the `NiDkgTag` non-`Copy` would be to replace the `String` in the `MasterPublicKeyId` with a new struct that holds a length-limited byte array that represents the name, so that it can be kept `Copy` (similar to how this is done in the `ic_principal::Principal`). A downside of that approach is that proposals would fail silently if the permitted length is exceeded. Still, we could explore this option in the future. For now, the priority is to unblock the above-mentioned work of extending the `NiDkgTag` with a variant that holds a `MasterPublicKeyId`. If we later make the structs `Copy` again, the compiler will guide us in removing all the unnecessary clones (with `error: using clone on type NiDkgTag which implements the Copy trait`).
- Loading branch information
Showing
43 changed files
with
380 additions
and
429 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.