Skip to content

error handling for batch#2

Merged
Neopallium merged 1 commit into
polymeshfrom
patch4.2
May 7, 2026
Merged

error handling for batch#2
Neopallium merged 1 commit into
polymeshfrom
patch4.2

Conversation

@lovesh

@lovesh lovesh commented May 7, 2026

Copy link
Copy Markdown

No description provided.

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 improves robustness of R1CS batch verification by making VerificationTuple::padded_n fallible and propagating errors (?) through the verifier and batch verifier paths, instead of implicitly relying on arithmetic that can underflow on malformed inputs.

Changes:

  • Made VerificationTuple::padded_n return Result<u32, R1CSError> and added a checked subtraction to avoid underflow.
  • Updated verifier and batch verifier codepaths to propagate padded_n() errors with ?.
  • Added ToString import to support error construction.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
bulletproofs/src/r1cs/verifier/mod.rs Makes padded_n() fallible and updates verifier helpers to propagate errors.
bulletproofs/src/r1cs/verifier/batch.rs Updates batch verification routines to handle fallible padded_n() via ?.

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

Comment thread bulletproofs/src/r1cs/verifier/mod.rs Outdated
Comment thread bulletproofs/src/r1cs/verifier/mod.rs Outdated
Comment thread bulletproofs/src/r1cs/verifier/mod.rs
Comment thread bulletproofs/src/r1cs/verifier/mod.rs
@Neopallium Neopallium merged commit f77c6a3 into polymesh May 7, 2026
2 checks passed
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