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

chore: add recursive example #4969

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft

chore: add recursive example #4969

wants to merge 26 commits into from

Conversation

jzaki
Copy link
Contributor

@jzaki jzaki commented May 3, 2024

Description

Adds new examples directory with recursive example from dev-rel repo.

Problem

Examples in dev-rel are not kept strictly up to date with each noir language update, so when referred to in the docs would be out of date. This code will likely need updating before automating any test as part of noir repo's CI.

Resolves #4410

Summary

There were some quirks/workarounds at the time of writing, and fixes in Noir will likely resolve those quirks (if not already).

Additional Context

A future restructure would have a new docs directory created, with the current docs moving to subfolder in that, alongside examples. So structure could be something like docs/docs and docs/examples.
PS. I presume the prettier was on default cargo fmt settings.

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

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

Thanks for this. We just need to hook it up into JS workspace + tested in CI

Comment on lines 16 to 19
"@noir-lang/backend_barretenberg": "^0.26.0",
"@noir-lang/noir_codegen": "^0.26.0",
"@noir-lang/noir_js": "^0.26.0",
"@noir-lang/noir_wasm": "^0.26.0",
Copy link
Member

Choose a reason for hiding this comment

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

Can you add this package to the workspace and pull these packages from there?

Copy link
Member

Choose a reason for hiding this comment

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

We have a workspace tsconfig which this package can inherit from.

@@ -0,0 +1,23 @@
{
"license": "UNLICENSED",
"scripts": {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a script which generates everything necessary and then runs main.ts? We'll then want to add this to CI.

examples/recursive-proofs/package.json Outdated Show resolved Hide resolved
examples/recursive-proofs/package.json Outdated Show resolved Hide resolved
Comment on lines 8 to 11
"export:leaf": "nargo export --program-dir=./circuits/sum",
"export:recurseLeaf": "nargo export --program-dir=./circuits/recurseLeaf",
"export:recurseNode": "nargo export --program-dir=./circuits/recurseNode",
"export:all": "yarn clean:codegen && yarn export:leaf && yarn export:recurseLeaf && yarn export:recurseNode",
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we don't use noir_codegen here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Evolved from another example, and did remove use of codegen artifacts.

@TomAFrench TomAFrench self-assigned this May 3, 2024
@TomAFrench
Copy link
Member

Assigning myself just for tracking me supporting these efforts in the Noir board.

@TomAFrench
Copy link
Member

Also it would be good to experiment with inlining some of the text to be shown in the docs in amongst the code and using snippets to populate the doc. This would make it easier for us to keep text + code in sync.

jzaki and others added 2 commits May 3, 2024 14:50
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
@jzaki jzaki changed the title Jz/add recursive example chore: add recursive example May 3, 2024
@jzaki jzaki marked this pull request as draft May 8, 2024 10:35
@jzaki jzaki self-assigned this May 13, 2024
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@cspell/cspell-json-reporter@8.8.1 None 0 12.3 kB jason-dent
npm/recursive-proofs-30599d@0.0.0-use.local None 0 0 B

🚮 Removed packages: npm/bech32@1.1.4, npm/chai-as-promised@7.1.2

View full report↗︎

TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request May 29, 2024
This PR adds an example script which does recursive verification using
`nargo` and the `bb` binary as based on @jzaki's javascript example
noir-lang/noir#4969.
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.

Bring nested recursion example into noir-lang/noir
2 participants