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

Remove Groth16/SnarkPack+. #774

Merged
merged 3 commits into from
Oct 21, 2023
Merged

Remove Groth16/SnarkPack+. #774

merged 3 commits into from
Oct 21, 2023

Conversation

porcuquine
Copy link
Contributor

@porcuquine porcuquine commented Oct 19, 2023

This PR removes support for Groth16/SnarkPack+. Now that we have SuperNova, we no longer needed the vestigial original backend in order to preserve and demonstrate multiple backend support. Moreover, the differences in capabilities and interfaces between the folding and proof-aggregation based backends have become a source of friction and maintenance overhead.

This removal will allow us to extend the Prover trait to more fully cover the range of behaviors provided by both Nova and SuperNova.

Although it could have been removed outright, for the time being I left the BLS12-381 uses related to field genericity, so we continue to exercise it. However, this likely should be dropped in the future when that need is otherwise met. This will allow dropping the blstrs dependency.

With some more work, we can and should also remove the bellpepper_core::Circuit implementation for MultiFrame. It's no longer required for creating proofs, so is somewhat confusing. It is, however, still used in some value-providing tests.

@porcuquine porcuquine marked this pull request as ready for review October 19, 2023 01:05
@porcuquine porcuquine requested review from a team as code owners October 19, 2023 01:05
arthurpaulino
arthurpaulino previously approved these changes Oct 19, 2023
Copy link
Contributor

@arthurpaulino arthurpaulino left a comment

Choose a reason for hiding this comment

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

Great simplification 🙏🏼.
According to the PR description, there seems to be a few issues to be written upon merging this.

samuelburnham
samuelburnham previously approved these changes Oct 20, 2023
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

  • Please remove bellperson and memmap as dependencies,
  • please remove crate::proof::verify_sequential_css,

Otherwise this looks pretty good!

@porcuquine porcuquine requested a review from a team as a code owner October 20, 2023 19:57
@porcuquine porcuquine enabled auto-merge October 20, 2023 19:57
lurk-lib Outdated Show resolved Hide resolved
@porcuquine
Copy link
Contributor Author

Hmmmm, this is now failing on the computed constraint count in the LEM test_values test. I updated the hardcoded one but don't know how to update the computed equivalent.

It's not obvious to me why this is suddenly showing up now, especially since I thought LEM circuit generation was self-contained.

@arthurpaulino @gabriel-barrett Any ideas?

@arthurpaulino
Copy link
Contributor

arthurpaulino commented Oct 21, 2023

AAh! The cost of BitDecomp slots varies according to the field used.

For more context: we count constraints in two ways. There's the normal way, synthesizing a circuit with a blank frame and then using the API to get the number of constraints. And we count constraints with a function that also serves as a live documentation for how the number of constraints in a LEM grows.

Both counts must match the hardcoded value.

@arthurpaulino arthurpaulino force-pushed the remove-snarkpack branch 2 times, most recently from fc90ebd to e74150d Compare October 21, 2023 11:13
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Goodbye, Groth16 👋

@@ -18,7 +18,6 @@ base64 = { workspace = true }
base-x = "0.2.11"
Copy link
Contributor

Choose a reason for hiding this comment

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

The removal of memmap isn't there, but I think it doesn't matter as #777 is about to re-introduce it.

let bit_decomp_cost = match F::FIELD {
LanguageField::Pallas => 298,
LanguageField::Vesta => 301,
LanguageField::BLS12_381 => 388,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this still a thing if we remove BLS12-381. If there are leftover bits that are not here just for testing, could we list them in an issue @arthurpaulino ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not fully aware of all the places BLS12-381 can be found. This one is easy because LanguageField is defined in lurk::field, which is pretty central

@porcuquine porcuquine added this pull request to the merge queue Oct 21, 2023
Merged via the queue into master with commit a56d972 Oct 21, 2023
10 of 12 checks passed
@porcuquine porcuquine deleted the remove-snarkpack branch October 21, 2023 14:12
huitseeker added a commit to huitseeker/lurk-rs that referenced this pull request Nov 3, 2023
- Follow-up of lurk-lab#774
- Swapped out `blstrs::Scalar` implementation in `src/field.rs` with pasta_curves::pallas::Scalar
- Readjusted tests to now run on the `pasta_curve` as opposed to the `blstrs`
- Updated `Cargo.toml` by removing `blstrs` from both the workspace and dev dependencies
- Removed the association of `blstrs/portable` from the `portable` feature in `Cargo.toml`
github-merge-queue bot pushed a commit that referenced this pull request Nov 3, 2023
)

* chore:: Refactor field tests to use pasta_curves instead of blstrs

- Follow-up of #774
- Swapped out `blstrs::Scalar` implementation in `src/field.rs` with pasta_curves::pallas::Scalar
- Readjusted tests to now run on the `pasta_curve` as opposed to the `blstrs`
- Updated `Cargo.toml` by removing `blstrs` from both the workspace and dev dependencies
- Removed the association of `blstrs/portable` from the `portable` feature in `Cargo.toml`

* refactor: Remove BLS12-381 support from the LanguageField enum

- Removed `BLS12_381` option across the project, affecting the enumeration of `LanguageField`, use in `src/lem/circuit.rs`, and representation in `src/cli/mod.rs`.
- Updated test and benchmarking data in `src/field.rs` and `end2end_lem.rs` to reflect these changes.
- Reestructured  `src/cli/circom.rs` directory for simplicity and updated the logic generating `r1cs` and `witness`.
- Removed "bls" feature from neptune in Cargo.toml, and updated documentation in README.md to reflect these changes.
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.

4 participants