-
Notifications
You must be signed in to change notification settings - Fork 232
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: Incorporate dummy backend for bb.js [DO NOT MERGE] #1491
Conversation
…d updated pedersen/tree tests
crates/nargo/src/artifacts/mod.rs
Outdated
where | ||
S: Serializer, | ||
{ | ||
println!("CUR WIT IDX: {:?}", circuit.current_witness_index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove println
crates/nargo/src/artifacts/mod.rs
Outdated
let cs: ConstraintSystem = | ||
ConstraintSystem::try_from(circuit).expect("should have no malformed bb funcs"); | ||
let circuit_bytes = cs.to_bytes(); | ||
println!("{:?}", circuit_bytes.capacity()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
crates/nargo/src/artifacts/mod.rs
Outdated
where | ||
D: Deserializer<'de>, | ||
{ | ||
// panic!("Not supported"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out code
@@ -36,10 +36,10 @@ hex = "0.4.2" | |||
serde_json = "1.0" | |||
termcolor = "1.1.2" | |||
color-eyre = "0.6.2" | |||
tokio = "1.0" | |||
tokio = { version = "1.0.0", features = ["rt"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the rt feature needed?
@@ -1,19 +1,23 @@ | |||
use std::path::{Path, PathBuf}; | |||
|
|||
// use noirc_abi::WitnessMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out code
@@ -36,6 +36,8 @@ noirc_errors = { path = "crates/noirc_errors" } | |||
noirc_evaluator = { path = "crates/noirc_evaluator" } | |||
noirc_frontend = { path = "crates/noirc_frontend" } | |||
noir_wasm = { path = "crates/wasm" } | |||
base64 = "0.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you put a comment saying that this is only needed for the bb_js hack
Can you merge master into this, so the diff is cleaner? |
Description
Problem*
Resolves #1489
Summary*
The relevant ACVM rev that is updated to in this PR:
noir-lang/acvm#291
The updated acvm-backend-barretenberg:
noir-lang/acvm-backend-barretenberg#207
This PR sets out to enable compilation of ACIR circuits and witness generation in a format the
bb.js
expects. nargo built with thebb_js
feature flag should only use thecompile
andexecute
commands as the rest are unimplemented. Untilbb.js
is fully integrated to nargo and/or fully dynamic backends are ready the other commands will not be usable withbb.js
. This is an experimental feature and should only be used by advanced users comfortable with downloading from source and escaping from the normalnargo
workflow.Example
Before:
You could call
cargo install --path=crates/nargo_cli
to use nargo with the nativeacvm-backend-barretenberg
. Addtional flags of--no-default-features --features=plonk_bn254_wasm
would enable compilation with a wasm target.Users can then use nargo commands to not only compile, but prove and verify their circuits such as with
nargo prove p --verify
.After:
The previous commands work the same as before. However, adding the flags
--no-default-features --features=bb_js
will let a user compile a Noir circuit and generate a witness to file in the format thatbb.js
expects. However, proving and verifying will be done withbb.js
. Binaries are being released forbb.js
. Once someone hasbb.js
installed globally they can use it according to its CLI.To prove and verify w/
bb.js
the following command can be run over a compiled circuit and witness:bb.js prove_and_verify -j ./target/c.json -w ./target/witness.tr
Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.