Skip to content

Conversation

@waamm
Copy link
Collaborator

@waamm waamm commented Feb 5, 2026

Description

  • Adds a custom arkworks::batch_mul() that avoids premature normalization
  • Uses this for chunky dealing
  • Changes SCRAPE to use affine elements rather than projective (so it doesn't do an unnecessary batch_normalize)
  • Add CodomainNormalized associated type and normalize() method to homomorphism::Trait
  • Add batch_normalize() method to fixed_base_msms::Trait
  • Merged chunky and chunky_v2's Subtranscript since they are identical
  • Moved FirstProofItem and Proof from sigma_protocol/traits.rs into a separate file
  • Changed the tables in PublicParameters in chunked_elgamal_pp.rs‎ to use Arc<BatchMulPreprocessing<C>> rather than Option<BatchMulPreprocessing<C>>; this fixes potential issues with e.g. cloning such public parameters.
  • Fix to decrypt-share bench, to ensure the weights are nonzero
  • Made the transcripts of chunky and chunky_v2 almost entirely affine (rather than projective)
  • Fixed bugs in Zeromorph (had not been tested before, was only used for benchmarking)
  • Added Zeromorph tests (ported from jolt-core)

Benchmarks show that:

  • Dealing became ~2x faster.
  • Serialization became ~40-90x faster.
  • Verification about ~5% faster.

How Has This Been Tested?

  • Existing tests
  • Zeromorph now has tests

Key Areas to Review

I'm not too familiar with the fptx and dkg code, I hope the changes there are correct.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other: almost all of this code is not yet in use, only the few lines in the dkg part

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Note

Medium Risk
Touches cryptographic proof/commitment and PVSS transcript code paths (normalization, serialization, aggregation, and Zeromorph verification), where subtle mistakes can break correctness or soundness despite being performance-motivated.

Overview
Improves performance of PVSS chunky dealing and transcript handling by introducing a custom arkworks::batch_mul() that avoids early batch normalization, precomputing/reusing BatchMulPreprocessing tables (now Arc-backed), and moving transcript fields largely to affine representations with explicit projective aggregation + final normalization.

Refactors the sigma protocol/homomorphism stack to distinguish projective vs canonical forms via CodomainNormalized and normalize(), adds batch_normalize() to fixed_base_msms::Trait, updates Fiat–Shamir and verification paths to operate on normalized statements/commitments, and extracts Proof/FirstProofItem into a dedicated module.

Fixes correctness/ergonomics issues around aggregation and verification: SCRAPE LDT now consumes affine bases (removing redundant normalization), the decrypt-share bench avoids zero-weight/invalid players, weighted transcript aggregation uses projective accumulation then normalizes, and Zeromorph is corrected to align variable ordering/blinding and now has a full test suite (ported from jolt-core).

Written by Cursor Bugbot for commit 6697cea. This will update automatically on new commits. Configure here.

@waamm waamm marked this pull request as ready for review February 8, 2026 01:42
@waamm waamm requested a review from ibalajiarun February 8, 2026 01:42
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.

@waamm waamm enabled auto-merge (squash) February 9, 2026 22:24
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Forge suite compat success on 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11

Compatibility test results for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11 (PR)
1. Check liveness of validators at old version: 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9
compatibility::simple-validator-upgrade::liveness-check : committed: 13190.13 txn/s, latency: 2641.34 ms, (p50: 2700 ms, p70: 3000, p90: 3300 ms, p99: 3700 ms), latency samples: 437400
2. Upgrading first Validator to new version: 6697cea829b6b8343236985c46229d4155b3be11
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 6126.64 txn/s, latency: 5501.37 ms, (p50: 6100 ms, p70: 6200, p90: 6200 ms, p99: 6300 ms), latency samples: 213260
3. Upgrading rest of first batch to new version: 6697cea829b6b8343236985c46229d4155b3be11
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 6328.29 txn/s, latency: 5302.04 ms, (p50: 5800 ms, p70: 6000, p90: 6100 ms, p99: 6300 ms), latency samples: 213300
4. upgrading second batch to new version: 6697cea829b6b8343236985c46229d4155b3be11
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 10344.19 txn/s, latency: 3157.25 ms, (p50: 3100 ms, p70: 3600, p90: 4300 ms, p99: 4600 ms), latency samples: 341780
5. check swarm health
Compatibility test for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11 passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Forge suite realistic_env_max_load success on 6697cea829b6b8343236985c46229d4155b3be11

two traffics test: inner traffic : committed: 13678.25 txn/s, latency: 2754.84 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3600 ms), latency samples: 5088040
two traffics test : committed: 99.98 txn/s, latency: 727.67 ms, (p50: 700 ms, p70: 800, p90: 900 ms, p99: 1000 ms), latency samples: 1720
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 2.265, avg: 2.175", "ConsensusProposalToOrdered: max: 0.169, avg: 0.166", "ConsensusOrderedToCommit: max: 0.044, avg: 0.041", "ConsensusProposalToCommit: max: 0.213, avg: 0.207"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.52s no progress at version 5246859 (avg 0.07s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.28s no progress at version 2347348 (avg 0.28s) [limit 16].
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Forge suite framework_upgrade success on 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11

Compatibility test results for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11 (PR)
Upgrade the nodes to version: 6697cea829b6b8343236985c46229d4155b3be11
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2311.28 txn/s, submitted: 2318.74 txn/s, failed submission: 7.46 txn/s, expired: 7.46 txn/s, latency: 1254.28 ms, (p50: 1200 ms, p70: 1500, p90: 1800 ms, p99: 2100 ms), latency samples: 210700
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 2391.13 txn/s, submitted: 2399.34 txn/s, failed submission: 8.21 txn/s, expired: 8.21 txn/s, latency: 1222.60 ms, (p50: 1200 ms, p70: 1200, p90: 1700 ms, p99: 2400 ms), latency samples: 215461
5. check swarm health
Compatibility test for 4adc789fc437d24d20d46d2b38fc3a81cd35d2b9 ==> 6697cea829b6b8343236985c46229d4155b3be11 passed
Upgrade the remaining nodes to version: 6697cea829b6b8343236985c46229d4155b3be11
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 1596.61 txn/s, submitted: 1602.58 txn/s, failed submission: 5.97 txn/s, expired: 5.97 txn/s, latency: 1836.46 ms, (p50: 1200 ms, p70: 1400, p90: 1700 ms, p99: 11500 ms), latency samples: 144301
Test Ok

@ibalajiarun ibalajiarun disabled auto-merge February 10, 2026 21:14
@ibalajiarun ibalajiarun merged commit 2e14690 into main Feb 10, 2026
92 checks passed
@ibalajiarun ibalajiarun deleted the wicher/change-dkg-stuff branch February 10, 2026 21:14
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.

3 participants