Skip to content

Relax DKG ceremony constraints#173

Merged
cygnusv merged 8 commits intonucypher:mainfrom
piotr-roslaniec:relax-dkg-ceremony
Feb 22, 2024
Merged

Relax DKG ceremony constraints#173
cygnusv merged 8 commits intonucypher:mainfrom
piotr-roslaniec:relax-dkg-ceremony

Conversation

@piotr-roslaniec
Copy link
Copy Markdown

@piotr-roslaniec piotr-roslaniec commented Jan 31, 2024

Type of PR:

  • Feature

Required reviews:

  • 1

What this does:

  • DKG now operates under relaxed ceremony constraints, where instead of n-of-m we allow for n-of-[m, validators.len()] to be considered a successful ceremony
  • In this new regime, the old shares_num is effectively replaced by validators.len(), and from now on shares_num denotes the minimum number of shares (or validators) that the DKG ceremony accommodates

Issues fixed/closed:

Notes for reviewers:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 31, 2024

Codecov Report

Attention: 51 lines in your changes are missing coverage. Please review.

Comparison is base (72b8484) 78.28% compared to head (6b90715) 78.17%.
Report is 1 commits behind head on main.

Files Patch % Lines
ferveo/src/bindings_python.rs 65.11% 45 Missing ⚠️
ferveo/src/bindings_wasm.rs 0.00% 5 Missing ⚠️
ferveo/src/dkg.rs 98.21% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
- Coverage   78.28%   78.17%   -0.11%     
==========================================
  Files          24       24              
  Lines        5066     5224     +158     
==========================================
+ Hits         3966     4084     +118     
- Misses       1100     1140      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@piotr-roslaniec piotr-roslaniec force-pushed the relax-dkg-ceremony branch 6 times, most recently from 550b198 to 175dda7 Compare February 1, 2024 12:41
@piotr-roslaniec piotr-roslaniec marked this pull request as ready for review February 1, 2024 16:26
@cygnusv cygnusv changed the base branch from main to fix-py-stub February 5, 2024 17:34
@cygnusv cygnusv changed the base branch from fix-py-stub to main February 5, 2024 17:35
shares_num=shares_num,
validators_num=validators_num,
threshold=threshold,
shares_to_use=validators_num - 1,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
shares_to_use=validators_num - 1,
shares_to_use=threshold - 1,

pub fn verify(
&self,
shares_num: u32,
validators_num: u32,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It should be possible to verify any subset of size shares_num, but I guess you still need the original number of validators to get the proper evaluation domain, so it seems both parameters are needed?

fn test_server_api_tdec_precomputed(shares_num: u32, validators_num: u32) {
let rng = &mut StdRng::seed_from_u64(0);

// In precomputed variant, the security threshold is equal to the number of shares
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Precomputed variant comment, definitely not for this PR. Opened #184

dkg.aggregate_transcripts(not_enough_messages).unwrap();
let result = insufficient_aggregate.verify(SHARES_NUM, &messages);
let result = insufficient_aggregate.verify(validators_num, &messages);
assert!(result.is_err());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure this should fail only because the number of transcripts is insufficient. This test is probably expecting a failure due to an unrelated issue.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I rewrote assertions in these tests to provide more clarity on what is being checked.

@piotr-roslaniec piotr-roslaniec force-pushed the relax-dkg-ceremony branch 3 times, most recently from 6b90715 to 7d8dfde Compare February 22, 2024 08:43
@piotr-roslaniec piotr-roslaniec force-pushed the relax-dkg-ceremony branch 3 times, most recently from 99f0dad to 626159f Compare February 22, 2024 09:32
Copy link
Copy Markdown
Member

@cygnusv cygnusv left a comment

Choose a reason for hiding this comment

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

@piotr-roslaniec and I decided to move forward for the moment, but my comments in the review are still outstanding. Some of them only require light touches to tests (mainly those related to #179), while others require a bit more of work. Comments related to the precomputed variant are also outstanding (see #184) but are not a priority.

@cygnusv cygnusv merged commit a438438 into nucypher:main Feb 22, 2024
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.

Relax DKG ceremony constraints

3 participants