Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8de5d81
update acvm dependency to use 0.3.0 API
kevaundray Jan 15, 2023
7fddf1d
evaluator - refactor to use 0.3.0
kevaundray Jan 15, 2023
12de758
frontend - refactor to use 0.3.0
kevaundray Jan 15, 2023
b45841f
driver - refactor to use 0.3.0
kevaundray Jan 15, 2023
519a62a
nargo - refactor to use 0.3.0
kevaundray Jan 15, 2023
ee90caa
update Cargo.toml
kevaundray Jan 15, 2023
a43337b
fix clippy
kevaundray Jan 15, 2023
e48c76d
update Cargo.toml -- use static lib
kevaundray Jan 15, 2023
38ba77e
update cargo.lock
kevaundray Jan 15, 2023
ddb0fd2
workflow - use ubuntu-latest
kevaundray Jan 15, 2023
30e62c0
update cargo.lock
kevaundray Jan 16, 2023
dbf492e
`hash_to_field` opcode has been renamed to `hash_to_field_128_security`
kevaundray Jan 16, 2023
3f07e5b
update cargo.lock
kevaundray Jan 17, 2023
08c5a08
update cargo lock
kevaundray Jan 17, 2023
5c4114f
Merge branch 'master' into kw/acvm3.0
kevaundray Jan 17, 2023
6c070a2
remove `as Gate` alias and replace `gates` with `opcodes` in the Eval…
kevaundray Jan 17, 2023
00ac3c0
install libomp for all steps
kevaundray Jan 17, 2023
75e9a0c
Merge remote-tracking branch 'origin/master' into kw/acvm3.0
kevaundray Jan 17, 2023
e795374
use acvm in standalone repo
kevaundray Jan 17, 2023
6fb8447
update cargo.lock
kevaundray Jan 17, 2023
d5dfab7
remove todo, see issue 658
kevaundray Jan 18, 2023
871005f
use published 0.3.1 version
kevaundray Jan 18, 2023
41d79d6
use aztec_backend commit hash
kevaundray Jan 18, 2023
d4065fd
update cargo.lock
kevaundray Jan 18, 2023
b5d2514
use acvm from workspace in wasm module
kevaundray Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
check_n_test:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:

clippy:
name: cargo clippy
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand All @@ -71,7 +71,7 @@ jobs:

format:
name: cargo fmt
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand Down
135 changes: 115 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ members = [
]
exclude = ["examples/9/merkle_tree_processor"]
default-members = ["crates/nargo"]

# Patch github versions of acvm with local copy
[patch.'https://github.com/noir-lang/noir']
acvm = { path = "crates/acvm" }
4 changes: 2 additions & 2 deletions crates/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ noirc_driver = { path = "../noirc_driver" }
noirc_frontend = { path = "../noirc_frontend" }
noirc_abi = { path = "../noirc_abi" }
fm = { path = "../fm" }
acvm = { git = "https://github.com/noir-lang/noir" }
acvm = { git = "https://github.com/noir-lang/acvm" }
cfg-if = "1.0.0"

toml = "0.5"
Expand All @@ -29,7 +29,7 @@ hex = "0.4.2"
tempdir = "0.3.7"

# Backends
aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", rev = "8c8ec2dd9c376bef598d17f023fac172e5e47860" }
aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", branch = "kw/acvm3.0" }
marlin_arkworks_backend = { optional = true, git = "https://github.com/noir-lang/marlin_arkworks_backend", rev = "601e24dcb5dcbe72e3de7a33879aaf84e171d541" }

[features]
Expand Down
1 change: 1 addition & 0 deletions crates/nargo/src/cli/build_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
// This is exposed so that we can run the examples and verify that they pass
pub fn build_from_path<P: AsRef<Path>>(p: P, allow_warnings: bool) -> Result<(), CliError> {
let backend = crate::backends::ConcreteBackend;

let mut driver = Resolver::resolve_root_config(p.as_ref(), backend.np_language())?;
add_std_lib(&mut driver);
driver.build(allow_warnings);
Expand Down
1 change: 1 addition & 0 deletions crates/nargo/src/cli/compile_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub(crate) fn run(args: ArgMatches) -> Result<(), CliError> {
}
}

#[allow(deprecated)]
pub fn generate_circuit_and_witness_to_disk<P: AsRef<Path>>(
circuit_name: &str,
program_dir: P,
Expand Down
8 changes: 6 additions & 2 deletions crates/nargo/src/cli/gates_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ pub fn count_gates_with_path<P: AsRef<Path>>(
allow_warnings: bool,
) -> Result<(), CliError> {
let compiled_program = compile_circuit(program_dir.as_ref(), show_ssa, allow_warnings)?;
let gates = compiled_program.circuit.gates.clone();
let num_opcodes = compiled_program.circuit.opcodes.len();
let backend = crate::backends::ConcreteBackend;

println!("Total gates generated for language {:?}: {}\n", backend.np_language(), gates.len());
println!(
"Total ACIR opcodes generated for language {:?}: {}\n",
backend.np_language(),
num_opcodes
);

let exact_circuit_size = backend.get_exact_circuit_size(compiled_program.circuit);
println!("\nBackend circuit size: {exact_circuit_size}\n");
Expand Down
17 changes: 4 additions & 13 deletions crates/nargo/src/cli/prove_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::{collections::BTreeMap, path::PathBuf};

use acvm::acir::native_types::Witness;
use acvm::FieldElement;
use acvm::PartialWitnessGenerator;
use acvm::ProofSystemCompiler;
use acvm::{GateResolution, PartialWitnessGenerator};
use clap::ArgMatches;
use noirc_abi::errors::AbiError;
use noirc_abi::input_parser::{Format, InputValue};
Expand Down Expand Up @@ -104,18 +104,9 @@ fn solve_witness(
.collect();

let backend = crate::backends::ConcreteBackend;
let solver_res = backend.solve(&mut solved_witness, compiled_program.circuit.gates.clone());

match solver_res {
GateResolution::UnsupportedOpcode(opcode) => return Err(CliError::Generic(format!(
"backend does not currently support the {opcode} opcode. ACVM does not currently fall back to arithmetic gates.",
))),
GateResolution::UnsatisfiedConstrain => return Err(CliError::Generic(
"could not satisfy all constraints".to_string()
)),
GateResolution::Resolved => (),
_ => unreachable!(),
}
let solver_res = backend.solve(&mut solved_witness, compiled_program.circuit.opcodes.clone());

solver_res.map_err(CliError::from)?;

Ok(solved_witness)
}
Expand Down
Loading