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

feat(nargo): add nargo execute command #725

Merged
merged 17 commits into from
Feb 4, 2023
Merged

feat(nargo): add nargo execute command #725

merged 17 commits into from
Feb 4, 2023

Conversation

TomAFrench
Copy link
Member

@TomAFrench TomAFrench commented Feb 1, 2023

Related issue(s)

Resolves #626

Description

Summary of changes

This PR adds the nargo execute command which is responsible for loading prover inputs and solving the witness for the circuit. This is essentially the Rust equivalent of solveAcirPartialWitness from the noir.js hackmd.

Benefits being:

  • Better logical separation between the 3 steps of witness construction, proof generation and proof verification.
  • Users can print out the return value of a circuit without having to go through with generating a proof and opening Verifier.toml.

I've named this nargo execute as I initially thought of it as a command to "execute the noir program and print its return value" but it may be worth renaming to something more "witness-y" let's leave it as execute as it's more understandable to non-ZK devs.

Dependency additions / changes

N/A

Test additions / changes

N/A

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Additional context

@TomAFrench
Copy link
Member Author

@jfecher I'd be interested to get your input on this. Executing shaves off a significant amount of time relative to proving so this could be useful in speeding up #728.

jfecher
jfecher previously approved these changes Feb 2, 2023
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

This looks good to me from my perspective. I'd like another approval before merging though.

In relation to #728, I think it would be faster for that PR but I also think for that PR I can change it to stop right after SSA or ACIR without proving at all since all failing constraints should be caught during SSA as everything would be constant due to there being no inputs.

@TomAFrench
Copy link
Member Author

Cheers, this should probably wait until #731 is in at least.

* master:
  feat(noir)!:  Returned values are no longer required by the prover (#731)
this is an artifact of me deduping public inputs in the wrong place
return values are now never provided rather than optional
TomAFrench and others added 4 commits February 3, 2023 19:38
* master:
  chore: Add spellchecker  (#682)
  Rename methods that use `conditionalize` to be more descriptive (#739)
* master:
  feat(nargo): Add `nargo test` command to run all unit tests (#728)
  chore(ci): Apply `doc needed` label automatically on PRs (#733)
  chore(ci): Remove failing bors workflow (#744)
  feat(ci): Add workflow to validate PR title (#730)
TomAFrench and others added 3 commits February 3, 2023 22:51
* master:
  chore(nargo): add InputMap and WitnessMap terminology (#713)
  chore(ci): Avoid reporting errors if labeler action fails (#746)
@TomAFrench TomAFrench merged commit 9d6be60 into master Feb 4, 2023
@TomAFrench TomAFrench deleted the nargo-execute branch February 4, 2023 01:09
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.

Add a nargo execute command to solve a circuit and extract its return value
3 participants