perf(crypto): avoid some unnecessary clones#10014
Merged
pierugo-dfinity merged 17 commits intomasterfrom Apr 29, 2026
Merged
Conversation
2cb340a to
90e517a
Compare
Arc<Mutex<_>>s
randombit
approved these changes
Apr 24, 2026
Contributor
randombit
left a comment
There was a problem hiding this comment.
Looks good to me thanks @pierugo-dfinity
PS this means you're now in charge of NIDKG, take care of her! :)
eichhorl
approved these changes
Apr 27, 2026
Contributor
|
Maybe we should enable redundant_clone and needless_pass_by_value clippy lints (at least in the CON owned crates). Some of these cloned you're removing should be caught by them |
Contributor
Author
|
@eichhorl PTAnotherL, I also adapted the transcript creation in data blocks after merging master. |
eichhorl
approved these changes
Apr 29, 2026
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.
I recommend reviewing by commit:
payload_verifier.rs: avoid clones for which we only need borrows anywaysbatch_delivery.rs: avoid cloning the internal transcripts as we do not need ownership when converting to protobuf.NiDkgAlgorithm::create_transcriptto now take ownership of the dealings which allows to avoid a second clone down the stack. This comes for free from a Consensus perspective.IDkgProtocol::create_transcriptto now take ownership of the dealings which allows to avoid cloning them and the commitments down the stack. This also positively affectsverify_transcript. This also comes for free from Consensus.