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

update to nargo 0.11.0, bbjs 0.5.1 #49

Merged
merged 10 commits into from
Sep 8, 2023
Merged

update to nargo 0.11.0, bbjs 0.5.1 #49

merged 10 commits into from
Sep 8, 2023

Conversation

critesjosh
Copy link
Collaborator

@critesjosh critesjosh commented Sep 6, 2023

Update to nargo 0.11.0 and bb.js 0.5.1.

@netlify
Copy link

netlify bot commented Sep 6, 2023

Deploy Preview for noir-next-hardhat ready!

Name Link
🔨 Latest commit 63bba45
🔍 Latest deploy log https://app.netlify.com/sites/noir-next-hardhat/deploys/64fb2da166b4b10008a83846
😎 Deploy Preview https://deploy-preview-49--noir-next-hardhat.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@socket-security
Copy link

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

Packages Version New capabilities Transitives Size Publisher
@types/node 18.17.4...18.17.14 None +0/-0 3.73 MB types
react-loader-spinner 5.3.4...5.4.5 None +0/-19 288 kB mhnpd
@aztec/bb.js 0.3.6...0.5.1 None +0/-1 17 MB charlielye
axios 1.4.0...1.5.0 None +0/-0 1.75 MB jasonsaayman

🚮 Removed packages: @nomicfoundation/hardhat-network-helpers@1.0.8, @types/react@18.2.19, hardhat@2.17.1, next@13.4.13

@critesjosh
Copy link
Collaborator Author

critesjosh commented Sep 6, 2023

@signorecello yarn dev works, but yarn build fails. do you know how to resolve this?

EDIT: I just added //@ts-ignore and its working

@Savio-Sou
Copy link
Member

Savio-Sou commented Sep 7, 2023

Getting:

TypeError: A.toBuffer is not a function
    at l (08ff446a-2a25c7b1a38169ce.js:14:42537)
    at Array.map (<anonymous>)
    at CA.copyToMemory (08ff446a-2a25c7b1a38169ce.js:14:50763)
    at BA.callWasmExport (08ff446a-2a25c7b1a38169ce.js:14:51464)
    at GA.acirCreateProof (08ff446a-2a25c7b1a38169ce.js:14:49588)
    at NoirBrowser.generateProof (index-04b98bedddd5b9d2.js:81:38)
    at calculateMainProof (index-04b98bedddd5b9d2.js:178:58)

when I attempt to prove in the webpage compile from next-hardhat 🤔

(Circuit compiled with Nargo v0.10.5.)

@@ -29,7 +29,7 @@ export class NoirBrowser {
this.acirBuffer = Buffer.from(circuit.bytecode, 'base64');
Copy link
Member

Choose a reason for hiding this comment

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

@kevaundray any changes on how we handle circuit bytecode required per the recent changes re en/decoding base64 on both Noir's and barretenberg's sides?

Copy link
Member

Choose a reason for hiding this comment

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

Link to headless-test/src/index.ts for quick ref.

Copy link
Contributor

Choose a reason for hiding this comment

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

I made all of the relevant changes in this barretenberg PR: AztecProtocol/aztec-packages@7fffd16

If you follow the examples, it will show how to handle the base64 encoding; essentially, base64 is only in the json file, bb.js and bb require you to base64 decode it before passing it to them

@signorecello
Copy link
Collaborator

@kevaundray noted that compiling with 0.10.5 will actually fail, but it works fine with nightly. We just pair programmed and tested this.

Seems like you used nightly (which is also 0.10.5 but some commits later, hence the confusion). He's pushing a pre-release for 0.10.6 so it should work with 0.10.6

@kevaundray
Copy link
Contributor

We had a breaking change so it will be 0.11.0 -- it should be released now!

@kevaundray kevaundray changed the title update to nargo 0.10.5, bbjs 0.5.1 update to nargo 0.11.0, bbjs 0.5.1 Sep 7, 2023
@kevaundray
Copy link
Contributor

Made some commit suggestions, apart from that, this looks good to me. The issue at play here is the fact that we have not integrated noir_wasm to do the compilation in the web. I have enquired about the status of this

critesjosh and others added 3 commits September 7, 2023 12:23
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
@critesjosh
Copy link
Collaborator Author

@kevaundray I just updated to 0.11.0 and am seeing this error with nargo compile and nargo codegen-verifier:

➜  circuits git:(jc/update) ✗ nargo codegen-verifier
The application panicked (crashed).
Message:  Backend does not support an opcode that is in the IR: SmartContractError(BackendError("Failed to download srs: Unable to open file: /home/josh/.nargo/backends/acvm-backend-barretenberg/crs/g1.dat\n"))
Location: crates/nargo_cli/src/cli/compile_cmd.rs:96

This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.
If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml

Seems weird because the CI tests are passing.

@Savio-Sou
Copy link
Member

The issue at play here is the fact that we have not integrated noir_wasm to do the compilation in the web.

That's acceptable imo as compilation needs to happen only once and is performed by the developer (rather than user).

Compiling in CLI is ok, compilable in Node.js would be nice, compilable in web browsers would be unnecessary for most Noir apps (outliers being e.g. in-browser dev tools).

@critesjosh
Copy link
Collaborator Author

I removed ~/.nargo and ~/nargo and reinstalled and it worked.

@critesjosh critesjosh merged commit ba430a1 into main Sep 8, 2023
@critesjosh critesjosh deleted the jc/update branch September 8, 2023 14:34
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