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

Add missing derive(Getters) for dkg::{round1, round2} #741

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

StackOverflowExcept1on
Copy link
Contributor

@StackOverflowExcept1on StackOverflowExcept1on commented Oct 1, 2024

Resolves #737

@StackOverflowExcept1on
Copy link
Contributor Author

@conradoplg could you take a look? real use cases:

  1. smart contract has in its storage round1_packages: BTreeMap<Identifier<C>, round1::Package<C>> and you as a participant want to remove your identifier from round1_packages: https://github.com/StackOverflowExcept1on/roast/blob/c31716b0eeefcaf6ab7029e7bb882334133c07c2/roast-core/src/dkg.rs#L311
  2. participant wants to execute dkg::part3(), but with a small difference - bad participants will be recorded in round2_culprits_set, and then passed to smart contract, so that it will apply sanctions to them (for example, take away deposit of bad DKG participants): https://github.com/StackOverflowExcept1on/roast/blob/c31716b0eeefcaf6ab7029e7bb882334133c07c2/roast-core/src/dkg.rs#L362

@conradoplg
Copy link
Contributor

Thanks! One question: why did you skip the coefficients field in particular?

@StackOverflowExcept1on
Copy link
Contributor Author

StackOverflowExcept1on commented Oct 7, 2024

I skipped the coefficients field because there is already a method that returns &[T] instead of &Vec<T>, which is a more correct type (see internal method pub fn coefficients(&self) -> &[Scalar<C>]). Unfortunately, in derive getters you can't choose a more correct type (e.g. u16 instead of &16).

@conradoplg
Copy link
Contributor

Ah of course, thanks

mergify bot added a commit that referenced this pull request Oct 7, 2024
@mergify mergify bot merged commit 16d527c into ZcashFoundation:main Oct 7, 2024
17 checks passed
@StackOverflowExcept1on StackOverflowExcept1on deleted the derive-getters branch October 7, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Derive Getters for frost_core::keys::dkg::round1::SecretPackage
2 participants