Skip to content

Conversation

@ashWhiteHat
Copy link
Contributor

Hi there

I found some methods that can be improved.

  • r1cs is_valid closure
  • provider cpu_best_multiexp

is_valid
This closure checks whether r1cs matrix row is in range and returns error if invalid.
I modified it and made it returning Err without using is_err().

cpu_best_multiexp
According to rayon doc, parallel iterators are more efficient than scope.
I replaced scope with parallel iterations.
I also avoided unnecessary initialization.

I would appreciate it if you could confirm.
Thank you.

@srinathsetty srinathsetty merged commit abd43bd into microsoft:main Oct 30, 2023
huitseeker added a commit to huitseeker/Nova that referenced this pull request Nov 6, 2023
* refactor r1cs::is_valid and provider::cpu_best_multiexp (microsoft#240)

* refactor: r1cs is valid

* refactor: msm parallel iteration

* chore: fix clippy

* Expose verifier key's digest with a trait (microsoft#243)

* Expose verifier key's digest with a trait

* run cargo fmt and clippy

* use rayon to compute in parallel (microsoft#245)

* Eliminate unnecessary wraps & use alloc_infallible (microsoft#246)

* feat: Refactor unnecessary wraps in error handling

Revised operations unnecessarily wrapping their return in a Result.

* refactor: Refactor to use infallible allocation across application

- Switched the allocation method to the infallible version, `AllocatedNum::alloc_infallible`, in multiple units (`poseidon.rs`, `bellpepper/mod.rs`, `utils.rs`, `circuit.rs`, `lib.rs`, `nifs.rs`).
  This removed the need for multiple error checks and reduced usage of `Result` return types.

* release 0.27.0 (microsoft#247)

* Reduce hashing costs with a power polynomial in ppsnark (microsoft#248)

* use eq polynomial emulated via power polynomial, to reduce hashing costs

* update version

* add missing file

* Optimize ppsnark (microsoft#250)

* update ppsnark to be more efficient

* remove

* clippy

* use padded

* rayon

* additional rayon

* update version

---------

Co-authored-by: ashWhiteHat <phantomofrotten@gmail.com>
Co-authored-by: Jiaxing Zhao <mrls1219@mail.ustc.edu.cn>
Co-authored-by: Srinath Setty <srinath@microsoft.com>
huitseeker added a commit to huitseeker/Nova that referenced this pull request Jan 11, 2024
* removing uneeded bound(s) on struct in src/r1cs/util.rs

* removing uneeded bound(s) on struct in src/traits/circuit.rs

* removing uneeded bound(s) on struct in src/lib.rs

* removing uneeded bound(s) on struct in src/provider/ipa_pc.rs

* removing uneeded bound(s) on struct in src/provider/pedersen.rs

* removing uneeded bound(s) on struct in src/provider/kzg_commitment.rs

* removing uneeded bound(s) on struct in src/digest.rs

* removing uneeded bound(s) on struct in src/supernova/test.rs

* removing uneeded bound(s) on struct in src/supernova/circuit.rs

* removing uneeded bound(s) on struct in src/supernova/snark.rs

* removing uneeded bound(s) on struct in src/spartan/polys/eq.rs

* removing uneeded bound(s) on struct in src/spartan/polys/masked_eq.rs

* removing uneeded bound(s) on struct in src/spartan/polys/univariate.rs

* removing uneeded bound(s) on struct in src/spartan/polys/power.rs

* removing uneeded bound(s) on struct in src/spartan/polys/identity.rs

* removing uneeded bound(s) on struct in src/spartan/polys/multilinear.rs

* removing uneeded bound(s) on struct in src/gadgets/nonnative/bignat.rs
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