Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make sure tests compile on Wasm properly #237

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

huitseeker
Copy link
Contributor

@huitseeker huitseeker added this pull request to the merge queue Jan 5, 2024
Merged via the queue into lurk-lang:dev with commit 0dc7963 Jan 5, 2024
9 checks passed
@huitseeker huitseeker deleted the wasm_compilation branch January 5, 2024 16:18
huitseeker added a commit to huitseeker/arecibo that referenced this pull request Jan 14, 2024
…n `ProverKey` (lurk-lang#66) (lurk-lang#237)

* fix: remove a duplicate `R1CSShape` in the `RelaxedR1CSSNARK`'s chosen `ProverKey`

As explained by @zaverucha in microsoft/Spartan2#2 (with edits for precision):

The `R1CSShape` object was being stored in both:
- the `ProverKey` of the `spartan::direct::DirectSNARK`, which generically employs any instance of `RelaxedR1CSSNARKTrait`,
- the `ProverKey` of each of the two `RelaxedR1CSSNARKTrait` implementations in `spartan::{snark, ppsnark}::RelaxedR1CSSNARK`,
- the `PublicParams` that are passed to the `crate::CompressedSNARK<G1, G2, C1, C2, S1, S2>`, which generically employs any instance of `RelaxedR1CSSNARKTrait`.

IOW, `RelaxedR1CSSNARKTrait` is always accessed through generic structs (`DirectSNARK`, `CompressedSNARK`) which already have a copy of the relevant R1CSSHape. Westore it once in the top level object (RelaxedR1CSSNARKTrait) and pass it to the Spartan implementation.

This saves memory and makes serialization of the ProverKey about twice as fast. Both are significant when there are a large number of constraints.

* refactor: rename check_regular_shape into is_regular_shape
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