diff --git a/barretenberg/acir_tests/run_test.sh b/barretenberg/acir_tests/run_test.sh index b4ff86838c6..f0e5dfaeaea 100755 --- a/barretenberg/acir_tests/run_test.sh +++ b/barretenberg/acir_tests/run_test.sh @@ -25,7 +25,7 @@ if [ "$COMPILE" -ne 0 ]; then export RAYON_NUM_THREADS=4 rm -rf target set +e - compile_output=$($nargo compile --silence-warnings 2>&1 && $nargo execute 2>&1) + compile_output=$($nargo compile --pedantic-solving --silence-warnings 2>&1 && $nargo execute --pedantic-solving 2>&1) result=$? set -e if [ "$result" -ne 0 ]; then @@ -61,4 +61,4 @@ else echo -e "\033[31mFAILED\033[0m" echo "$output" exit 1 -fi \ No newline at end of file +fi diff --git a/noir-projects/Dockerfile.test b/noir-projects/Dockerfile.test index 3c4588e4e12..856fee4d2c1 100644 --- a/noir-projects/Dockerfile.test +++ b/noir-projects/Dockerfile.test @@ -23,7 +23,7 @@ COPY . . # Build & test RUN yarn -RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --silence-warnings +RUN cd ./noir-protocol-circuits && ./bootstrap.sh && nargo test --pedantic-solving --silence-warnings RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize @@ -32,10 +32,10 @@ RUN cd /usr/src/yarn-project/txe && yarn start & \ # We need to increase the timeout since all tests running in parallel hammer TXE at the same time, and processing slows down leading to timeouts # The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal ./bootstrap.sh && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --pedantic-solving --silence-warnings --oracle-resolver http://localhost:8080 RUN cd /usr/src/yarn-project/txe && yarn start & \ # Wait for TXE to initialize sleep 5 && \ cd ./aztec-nr && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 \ No newline at end of file + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --pedantic-solving --silence-warnings --oracle-resolver http://localhost:8080 diff --git a/noir-projects/Earthfile b/noir-projects/Earthfile index dc741554d3d..3cc1846f0a7 100644 --- a/noir-projects/Earthfile +++ b/noir-projects/Earthfile @@ -8,12 +8,12 @@ test-protocol-circuits: FROM ../+bootstrap ENV PATH="/usr/src/noir/noir-repo/target/release:${PATH}" # TODO(#10754): Remove --skip-brillig-constraints-check - RUN cd /usr/src/noir-projects/noir-protocol-circuits && nargo test --silence-warnings --skip-brillig-constraints-check + RUN cd /usr/src/noir-projects/noir-protocol-circuits && nargo test --pedantic-solving --silence-warnings --skip-brillig-constraints-check # Also execute circuits to ensure that `Prover.toml` files are in sync. LET circuits = "private-kernel-init private-kernel-inner private-kernel-reset private-kernel-tail-to-public private-kernel-tail rollup-base-private rollup-base-public rollup-block-root rollup-block-merge rollup-merge rollup-root" FOR circuit IN $circuits - RUN cd /usr/src/noir-projects/noir-protocol-circuits/crates/$circuit && nargo execute --silence-warnings --skip-brillig-constraints-check > /dev/null + RUN cd /usr/src/noir-projects/noir-protocol-circuits/crates/$circuit && nargo execute --pedantic-solving --silence-warnings --skip-brillig-constraints-check > /dev/null END test-aztec-nr: @@ -23,7 +23,7 @@ test-aztec-nr: # Wait for TXE to initialize sleep 5 && \ cd /usr/src/noir-projects/aztec-nr && \ - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --pedantic-solving --silence-warnings --oracle-resolver http://localhost:8080 test-contracts: FROM ../+bootstrap @@ -34,7 +34,7 @@ test-contracts: cd /usr/src/noir-projects/noir-contracts && \ # We need to increase the timeout since all tests running in parallel hammer TXE at the same time and processing slows down, leading to timeouts # The only way we currently have to batch tests is via RAYON_NUM_THREADS, which is not ideal - NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --silence-warnings --oracle-resolver http://localhost:8080 + NARGO_FOREIGN_CALL_TIMEOUT=300000 nargo test --pedantic-solving --silence-warnings --oracle-resolver http://localhost:8080 format: FROM ../+bootstrap diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index a20f08b6870..8b327c9e962 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -144,7 +144,7 @@ function test { CIRCUITS_HASH=$(cache_content_hash ../../noir/.rebuild_patterns "^noir-projects/$name") test_should_run $name-tests-$CIRCUITS_HASH || return 0 - RAYON_NUM_THREADS= $NARGO test --skip-brillig-constraints-check + RAYON_NUM_THREADS= $NARGO test --pedantic-solving --skip-brillig-constraints-check cache_upload_flag $name-tests-$CIRCUITS_HASH } diff --git a/noir-projects/scripts/run_test.sh b/noir-projects/scripts/run_test.sh index 94da2afdbac..7d0fad35432 100755 --- a/noir-projects/scripts/run_test.sh +++ b/noir-projects/scripts/run_test.sh @@ -13,4 +13,4 @@ export NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} [ -n "$txe_port" ] && args="--oracle-resolver http://127.0.0.1:$txe_port" || args="" -$NARGO test --silence-warnings --skip-brillig-constraints-check $args --package $package --exact $test \ No newline at end of file +$NARGO test --pedantic-solving --silence-warnings --skip-brillig-constraints-check $args --package $package --exact $test diff --git a/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh b/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh index de1f71a4cc0..d416454eecf 100755 --- a/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh +++ b/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh @@ -16,20 +16,20 @@ KEYS=$(mktemp -d) # Codegen verifier contract for 1_mul mul_dir=$repo_root/test_programs/execution_success/1_mul -nargo --program-dir $mul_dir compile +nargo --program-dir $mul_dir compile --pedantic-solving $NARGO_BACKEND_PATH write_vk -b $mul_dir/target/1_mul.json -o $KEYS/1_mul $NARGO_BACKEND_PATH contract -k $KEYS/1_mul -o $contracts_dir/1_mul.sol # Codegen verifier contract for assert_statement assert_statement_dir=$repo_root/test_programs/execution_success/assert_statement -nargo --program-dir $assert_statement_dir compile +nargo --program-dir $assert_statement_dir compile --pedantic-solving $NARGO_BACKEND_PATH write_vk -b $assert_statement_dir/target/assert_statement.json -o $KEYS/assert_statement $NARGO_BACKEND_PATH contract -k $KEYS/assert_statement -o $contracts_dir/assert_statement.sol # Codegen verifier contract for recursion recursion_dir=$repo_root/compiler/integration-tests/circuits/recursion -nargo --program-dir $recursion_dir compile +nargo --program-dir $recursion_dir compile --pedantic-solving $NARGO_BACKEND_PATH write_vk -b $recursion_dir/target/recursion.json -o $KEYS/recursion $NARGO_BACKEND_PATH contract -k $KEYS/recursion ./ -o $contracts_dir/recursion.sol -rm -rf $KEYS \ No newline at end of file +rm -rf $KEYS diff --git a/noir/noir-repo/compiler/integration-tests/scripts/compile-programs.sh b/noir/noir-repo/compiler/integration-tests/scripts/compile-programs.sh index a7071acc401..2d07e4d95e1 100755 --- a/noir/noir-repo/compiler/integration-tests/scripts/compile-programs.sh +++ b/noir/noir-repo/compiler/integration-tests/scripts/compile-programs.sh @@ -6,7 +6,7 @@ self_path=$(dirname "$(readlink -f "$0")") package_root=$self_path/../ assert_lt_dir=$package_root/circuits/assert_lt/ -nargo --program-dir $assert_lt_dir compile +nargo --program-dir $assert_lt_dir compile --pedantic-solving fold_fibonacci_dir=$package_root/circuits/fold_fibonacci/ -nargo --program-dir $fold_fibonacci_dir compile +nargo --program-dir $fold_fibonacci_dir compile --pedantic-solving diff --git a/noir/noir-repo/examples/recursion/generate_recursive_proof.sh b/noir/noir-repo/examples/recursion/generate_recursive_proof.sh index 09b01d547b6..7432fd1cb81 100755 --- a/noir/noir-repo/examples/recursion/generate_recursive_proof.sh +++ b/noir/noir-repo/examples/recursion/generate_recursive_proof.sh @@ -3,7 +3,7 @@ set -eu BACKEND=${BACKEND:-bb} -nargo execute sum_witness --package sum +nargo execute sum_witness --package sum --pedantic-solving $BACKEND prove -b ./target/sum.json -w ./target/sum_witness.gz -o ./target/sum_proof --recursive # Once we have generated our inner proof, we must use this to generate inputs to `recurse_leaf`` @@ -27,7 +27,7 @@ echo "public_inputs = $PUBLIC_INPUTS" >> $RECURSE_LEAF_PROVER_TOML # We can now execute and prove `recurse_leaf` -nargo execute recurse_leaf_witness --package recurse_leaf +nargo execute recurse_leaf_witness --package recurse_leaf --pedantic-solving $BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz -o ./target/recurse_leaf_proof --recursive # Let's do a sanity check that the proof we've generated so far is valid. @@ -53,7 +53,7 @@ echo "public_inputs = $PUBLIC_INPUTS" >> $RECURSE_NODE_PROVER_TOML # We can now execute and prove `recurse_node` -nargo execute recurse_node_witness --package recurse_node +nargo execute recurse_node_witness --package recurse_node --pedantic-solving $BACKEND prove -b ./target/recurse_node.json -w ./target/recurse_node_witness.gz -o ./target/recurse_node_proof # We finally verify that the generated recursive proof is valid. diff --git a/noir/noir-repo/scripts/check-critical-libraries.sh b/noir/noir-repo/scripts/check-critical-libraries.sh index f8e474d23de..1a05dc46856 100755 --- a/noir/noir-repo/scripts/check-critical-libraries.sh +++ b/noir/noir-repo/scripts/check-critical-libraries.sh @@ -31,7 +31,7 @@ for REPO in ${REPOS_TO_CHECK[@]}; do TAG=$(getLatestReleaseTagForRepo $REPO) git clone $REPO -c advice.detachedHead=false --depth 1 --branch $TAG $TMP_DIR - nargo test -q --program-dir $TMP_DIR + nargo test -q --program-dir $TMP_DIR --pedantic-solving rm -rf $TMP_DIR done diff --git a/noir/noir-repo/test_programs/compilation_report.sh b/noir/noir-repo/test_programs/compilation_report.sh index 786dbd75fe8..7a10fa3ddb4 100755 --- a/noir/noir-repo/test_programs/compilation_report.sh +++ b/noir/noir-repo/test_programs/compilation_report.sh @@ -42,7 +42,7 @@ for dir in ${tests_to_profile[@]}; do TOTAL_TIME=0 for ((i = 1; i <= NUM_RUNS; i++)); do - NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo compile --force --silence-warnings $FLAGS + NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo compile --force --pedantic-solving --silence-warnings $FLAGS done TIMES=($(jq -r '. | select(.target == "nargo::cli" and .fields.message == "close") | .fields."time.busy"' ./tmp/*)) diff --git a/noir/noir-repo/test_programs/execution_report.sh b/noir/noir-repo/test_programs/execution_report.sh index 827b7806d37..4e3d6acd793 100755 --- a/noir/noir-repo/test_programs/execution_report.sh +++ b/noir/noir-repo/test_programs/execution_report.sh @@ -50,7 +50,7 @@ for dir in ${tests_to_profile[@]}; do TOTAL_TIME=0 for ((i = 1; i <= NUM_RUNS; i++)); do - NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo execute --silence-warnings + NOIR_LOG=trace NARGO_LOG_DIR=./tmp nargo execute --pedantic-solving --silence-warnings done TIMES=($(jq -r '. | select(.target == "nargo::ops::execute" and .fields.message == "close") | .fields."time.busy"' ./tmp/*)) diff --git a/noir/noir-repo/test_programs/rebuild.sh b/noir/noir-repo/test_programs/rebuild.sh index bf67a894291..165e3eff934 100755 --- a/noir/noir-repo/test_programs/rebuild.sh +++ b/noir/noir-repo/test_programs/rebuild.sh @@ -27,7 +27,7 @@ process_dir() { rm -r ./target/ fi - if ! nargo execute witness; then + if ! nargo execute witness --pedantic-solving; then echo "$dir failed" else if [ -d "$current_dir/acir_artifacts/$dir_name/target" ]; then diff --git a/noir/noir-repo/tooling/nargo_cli/build.rs b/noir/noir-repo/tooling/nargo_cli/build.rs index 3394d00b3a2..1ea601bc98c 100644 --- a/noir/noir-repo/tooling/nargo_cli/build.rs +++ b/noir/noir-repo/tooling/nargo_cli/build.rs @@ -187,6 +187,7 @@ fn test_{test_name}(force_brillig: ForceBrillig, inliner_aggressiveness: Inliner let mut nargo = Command::cargo_bin("nargo").unwrap(); nargo.arg("--program-dir").arg(test_program_dir); nargo.arg("{test_command}").arg("--force"); + nargo.arg("--pedantic-solving"); nargo.arg("--inliner-aggressiveness").arg(inliner_aggressiveness.0.to_string()); // Check whether the test case is non-deterministic nargo.arg("--check-non-determinism"); diff --git a/noir/noir-repo/tooling/noir_js/scripts/compile_test_programs.sh b/noir/noir-repo/tooling/noir_js/scripts/compile_test_programs.sh index c65aea823a4..db4d77eb8c6 100755 --- a/noir/noir-repo/tooling/noir_js/scripts/compile_test_programs.sh +++ b/noir/noir-repo/tooling/noir_js/scripts/compile_test_programs.sh @@ -1,8 +1,8 @@ #!/bin/bash rm -rf ./test/noir_compiled_examples/**/target -nargo --program-dir ./test/noir_compiled_examples/assert_lt compile --force -nargo --program-dir ./test/noir_compiled_examples/assert_msg_runtime compile --force -nargo --program-dir ./test/noir_compiled_examples/fold_fibonacci compile --force -nargo --program-dir ./test/noir_compiled_examples/assert_raw_payload compile --force -nargo --program-dir ./test/noir_compiled_examples/databus compile --force +nargo --program-dir ./test/noir_compiled_examples/assert_lt compile --force --pedantic-solving +nargo --program-dir ./test/noir_compiled_examples/assert_msg_runtime compile --force --pedantic-solving +nargo --program-dir ./test/noir_compiled_examples/fold_fibonacci compile --force --pedantic-solving +nargo --program-dir ./test/noir_compiled_examples/assert_raw_payload compile --force --pedantic-solving +nargo --program-dir ./test/noir_compiled_examples/databus compile --force --pedantic-solving