Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
585710b
put initial get exact circuit size into gates cmd
vezenovm Nov 14, 2022
03b25e1
merge master
vezenovm Nov 21, 2022
5de6836
Merge branch 'master' into mv/circuit-size
vezenovm Nov 22, 2022
4b05926
Merge branch 'master' into mv/circuit-size
vezenovm Dec 2, 2022
b66fb08
updated aztec_backend commit ref
vezenovm Dec 2, 2022
ffbf04f
remove commented out backend ref
vezenovm Dec 2, 2022
f9ae71a
cargo fmt
vezenovm Dec 2, 2022
6bd0444
test CI with libomp 15
vezenovm Dec 2, 2022
6581a68
go back to old libomp
vezenovm Dec 2, 2022
f2aaf45
switch to apt-get for workflow
vezenovm Dec 2, 2022
5d678ac
switch to apt-get for workflow
vezenovm Dec 2, 2022
7736968
test excluding noir_wasm
vezenovm Dec 2, 2022
46d9b63
specify llvm install
vezenovm Dec 2, 2022
451cd7a
try a cargo clean before test
vezenovm Dec 2, 2022
40ba55c
try new aztec_backend ref + remove cargo cleann from rust workflow
vezenovm Dec 2, 2022
9206bdb
updated inputs in nargo so that we can prove simple shield, however, …
vezenovm Dec 2, 2022
ffb28c7
change simple_shield to use Noir native merkle membership method, wil…
vezenovm Dec 6, 2022
7460dda
skip schnorr test for now
vezenovm Dec 6, 2022
007b417
excluded tests
vezenovm Dec 6, 2022
359919c
fixed inputs for merkle_insert, pedersen_check, and schnorr
vezenovm Dec 6, 2022
ef265f4
merge conflicts
vezenovm Dec 6, 2022
339126c
schnorr changes and updated aztec backkend
vezenovm Dec 7, 2022
5eb3c2f
updated backend reference, now having mixed merkle_membership foreign…
vezenovm Dec 8, 2022
28a1cb5
fixed merkle_membership
vezenovm Dec 8, 2022
ceb3838
Merge branch 'master' into mv/circuit-size
vezenovm Dec 8, 2022
20ad617
update aztec_backend commit to reflect changes in omp linking in bb_w…
vezenovm Dec 8, 2022
2bd38b8
tiny cleanup
vezenovm Dec 8, 2022
bace85f
updated reference to reflect correct bb.wasm file in aztec_backend
vezenovm Dec 8, 2022
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
220 changes: 209 additions & 11 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions crates/acvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ pub trait ProofSystemCompiler {
public_input: Vec<FieldElement>,
circuit: Circuit,
) -> bool;

fn get_exact_circuit_size(&self, circuit: Circuit) -> u32;
}

/// Supported NP complete languages
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hex = "0.4.2"
tempdir = "0.3.7"

# Backends
aztec_backend = { optional = true, git = "https://github.com/noir-lang/aztec_backend", rev = "2d601a7d55faf601f4b183a43923c8fe04eabb7b" }
aztec_backend = { optional = true, package = "barretenberg_static_lib", git = "https://github.com/noir-lang/aztec_backend", rev = "e1f206f6739d3782d3a241298089a0292de33742" }
marlin_arkworks_backend = { optional = true, git = "https://github.com/noir-lang/marlin_arkworks_backend", rev = "601e24dcb5dcbe72e3de7a33879aaf84e171d541" }

[features]
Expand Down
7 changes: 6 additions & 1 deletion crates/nargo/src/cli/gates_cmd.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashMap;

use acvm::ProofSystemCompiler;
use clap::ArgMatches;
use std::path::Path;

Expand All @@ -24,7 +25,7 @@ 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;
let gates = compiled_program.circuit.gates.clone();

// Store counts of each gate type into hashmap.
let mut gate_counts: HashMap<&str, u32> = HashMap::new();
Expand All @@ -46,5 +47,9 @@ pub fn count_gates_with_path<P: AsRef<Path>>(
println!("{}: {}", gate_type, count);
}

let backend = crate::backends::ConcreteBackend;
let exact_circuit_size = backend.get_exact_circuit_size(compiled_program.circuit);
println!("\nExact constraint size: {}\n", exact_circuit_size);

Ok(())
}
14 changes: 7 additions & 7 deletions crates/nargo/tests/test_data/merkle_insert/Prover.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
old_root = "0x0620374242254671503abf57d13969d41bbae97e59fa97cd7777cd683beb9eb8"
old_leaf = "0x1cdcf02431ba623767fe389337d011df1048dcc24b98ed81cec97627bab454a0"
old_root = "0x083b35b32ba24436c1614e4262cb4ad8f98f99cdb5fb0da8932ab2a290034867"
old_leaf = "0x0b81829b478114d28b964bd382ebff8be0216741aa72ff2896909110aef1704a"
old_hash_path = [
"0x1cdcf02431ba623767fe389337d011df1048dcc24b98ed81cec97627bab454a0",
"0x262e1ae3710241581182198b69a10601148ee1dd20ae638f99cde7b3ede59754",
"0x0f88aa985f23258a12a78b35eab5d3d8d41d091a71113f2d4b2731d96ab78cfd"
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0e4223f3925f98934393c74975142bd73079ab0621f4ee133cee050a3c194f1a",
"0x2fd7bb412155bf8693a3bd2a3e7581a679c95c68a052f835dddca85fa1569a40"
]
new_root = "0x0a89e40480370e6c2f0e9e8cb0ac06a979092d55fc9210be9c2211c6a97f5991"
leaf = "0x1aab12b2f330c2fb811d6042f10ce65c0678803354529dc7f9bb5b1d9ff6987b"
new_root = "0x256c13d7694e2f900f55756246aa1104169efd9fb9e7c6be54c15794795d476f"
leaf = "0x2e5ba44f3c5329aeb915c703e39b33c5872f1542500cbb22f12b71640aba502f"
index = "0"
mimc_input = [12,45,78,41]
2 changes: 1 addition & 1 deletion crates/nargo/tests/test_data/merkle_insert/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main(
) {
let old_leaf_exists = std::merkle::check_membership(old_root, old_leaf, index, old_hash_path);
constrain old_leaf_exists == 1;
constrain old_root == std::merkle::compute_root_from_leaf( old_leaf, index, old_hash_path);
constrain old_root == std::merkle::compute_root_from_leaf(old_leaf, index, old_hash_path);
let new_leaf_exists = std::merkle::check_membership(new_root, leaf, index, old_hash_path);
constrain new_leaf_exists == 1;

Expand Down
4 changes: 2 additions & 2 deletions crates/nargo/tests/test_data/pedersen_check/Prover.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ x = "0"
y = "1"
salt = "42"

out_x = "0x108800e84e0f1dafb9fdf2e4b5b311fd59b8b08eaf899634c59cc985b490234b"
out_y = "0x2d43ef68df82e0adf74fed92b1bc950670b9806afcfbcda08bb5baa6497bdf14"
out_x = "0x229fb88be21cec523e9223a21324f2e305aea8bff9cdbcb3d0c6bba384666ea1"
out_y = "0x296b4b4605e586a91caa3202baad557628a8c56d0a1d6dff1a7ca35aed3029d5"
10 changes: 5 additions & 5 deletions crates/nargo/tests/test_data/schnorr/Prover.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ message = [0,1,2,3,4,5,6,7,8,9]
pub_key_x = "0x17cbd3ed3151ccfd170efe1d54280a6a4822640bf5c369908ad74ea21518a9c5"
pub_key_y = "0x0e0456e3795c1a31f20035b741cd6158929eeccd320d299cfcac962865a6bc74"
signature = [
7, 131, 147, 205, 145, 77, 60, 169, 159, 86, 91, 209, 140, 210, 4, 21, 186, 39, 221, 195,
62, 35, 220, 144, 135, 28, 201, 97, 145, 125, 146, 211, 92, 16, 67, 59, 162, 133, 144, 52,
184, 137, 241, 102, 176, 152, 138, 220, 21, 40, 211, 178, 191, 67, 71, 11, 209, 191, 86,
91, 196, 68, 98, 214,
]
5, 202, 31, 146, 81, 242, 246, 69, 43, 107, 249, 153, 198, 44, 14, 111, 191, 121, 137, 166,
160, 103, 18, 181, 243, 233, 226, 95, 67, 16, 37, 128, 85, 76, 19, 253, 30, 77, 192, 53, 138,
205, 69, 33, 236, 163, 83, 194, 84, 137, 184, 221, 176, 121, 179, 27, 63, 70, 54, 16, 176,
250, 39, 239,
]
12 changes: 6 additions & 6 deletions crates/nargo/tests/test_data/simple_shield/Prover.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Random test key
priv_key = "0x000000000000000000000000000000000000000000000000000000616c696365"
note_root = "0x1221a375f6b4305e493497805102054f2847790244f92d09f6e859c083be2627"
note_root = "0x165cdc3cbcf4a6bf7b69514807409a3ed2e701556821f396ca04781a6434d96a"
index = "0"
note_hash_path = [
"0x1cdcf02431ba623767fe389337d011df1048dcc24b98ed81cec97627bab454a0",
"0x262e1ae3710241581182198b69a10601148ee1dd20ae638f99cde7b3ede59754",
"0x0f88aa985f23258a12a78b35eab5d3d8d41d091a71113f2d4b2731d96ab78cfd"
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0e4223f3925f98934393c74975142bd73079ab0621f4ee133cee050a3c194f1a",
"0x2fd7bb412155bf8693a3bd2a3e7581a679c95c68a052f835dddca85fa1569a40"
]
to_pubkey_x = "0x0000000000000000000000000000000000000000000000000000000000000001"
to_pubkey_y = "0x0000000000000002cf135e7506a45d632d270d45f1181294833fc48d823f272c"
return = [
"0x0c9d3bdae689f66e3bc77823326726d140a48e989a1047ab25a9b6398b107118",
"0x2f581370029b47a215f0379b936c089542d5d20767f1fa2dce0e59bbc4c4bd62"
"0x1fa077bf4c787f858e0f3a7fa031ff11f200a0ccc6e549c6af98ec96800af340",
"0x0c25956c07e2277e75f1ca10bae32c29f24b27f25625fe9258cec29dc90651dd"
]