diff --git a/barretenberg/acir_tests/clone_test_vectors.sh b/barretenberg/acir_tests/clone_test_vectors.sh new file mode 100755 index 00000000000..639c2a29b03 --- /dev/null +++ b/barretenberg/acir_tests/clone_test_vectors.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -eu + +# Pull down the test vectors from the noir repo, if we don't have the folder already. +if [ ! -d acir_tests ]; then + if [ -n "${TEST_SRC:-}" ]; then + cp -R $TEST_SRC acir_tests + else + rm -rf noir + git clone -b $BRANCH --filter=blob:none --no-checkout https://github.com/noir-lang/noir.git + cd noir + git sparse-checkout init --cone + git sparse-checkout set tooling/nargo_cli/tests/acir_artifacts + git checkout + cd .. + mv noir/tooling/nargo_cli/tests/acir_artifacts acir_tests + rm -rf noir + fi +fi \ No newline at end of file diff --git a/barretenberg/acir_tests/flows/proof_as_fields.sh b/barretenberg/acir_tests/flows/proof_as_fields.sh deleted file mode 100755 index ce5772263ca..00000000000 --- a/barretenberg/acir_tests/flows/proof_as_fields.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -eu - -if [ -n "$VERBOSE" ]; then - $BIN proof_as_fields -v -c $CRS_PATH -p "./proofs/$PROOF_NAME" -else - $BIN proof_as_fields -c $CRS_PATH -p "./proofs/$PROOF_NAME" -fi \ No newline at end of file diff --git a/barretenberg/acir_tests/flows/prove.sh b/barretenberg/acir_tests/flows/prove.sh deleted file mode 100755 index e6a1d818761..00000000000 --- a/barretenberg/acir_tests/flows/prove.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -set -eu - -echo -n "INSIDE PROVE SCRIPT" -echo -n "$RECURSIVE" - -if [ -n "$VERBOSE" ]; then - if [ -n "$RECURSIVE" ]; then - $BIN prove -v -c $CRS_PATH -b ./target/acir.gz -o "./proofs/$PROOF_NAME" -r - else - $BIN prove -v -c $CRS_PATH -b ./target/acir.gz -o "./proofs/$PROOF_NAME" - fi -else - if [ -n "$RECURSIVE" ]; then - echo -n "HERE" - - $BIN prove -v -c $CRS_PATH -b ./target/acir.gz -o "./proofs/$PROOF_NAME" -r - else - $BIN prove -c $CRS_PATH -b ./target/acir.gz -o "./proofs/$PROOF_NAME" - fi -fi \ No newline at end of file diff --git a/barretenberg/acir_tests/flows/vk_as_fields.sh b/barretenberg/acir_tests/flows/vk_as_fields.sh deleted file mode 100755 index e982ff6e354..00000000000 --- a/barretenberg/acir_tests/flows/vk_as_fields.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -eu - -if [ -n "$VERBOSE" ]; then - $BIN vk_as_fields -v -c $CRS_PATH -else - $BIN vk_as_fields -c $CRS_PATH -fi \ No newline at end of file diff --git a/barretenberg/acir_tests/flows/write_vk.sh b/barretenberg/acir_tests/flows/write_vk.sh deleted file mode 100755 index e8dadf5e94a..00000000000 --- a/barretenberg/acir_tests/flows/write_vk.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -eu - -if [ -n "$VERBOSE" ]; then - $BIN write_vk -v -c $CRS_PATH -o -else - $BIN write_vk -c $CRS_PATH -fi \ No newline at end of file diff --git a/barretenberg/acir_tests/gen_inner_proof_inputs.sh b/barretenberg/acir_tests/gen_inner_proof_inputs.sh index 70b02d320ac..759f077cd44 100755 --- a/barretenberg/acir_tests/gen_inner_proof_inputs.sh +++ b/barretenberg/acir_tests/gen_inner_proof_inputs.sh @@ -4,75 +4,42 @@ set -eu BIN=${BIN:-../cpp/build/bin/bb} -WRITE_VK_FLOW=${FLOW:-write_vk} -VK_FIELDS_FLOW=${FLOW:-vk_as_fields} -PROVE_FLOW=${FLOW:-prove} -PROOF_FIELDS_FLOW=${FLOW:-proof_as_fields} CRS_PATH=~/.bb-crs BRANCH=master VERBOSE=${VERBOSE:-} RECURSIVE=true PROOF_NAME="proof_a" -WRITE_VK_FLOW_SCRIPT=$(realpath ./flows/${WRITE_VK_FLOW}.sh) -VK_FIELDS_FLOW_SCRIPT=$(realpath ./flows/${VK_FIELDS_FLOW}.sh) -PROVE_FLOW_SCRIPT=$(realpath ./flows/${PROVE_FLOW}.sh) -PROOF_FIELDS_FLOW_SCRIPT=$(realpath ./flows/${PROOF_FIELDS_FLOW}.sh) - if [ -f $BIN ]; then BIN=$(realpath $BIN) else BIN=$(realpath $(which $BIN)) fi -export BIN CRS_PATH VERBOSE RECURSIVE PROOF_NAME - -# Pull down the test vectors from the noir repo, if we don't have the folder already. -if [ ! -d acir_tests ]; then - if [ -n "${TEST_SRC:-}" ]; then - cp -R $TEST_SRC acir_tests - else - rm -rf noir - git clone -b $BRANCH --filter=blob:none --no-checkout https://github.com/noir-lang/noir.git - cd noir - git sparse-checkout init --cone - git sparse-checkout set tooling/nargo_cli/tests/acir_artifacts - git checkout - cd .. - mv noir/tooling/nargo_cli/tests/acir_artifacts acir_tests - rm -rf noir - fi -fi +export BRANCH -cd acir_tests +./clone_test_vectors.sh -cd assert_statement +cd acir_tests/assert_statement PROOF_DIR=$PWD/proofs PROOF_PATH=$PROOF_DIR/$PROOF_NAME +VFLAG=${VERBOSE:+-v} +RFLAG=${RECURSIVE:+-r} -echo -e "Write VK to file for assert_statement..\n" -set +e -$WRITE_VK_FLOW_SCRIPT -set -eu +echo "Write VK to file for assert_statement..." +$BIN write_vk $VFLAG -c $CRS_PATH -o -echo -e "Write VK as fields for recursion...\n" -set +e -$VK_FIELDS_FLOW_SCRIPT -set -eu +echo "Write VK as fields for recursion..." +$BIN vk_as_fields $VFLAG -c $CRS_PATH -echo -e "Generate proof to file...\n" -set +e -if [ ! -d "$PROOF_DIR" ]; then - mkdir $PWD/proofs -fi -if [ ! -e "$PROOF_PATH" ]; then - touch $PROOF_PATH -fi -$PROVE_FLOW_SCRIPT -set -eu +echo "Generate proof to file..." +[ -d "$PROOF_DIR" ] || mkdir $PWD/proofs +[ -e "$PROOF_PATH" ] || touch $PROOF_PATH +$BIN prove $VFLAG -c $CRS_PATH -b ./target/acir.gz -o "./proofs/$PROOF_NAME" $RFLAG -echo -e "Write proof as fields for recursion...\n" -set +e -$PROOF_FIELDS_FLOW_SCRIPT -set -eu +echo "Write proof as fields for recursion..." +$BIN proof_as_fields $VFLAG -c $CRS_PATH -p "./proofs/$PROOF_NAME" + +cat ./proofs/${PROOF_NAME}_fields.json +echo \ No newline at end of file diff --git a/barretenberg/acir_tests/run_acir_tests.sh b/barretenberg/acir_tests/run_acir_tests.sh index 6121588d391..3c8a27918a8 100755 --- a/barretenberg/acir_tests/run_acir_tests.sh +++ b/barretenberg/acir_tests/run_acir_tests.sh @@ -19,24 +19,9 @@ else BIN=$(realpath $(which $BIN)) fi -export BIN CRS_PATH VERBOSE +export BIN CRS_PATH VERBOSE BRANCH -# Pull down the test vectors from the noir repo, if we don't have the folder already. -if [ ! -d acir_tests ]; then - if [ -n "${TEST_SRC:-}" ]; then - cp -R $TEST_SRC acir_tests - else - rm -rf noir - git clone -b $BRANCH --filter=blob:none --no-checkout https://github.com/noir-lang/noir.git - cd noir - git sparse-checkout init --cone - git sparse-checkout set tooling/nargo_cli/tests/acir_artifacts - git checkout - cd .. - mv noir/tooling/nargo_cli/tests/acir_artifacts acir_tests - rm -rf noir - fi -fi +./clone_test_vectors.sh cd acir_tests