Skip to content

Patch5#3

Open
lovesh wants to merge 5 commits into
polymeshfrom
patch5
Open

Patch5#3
lovesh wants to merge 5 commits into
polymeshfrom
patch5

Conversation

@lovesh

@lovesh lovesh commented May 18, 2026

Copy link
Copy Markdown
  • Align GBP polynomial degrees with the audit report published by Monero
  • Include the size of each vector commitment in the transcript
  • Include challenge generators in dlog gadget
  • Fix bug in multi_select gadget
  • Removed unused code
  • Skip unneccesary terms from poly product
  • Use JSF for scalar mult. in inner product
  • Remove redundant curve check constraint
  • Remove unneccessary check divisor creation
  • Cache evaluations of curve poly along the interpolator
  • Other misc. optimizations like removing allocations
  • More tests, including mocking and some docs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR ("Patch5") is a broad maintenance/refactor pass spanning the relations, bulletproofs, ark-ec-divisors, and ark-dlog-gadget crates. The bulk of the changes turn previously-panicking gadget functions into Result-returning ones (new Error::NeedNonZeroSetSize variant, propagation through multi_select*, select*, single-level and curve-tree prover/verifier paths) and update the test suite accordingly. The bulletproofs prover and verifier are also reworked so the transcript binds the number and sizes of vector commitments, and the polynomial-degree arithmetic is factored into shared helpers (degree, t_poly_degree, transmitted_t_degree_indices). The divisor and barycentric code is reorganized and lightly re-documented; a new to_poly method, compute_modulus relocation, and normalize_x_coefficient move are the substantive moves.

Changes:

  • Threaded Result/Error::NeedNonZeroSetSize through select / multi-select / curve-tree gadgets and bumped tests to .unwrap() the new results.
  • Bound vector-commitment counts and sizes into the bulletproofs Fiat-Shamir transcript (prover, verifier, and dlog gadget) and refactored VerificationTuple::padded_n to return Result.
  • Refactored divisor (compute_modulus/to_poly/normalize_x_coefficient relocation), barycentric weight computation, and commented-out (rather than removed) several utility polynomial types in bulletproofs/src/util.rs.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 27 comments.

Show a summary per file
File Description
relations/tests/curve_tree.rs, ped_comm_group_elems.rs, common/mod.rs, batched_curve_tree.rs Tests updated for new Result-returning gadgets and added into_group() to get_leaf comparisons
relations/src/error.rs New NeedNonZeroSetSize variant
relations/src/select.rs Replaced assert!/panic-based gadgets with Result, added multi_select_public_set, factored construct_* helpers, added new tests
relations/src/single_level_select_and_rerandomize.rs Functions now return Result<(), Error>
relations/src/{prover,verifier}.rs ? propagation for new Result returns
relations/src/curve_tree_{prover,verifier}.rs Threaded Result through prover/verifier non-root processing; introduced result collection around rayon::join
relations/src/batched_*.rs Same Result propagation for batched paths
relations/Cargo.toml, Cargo.toml Added ark-poly workspace dependency
bulletproofs/src/r1cs/{prover,verifier/mod,verifier/batch,proof,mod}.rs New transcript bindings, degree-helpers, padded_n returns Result, removed second-phase assertion
bulletproofs/src/util.rs Commented-out (not deleted) VecPoly1, VecPoly3, Poly2, Poly6, sum_of_powers etc.; coeff renamed to coeff_mut
bulletproofs/tests/r1cs.rs, r1cs_vec.rs Added randomized shuffle test, padded_n failure tests; removed deref on *n/*x (likely breaks compilation)
bulletproofs/generalized-bulletproofs.md Replaced \color{} with \textcolor{}, spelling/formatting fixes
ark-ec-divisors/src/{lib,divisor,poly,barycentric,scalar_decomposition,curves/tests}.rs Refactor: moved compute_modulus/to_poly/normalize_x_coefficient; reworked barycentric weights + evaluation; doc edits
ark-dlog-gadget/src/dlog.rs Append additional challenge-point components and per-bit beta to transcript (proof-format change)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread relations/src/curve_tree_prover.rs Outdated
Comment thread bulletproofs/tests/r1cs.rs
Comment thread bulletproofs/tests/r1cs.rs Outdated
Comment thread bulletproofs/tests/r1cs.rs Outdated
Comment thread bulletproofs/src/util.rs Outdated
Comment thread bulletproofs/src/r1cs/prover.rs Outdated
Comment thread ark-ec-divisors/src/lib.rs Outdated
Comment thread relations/src/curve_tree_prover.rs Outdated
Comment thread relations/src/curve_tree_verifier.rs
Comment thread relations/src/select.rs
…t, allowing randomized constraints, adding missing values to transcript in GBP and dlog gadget and some docs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants