Skip to content

DKG Finalization Optimizations#3328

Open
cronokirby wants to merge 7 commits intock/lin_comb_evalfrom
ck/dkg_finalize_opts
Open

DKG Finalization Optimizations#3328
cronokirby wants to merge 7 commits intock/lin_comb_evalfrom
ck/dkg_finalize_opts

Conversation

@cronokirby
Copy link
Collaborator

Stacked on top of #3312.

Closes #2536.
Closes #3212.

This adds a new structure for containing dealer logs, allowing them to be verified in advance.

We also implement optimizations for a given dealer, batching signature checks, and reveal checks.

One big win is implementing parallelism to check multiple dealers at once (while preserving the order we select dealers in), which allows the method to actually scale, whereas it was bottlenecked previously.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp f85722d Mar 06 2026, 11:16 PM

@cronokirby cronokirby changed the title Ck/dkg finalize opts DKG Finalization Optimizations Mar 6, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2026

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: f85722d
Status: ✅  Deploy successful!
Preview URL: https://540a7e0d.monorepo-eu0.pages.dev
Branch Preview URL: https://ck-dkg-finalize-opts.monorepo-eu0.pages.dev

View logs

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}
let selection = logs
.clone()
.select::<ed25519::Batch>(&info, &mut rng, &Sequential);
Copy link

Choose a reason for hiding this comment

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

Shared mutable RNG across test assertions may cause nondeterminism

Low Severity

The test's rng is now mutably shared across select, observe, and multiple finalize calls in a loop. Each call consumes RNG state for batch verification, changing downstream randomness. Previously, select and observe didn't take &mut rng, so the RNG stream was unaffected. Now, the number of RNG draws varies depending on the number of dealers/reveals, making the test's determinism fragile — future changes to batch verification internals could shift the RNG state and alter subsequent test behavior.

Additional Locations (2)

Fix in Cursor Fix in Web

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's still deterministic though, even if "fragile" which is fine, it's random.

@cronokirby cronokirby self-assigned this Mar 6, 2026
@cronokirby cronokirby moved this to Ready for Review in Tracker Mar 6, 2026
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

❌ Patch coverage is 92.09040% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.03%. Comparing base (ddcb81d) to head (f85722d).

Files with missing lines Patch % Lines
cryptography/src/bls12381/dkg.rs 91.71% 8 Missing and 6 partials ⚠️
@@                 Coverage Diff                  @@
##           ck/lin_comb_eval    #3328      +/-   ##
====================================================
- Coverage             93.03%   93.03%   -0.01%     
====================================================
  Files                   418      418              
  Lines                143564   143686     +122     
  Branches               3435     3442       +7     
====================================================
+ Hits                 133571   133682     +111     
- Misses                 8900     8907       +7     
- Partials               1093     1097       +4     
Files with missing lines Coverage Δ
cryptography/src/bls12381/scheme.rs 69.95% <100.00%> (+5.62%) ⬆️
cryptography/src/ed25519/scheme.rs 97.00% <100.00%> (+0.02%) ⬆️
cryptography/src/bls12381/dkg.rs 92.53% <91.71%> (-0.10%) ⬇️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddcb81d...f85722d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

1 participant