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

Epic: Rescope Nargo & NoirJS to exclude proving/verification/contract codegen #4960

Closed
11 of 13 tasks
TomAFrench opened this issue May 2, 2024 · 10 comments
Closed
11 of 13 tasks
Labels
backend Proving backends enhancement New feature or request js Noir's JavaScript packages nargo Noir's CLI development tool
Milestone

Comments

@TomAFrench
Copy link
Member

TomAFrench commented May 2, 2024

Nargo is currently the "everything-box" for working with Noir. You can install various proving backends, generate proofs in a single command, verify these, generate smart contract verifiers, etc. This has a few downsides:

All this while providing a generic interface which can handle the peculiarities of many different proving backends.

Ideally Noir/Nargo should:

  • Specify the ACIR standard.
  • Specify a standard structure of a Noir project (so backends can make reasonable defaults for where to look for compiled artifacts)
  • Compile Noir source code down to artifacts compliant with these two standards.
  • Provide tools for execution/testing/debugging of Noir source code.

As part of the tasks set out below we should:

  • Ensure that the equivalent bb workflow works
  • Make any necessary changes to bb such that the UX is still high.
  • Add an equivalent test in CI using the bb workflow as an example

Write a spec for ACIR backends to specify handling of

Nargo

  1. vezenovm
  2. vezenovm

NoirJS

  1. backend enhancement js

Barretenberg feature parity tasks

  1. TomAFrench
@Savio-Sou
Copy link
Collaborator

From AztecProtocol/aztec-packages#6320 (comment):

we should also expect that users should install their proving backend of choice rather than nargo acting as an installer for bb

@TomAFrench we shouldn't go that far as to remove default proving backend installation if that was what you were considering. That drives up onboarding frictions and support requests, with arguably little benefit in simplifying Noir 1.0's audit.

@TomAFrench
Copy link
Member Author

Nargo is not going to be speaking to barretenberg and so there's no reason for it to install bb

@TomAFrench
Copy link
Member Author

If we want bb to be a user facing component then it needs to have its own install method.

@Savio-Sou
Copy link
Collaborator

Oh I didn't mean Nargo specifically.

Goal is to preserve our current DevEx where users could get started / updated with 1 command.
If e.g. noirup automatically fetches the right version of bb that's a win.

@TomAFrench
Copy link
Member Author

noirup is installation tooling for Nargo so it shouldn't install bb

@Savio-Sou
Copy link
Collaborator

Is there a good way to avoid / warn about nargo and bb version mismatches if they aren't pre-matched and installed as a batch?

@charlielye
Copy link
Contributor

Is there a good way to avoid / warn about nargo and bb version mismatches if they aren't pre-matched and installed as a batch?

The output artefacts of nargo could have a "backend api" version number associated with them.
If nargo bumps this number, it should bump it's major version number (breaking change), as it's changing the artefacts that it outputs such that they become incompatible with consumers of those artefacts.
bb can detect the mismatch and ask the user to upgrade, (knowing an upgrade will exist as there should always be a compatible bb). This bb release would also have a bumped major version number, as it's a breaking change regarding the artefacts it consumes.

In this model, noirs docs (which I think should at least give the 1-liner to install a compatible version of bb) can always provide, e.g. knowing compatibility with major version 3:

npm install --global bb.js@3

Also, I'm not totally against e.g. the noirup script offering to run the 1-liner or whatever is needed to upgrade a detected incompatible backend. As long as it's just scoped to a bit of bash in order to simplify...

@Savio-Sou
Copy link
Collaborator

"backend api" version number

Including an ACIR version in Noir artifacts should do the trick 👍

@Savio-Sou Savio-Sou changed the title Epic: Restrict Nargo scope to exclude proving/verification/contract codegen Epic: Rescope Nargo & NoirJS to exclude proving/verification/contract codegen May 17, 2024
@Savio-Sou Savio-Sou added enhancement New feature or request backend Proving backends nargo Noir's CLI development tool js Noir's JavaScript packages labels May 17, 2024
@Savio-Sou Savio-Sou added this to the 1.0 milestone May 17, 2024
@TomAFrench
Copy link
Member Author

I'm going to close this epic and break out any remaining issues to be standalone or under a new documentation epic.

@Savio-Sou
Copy link
Collaborator

@TomAFrench SGTM 👍 would be great if you could remove unresolved Issues from the Epic body while recreating them separately for more accurate communications 🙌

github-merge-queue bot pushed a commit that referenced this issue Jul 26, 2024
# Description

## Summary\*

Update docs related to the installation and use of proving backends
following #4960.

Focusing mainly on improving:
1. Noir's proving backend agnosticity
2. Formatting/readability

Best to merge this PR in before stable releasing v0.31.0 and v0.32.0.

## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: James Zaki <james.zaki@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Proving backends enhancement New feature or request js Noir's JavaScript packages nargo Noir's CLI development tool
Projects
Status: Done
Development

No branches or pull requests

3 participants