From 49dacc3378a339f8cc36971b630c52952249f60c Mon Sep 17 00:00:00 2001 From: Charlie Lye Date: Thu, 2 Jan 2025 12:37:03 +0000 Subject: [PATCH] chore: Cl/ci3.2 (#10919) Further iteration towards full CI3. TLDR: Working towards ~10m repo test time. * Begin to separate out "building of tests" (mainly thinking of C++ and Rust). We don't want to do this on a fast bootstrap, but we do want to do it if we're going to run the tests. And moving towards the new testing model we need to separate building and running of tests. * Introduce `test-cmds` cmd on bootstrap scripts. Returns a list of commands, that if run from repo root, execute individual (usually) tests. * Note this also introduces the standard of `./scripts/run_test.sh` being a script that given some succinct arguments, can run a single test. * Introduce `test-all` (eventually to become just `test`) in root bootstrap.sh. No args runs all tests, or you can give it a list of folders to projects with their own bootstrap scripts and it'll run their tests. Runs in 10m20s. Currently skipping some things (see TODO below). Reports slow tests after run. * Note this also runs our TS project tests *directly as javascript*. i.e. it's assumed the tests have all been compiled to the dest folder and have whatever they need to operate. Hitting yarn + transpiler is just gruesome use of resources. * Improve cache script to not deal with env vars, but just args. If the args is a file, its treated as a rebuild patterns file, otherwise treated as a pattern itself. * Remove `TEST=0/1` flag. Unnecessary. Normal bootstraps don't run tests, and If i request to run tests I want them to run. So the "skip tests if cache flag exists" only needs to be applied if `CI=1`. * Get's rid of all hardcoded srs paths in favour of making function call to get the path. Will check environment variables first, and fallback on hardcoded path (now in one place). I ultimately didn't need this like I thought I would, but it's the right move anyway, and will make the switch to the flat crs easier. * Bit of refactoring to remove "right drift" of cache blocks. i.e. return if nothing to do instead of enclosing in an if statement. * bb.js uses @swc/jest like yarn-projects does. * Delete `bootstrap` folder. Is was there to help test the bootstrap script in CI, but now we use the bootstrap script in CI. * Add build cache to `boxes`. * Enable extended globs in CI3 scripts. * Revert back to default jest reporter, unless running all tests from root, then it uses summary reporter. TODO: - [ ] kv-store tests - [x] TXE for contracts/aztec.nr tests - [x] noir js packages tests - [ ] Skipping tests matching `test_caches_open|requests` in noir tests. - [x] Standardise how tests are skipped so we can see in one place. --------- Co-authored-by: ludamad --- barretenberg/acir_tests/bootstrap.sh | 160 ++++++++-------- .../acir_tests/browser-test-app/yarn.lock | 4 +- barretenberg/acir_tests/run_test_browser.sh | 2 + barretenberg/cpp/bootstrap.sh | 74 ++++---- barretenberg/cpp/scripts/run_test.sh | 14 ++ .../benchmark/basics_bench/basics.bench.cpp | 2 +- .../client_ivc_bench/client_ivc.bench.cpp | 4 +- .../benchmark/goblin_bench/eccvm.bench.cpp | 4 +- .../benchmark/ipa_bench/ipa.bench.cpp | 2 +- .../benchmark/pippenger_bench/main.cpp | 4 +- .../protogalaxy_bench/protogalaxy.bench.cpp | 2 +- .../protogalaxy_rounds.bench.cpp | 2 +- .../simulator_bench/simulator.bench.cpp | 2 +- .../benchmark/stdlib_hash/pedersen.bench.cpp | 2 +- .../benchmark/ultra_bench/mock_circuits.hpp | 2 +- .../ultra_bench/ultra_honk_rounds.bench.cpp | 2 +- .../ultra_bench/ultra_plonk_rounds.bench.cpp | 2 +- .../benchmark/widgets_bench/widget.bench.cpp | 2 +- .../client_ivc/client_ivc.test.cpp | 12 +- .../client_ivc_integration.test.cpp | 4 +- .../client_ivc/mock_kernel_pinning.test.cpp | 2 +- .../commitment_schemes/commit.bench.cpp | 2 +- .../commitment_key.test.hpp | 6 +- .../commitment_schemes/ipa/ipa.fuzzer.cpp | 6 +- .../sparse_commitment.test.cpp | 4 +- .../ipa_recursive.test.cpp | 2 +- .../shplemini.test.cpp | 2 +- .../zeromorph.test.cpp | 2 +- .../dsl/acir_format/acir_format.test.cpp | 2 +- .../dsl/acir_format/acir_integration.test.cpp | 6 +- .../avm_recursion_constraint.test.cpp | 2 +- .../acir_format/bigint_constraint.test.cpp | 2 +- .../dsl/acir_format/block_constraint.test.cpp | 4 +- .../dsl/acir_format/ec_operations.test.cpp | 2 +- .../dsl/acir_format/ecdsa_secp256k1.test.cpp | 2 +- .../dsl/acir_format/ecdsa_secp256r1.test.cpp | 8 +- .../honk_recursion_constraint.test.cpp | 4 +- .../ivc_recursion_constraint.test.cpp | 4 +- .../dsl/acir_format/multi_scalar_mul.test.cpp | 2 +- .../acir_format/poseidon2_constraint.test.cpp | 2 +- .../acir_format/recursion_constraint.test.cpp | 2 +- .../acir_format/sha256_constraint.test.cpp | 2 +- .../eccvm/eccvm_circuit_builder.test.cpp | 2 +- .../eccvm/eccvm_composer.test.cpp | 2 +- .../eccvm/eccvm_transcript.test.cpp | 2 +- .../notes/circuit/value/value_note.test.cpp | 2 +- .../examples/simple/simple.test.cpp | 2 +- .../src/barretenberg/flavor/flavor.test.cpp | 2 +- .../src/barretenberg/goblin/mock_circuits.hpp | 2 +- .../goblin/mock_circuits_pinning.test.cpp | 2 +- .../plonk/composer/standard_composer.test.cpp | 4 +- .../plonk/composer/ultra_composer.test.cpp | 4 +- .../commitment_scheme.test.cpp | 8 +- .../plonk/proof_system/prover/prover.test.cpp | 3 +- .../proving_key/proving_key.test.cpp | 4 +- .../proof_system/verifier/verifier.test.cpp | 5 +- .../composer/composer_lib.test.cpp | 2 +- .../polynomials/legacy_polynomials.bench.cpp | 3 +- .../protogalaxy/protogalaxy.test.cpp | 2 +- .../srs/factories/mem_crs_factory.test.cpp | 11 +- .../cpp/src/barretenberg/srs/global_crs.hpp | 31 ++++ .../cpp/src/barretenberg/srs/io.test.cpp | 3 +- .../srs/scalar_multiplication.test.cpp | 5 +- .../client_ivc_recursive_verifier.test.cpp | 4 +- .../eccvm_recursive_verifier.test.cpp | 4 +- .../verifier_commitment_key.test.cpp | 4 +- .../stdlib/goblin_verifier/goblin.test.cpp | 4 +- .../goblin_verifier/goblin_recursion.test.cpp | 4 +- .../goblin_recursive_verifier.test.cpp | 8 +- .../goblin_verifier/merge_verifier.test.cpp | 2 +- .../ultra_recursive_verifier.test.cpp | 2 +- .../verification_key.test.cpp | 8 +- .../verifier/verifier.test.cpp | 2 +- .../protogalaxy_recursive_verifier.test.cpp | 2 +- .../translator_recursive_verifier.test.cpp | 2 +- .../flavor_serialization.test.cpp | 2 +- .../grand_product_library.test.cpp | 2 +- .../permutation_lib.test.cpp | 2 +- .../barretenberg/sumcheck/sumcheck.test.cpp | 2 +- .../relation_correctness.test.cpp | 2 +- .../translator_vm/translator.test.cpp | 2 +- .../translator_composer.fuzzer.cpp | 2 +- .../barretenberg/ultra_honk/databus.test.cpp | 2 +- .../ultra_honk/mega_honk.test.cpp | 2 +- .../ultra_honk/mega_transcript.test.cpp | 2 +- .../ultra_honk/relation_correctness.test.cpp | 2 +- .../barretenberg/ultra_honk/sumcheck.test.cpp | 2 +- .../ultra_honk/ultra_honk.test.cpp | 2 +- .../ultra_honk/ultra_transcript.test.cpp | 2 +- .../vm/avm/tests/arithmetic.test.cpp | 2 +- .../vm/avm/tests/bitwise.test.cpp | 2 +- .../barretenberg/vm/avm/tests/cast.test.cpp | 2 +- .../vm/avm/tests/comparison.test.cpp | 2 +- .../vm/avm/tests/control_flow.test.cpp | 2 +- .../vm/avm/tests/execution.test.cpp | 2 +- .../barretenberg/vm/avm/tests/gas.test.cpp | 2 +- .../vm/avm/tests/indirect_mem.test.cpp | 2 +- .../vm/avm/tests/inter_table.test.cpp | 2 +- .../barretenberg/vm/avm/tests/kernel.test.cpp | 2 +- .../vm/avm/tests/mem_opcodes.test.cpp | 2 +- .../barretenberg/vm/avm/tests/memory.test.cpp | 2 +- .../vm/avm/tests/recursive_verifier.test.cpp | 2 +- .../barretenberg/vm/avm/tests/slice.test.cpp | 2 +- barretenberg/ts/bootstrap.sh | 19 +- barretenberg/ts/package.json | 23 ++- barretenberg/ts/scripts/build_wasm.sh | 4 +- barretenberg/ts/scripts/run_test.sh | 11 ++ barretenberg/ts/scripts/run_tests | 8 - .../barretenberg_wasm_base/index.ts | 6 +- barretenberg/ts/yarn.lock | 163 ++++++++++++++++ bootstrap.sh | 51 +++++ bootstrap/Dockerfile.alpine | 25 --- bootstrap/Dockerfile.lunar | 23 --- bootstrap/bootstrap_test.sh | 31 ---- boxes/.rebuild_patterns | 1 + boxes/bootstrap.sh | 37 ++-- boxes/scripts/run_test.sh | 6 + build-images/bootstrap.sh | 1 - ci3/bootstrap_local | 3 +- ci3/denoise | 3 + ci3/dump_fail | 1 + ci3/source | 7 +- ci3/source_bootstrap | 4 - ci3/test_should_run | 22 +-- l1-contracts/bootstrap.sh | 19 +- noir-projects/aztec-nr/bootstrap.sh | 39 ++++ noir-projects/bootstrap.sh | 81 ++++---- noir-projects/noir-contracts/bootstrap.sh | 36 +++- .../noir-protocol-circuits/bootstrap.sh | 22 ++- noir-projects/scripts/run_test.sh | 16 ++ noir/bootstrap.sh | 48 ++++- noir/noir-repo/.gitignore | 2 + noir/noir-repo/tooling/debugger/build.rs | 5 +- noir/noir-repo/tooling/nargo_cli/build.rs | 5 +- .../tooling/nargo_cli/src/cli/test_cmd.rs | 13 ++ noir/scripts/run_test.sh | 8 + yarn-project/accounts/package.json | 7 +- yarn-project/archiver/package.json | 7 +- yarn-project/aztec-faucet/package.json | 7 +- yarn-project/aztec-node/package.json | 7 +- yarn-project/aztec.js/package.json | 7 +- yarn-project/aztec/package.json | 7 +- yarn-project/bb-prover/package.json | 7 +- yarn-project/bootstrap.sh | 175 ++---------------- yarn-project/bot/package.json | 7 +- yarn-project/builder/package.json | 7 +- yarn-project/circuit-types/package.json | 7 +- yarn-project/circuits.js/package.json | 7 +- yarn-project/cli-wallet/package.json | 7 +- yarn-project/cli/package.json | 7 +- yarn-project/end-to-end/bootstrap.sh | 104 +++++++++++ yarn-project/end-to-end/scripts/test.sh | 9 +- yarn-project/entrypoints/package.json | 7 +- yarn-project/epoch-cache/package.json | 7 +- yarn-project/ethereum/package.json | 7 +- yarn-project/foundation/package.json | 7 +- .../foundation/src/wasm/wasm_module.test.ts | 28 --- yarn-project/ivc-integration/package.json | 7 +- .../browser_client_ivc_integration.test.ts | 1 - yarn-project/ivc-integration/src/index.ts | 13 +- yarn-project/ivc-integration/src/serve.ts | 1 - yarn-project/key-store/package.json | 7 +- yarn-project/kv-store/package.json | 9 +- .../kv-store/web-test-runner.config.mjs | 7 +- yarn-project/merkle-tree/package.json | 7 +- yarn-project/noir-contracts.js/package.json | 7 +- .../noir-protocol-circuits-types/package.json | 7 +- yarn-project/p2p-bootstrap/package.json | 7 +- yarn-project/p2p/package.json | 7 +- yarn-project/package.common.json | 2 +- yarn-project/package.json | 3 +- yarn-project/proof-verifier/package.json | 7 +- yarn-project/protocol-contracts/package.json | 7 +- yarn-project/prover-client/package.json | 7 +- .../src/test/bb_prover_full_rollup.test.ts | 1 + yarn-project/prover-node/package.json | 7 +- yarn-project/pxe/package.json | 7 +- yarn-project/scripts/package.json | 7 +- yarn-project/scripts/run_test.sh | 15 ++ yarn-project/sequencer-client/package.json | 7 +- yarn-project/simulator/package.json | 7 +- yarn-project/telemetry-client/package.json | 7 +- yarn-project/txe/package.json | 9 +- yarn-project/types/package.json | 7 +- yarn-project/validator-client/package.json | 7 +- yarn-project/world-state/package.json | 7 +- yarn-project/yarn.lock | 65 ------- 187 files changed, 1037 insertions(+), 975 deletions(-) create mode 100755 barretenberg/cpp/scripts/run_test.sh create mode 100755 barretenberg/ts/scripts/run_test.sh delete mode 100755 barretenberg/ts/scripts/run_tests delete mode 100644 bootstrap/Dockerfile.alpine delete mode 100644 bootstrap/Dockerfile.lunar delete mode 100755 bootstrap/bootstrap_test.sh create mode 100644 boxes/.rebuild_patterns create mode 100755 boxes/scripts/run_test.sh create mode 100755 noir-projects/aztec-nr/bootstrap.sh create mode 100755 noir-projects/scripts/run_test.sh create mode 100755 noir/scripts/run_test.sh create mode 100755 yarn-project/end-to-end/bootstrap.sh delete mode 100644 yarn-project/foundation/src/wasm/wasm_module.test.ts create mode 100755 yarn-project/scripts/run_test.sh diff --git a/barretenberg/acir_tests/bootstrap.sh b/barretenberg/acir_tests/bootstrap.sh index b5504e5d825..8744602f759 100755 --- a/barretenberg/acir_tests/bootstrap.sh +++ b/barretenberg/acir_tests/bootstrap.sh @@ -4,20 +4,20 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} export CRS_PATH=$HOME/.bb-crs -function build { +function build_tests { set -eu - if [ ! -d acir_tests ]; then - cp -R ../../noir/noir-repo/test_programs/execution_success acir_tests - # Running these requires extra gluecode so they're skipped. - rm -rf acir_tests/{diamond_deps_0,workspace,workspace_default_member} - # TODO(https://github.com/AztecProtocol/barretenberg/issues/1108): problem regardless the proof system used - rm -rf acir_tests/regression_5045 - fi + + github_group "acir_tests build" + + rm -rf acir_tests + cp -R ../../noir/noir-repo/test_programs/execution_success acir_tests + # Running these requires extra gluecode so they're skipped. + rm -rf acir_tests/{diamond_deps_0,workspace,workspace_default_member} + # TODO(https://github.com/AztecProtocol/barretenberg/issues/1108): problem regardless the proof system used + rm -rf acir_tests/regression_5045 # COMPILE=2 only compiles the test. - github_group "acir_tests compiling" - parallel --joblog joblog.txt --line-buffered 'COMPILE=2 ./run_test.sh $(basename {})' ::: ./acir_tests/* - github_endgroup + denoise "parallel --joblog joblog.txt --line-buffered 'COMPILE=2 ./run_test.sh \$(basename {})' ::: ./acir_tests/*" # TODO: This actually breaks things, but shouldn't. We want to do it here and not maintain manually. # Regenerate verify_honk_proof recursive input. @@ -25,137 +25,137 @@ function build { # (cd ./acir_tests/assert_statement && \ # $bb write_recursion_inputs_honk -b ./target/program.json -o ../verify_honk_proof --recursive) - github_group "acir_tests updating yarn" # Update yarn.lock so it can be committed. # Be lenient about bb.js hash changing, even if we try to minimize the occurrences. - (cd browser-test-app && yarn add --dev @aztec/bb.js@../../ts && yarn) - (cd headless-test && yarn) - (cd sol-test && yarn) + denoise "cd browser-test-app && yarn add --dev @aztec/bb.js@../../ts && yarn" + denoise "cd headless-test && yarn" + denoise "cd sol-test && yarn" # The md5sum of everything is the same after each yarn call. # Yet seemingly yarn's content hash will churn unless we reset timestamps find {headless-test,browser-test-app} -exec touch -t 197001010000 {} + 2>/dev/null || true - github_endgroup - github_group "acir_tests building browser-test-app" - (cd browser-test-app && yarn build) + denoise "cd browser-test-app && yarn build" + github_endgroup } function hash { - cache_content_hash ../../noir/.rebuild_patterns ../../noir/.rebuild_patterns_tests ../../barretenberg/cpp/.rebuild_patterns ../../barretenberg/ts/.rebuild_patterns + cache_content_hash \ + ../../noir/.rebuild_patterns \ + ../../noir/.rebuild_patterns_tests \ + ../../barretenberg/cpp/.rebuild_patterns \ + ../../barretenberg/ts/.rebuild_patterns } + function test { set -eu - github_group "acir_tests testing" + local hash=$(hash) - if ! test_should_run barretenberg-acir-tests-$hash; then - github_endgroup - return - fi + test_should_run barretenberg-acir-tests-$hash || return 0 + + github_group "acir_tests testing" # TODO: These are some magic numbers that fit our dev/ci environments. They ultimately need to work on lower hardware. export HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-8} # local jobs=$(($(nproc) / HARDWARE_CONCURRENCY)) local jobs=64 - # Create temporary file descriptor 3, and redirects anything written to it, to parallels stdin. - exec 3> >(parallel -j$jobs --tag --line-buffered --joblog joblog.txt) - local pid=$! - trap "kill -SIGTERM $pid 2>/dev/null || true" EXIT + test_cmds | (cd $root; parallel -j$jobs --tag --line-buffered --joblog joblog.txt) - # Run function for syntactic simplicity. - run() { - echo "$*" >&3 - } + cache_upload_flag barretenberg-acir-tests-$hash + github_endgroup +} +# Prints to stdout, one per line, the command to execute each individual test. +# Paths are all relative to the repository root. +function test_cmds { local plonk_tests=$(find ./acir_tests -maxdepth 1 -mindepth 1 -type d | \ grep -vE 'verify_honk_proof|double_verify_honk_proof|verify_rollup_honk_proof') local honk_tests=$(find ./acir_tests -maxdepth 1 -mindepth 1 -type d | \ grep -vE 'single_verify_proof|double_verify_proof|double_verify_nested_proof|verify_rollup_honk_proof') + local run_test=$(realpath --relative-to=$root ./run_test.sh) + local run_test_browser=$(realpath --relative-to=$root ./run_test_browser.sh) + local bbjs_bin="../ts/dest/node/main.js" + # barretenberg-acir-tests-sol: - run FLOW=sol ./run_test.sh assert_statement - run FLOW=sol ./run_test.sh double_verify_proof - run FLOW=sol ./run_test.sh double_verify_nested_proof - run FLOW=sol_honk ./run_test.sh assert_statement - run FLOW=sol_honk ./run_test.sh 1_mul - run FLOW=sol_honk ./run_test.sh slices - run FLOW=sol_honk ./run_test.sh verify_honk_proof + echo FLOW=sol $run_test assert_statement + echo FLOW=sol $run_test double_verify_proof + echo FLOW=sol $run_test double_verify_nested_proof + echo FLOW=sol_honk $run_test assert_statement + echo FLOW=sol_honk $run_test 1_mul + echo FLOW=sol_honk $run_test slices + echo FLOW=sol_honk $run_test verify_honk_proof # barretenberg-acir-tests-bb.js: # Browser tests. - run BROWSER=chrome THREAD_MODEL=mt PORT=8080 ./run_test_browser.sh verify_honk_proof - run BROWSER=chrome THREAD_MODEL=st PORT=8081 ./run_test_browser.sh 1_mul - run BROWSER=webkit THREAD_MODEL=mt PORT=8082 ./run_test_browser.sh verify_honk_proof - run BROWSER=webkit THREAD_MODEL=st PORT=8083 ./run_test_browser.sh 1_mul - # Run ecdsa_secp256r1_3x through bb.js on node to check 256k support. - run BIN=../ts/dest/node/main.js FLOW=prove_then_verify ./run_test.sh ecdsa_secp256r1_3x - # Run the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs. - run BIN=../ts/dest/node/main.js SYS=ultra_honk FLOW=prove_then_verify ./run_test.sh 6_array - # Run a single arbitrary test not involving recursion through bb.js for MegaHonk - run BIN=../ts/dest/node/main.js SYS=mega_honk FLOW=prove_and_verify ./run_test.sh 6_array - # Run 1_mul through bb.js build, all_cmds flow, to test all cli args. - run BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_test.sh 1_mul + echo BROWSER=chrome THREAD_MODEL=mt PORT=8080 $run_test_browser verify_honk_proof + echo BROWSER=chrome THREAD_MODEL=st PORT=8081 $run_test_browser 1_mul + echo BROWSER=webkit THREAD_MODEL=mt PORT=8082 $run_test_browser verify_honk_proof + echo BROWSER=webkit THREAD_MODEL=st PORT=8083 $run_test_browser 1_mul + # echo ecdsa_secp256r1_3x through bb.js on node to check 256k support. + echo BIN=$bbjs_bin FLOW=prove_then_verify $run_test ecdsa_secp256r1_3x + # echo the prove then verify flow for UltraHonk. This makes sure we have the same circuit for different witness inputs. + echo BIN=$bbjs_bin SYS=ultra_honk FLOW=prove_then_verify $run_test 6_array + # echo a single arbitrary test not involving recursion through bb.js for MegaHonk + echo BIN=$bbjs_bin SYS=mega_honk FLOW=prove_and_verify $run_test 6_array + # echo 1_mul through bb.js build, all_cmds flow, to test all cli args. + echo BIN=$bbjs_bin FLOW=all_cmds $run_test 1_mul # barretenberg-acir-tests-bb: # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof - run FLOW=prove_then_verify_tube ./run_test.sh 6_array - # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - run FLOW=all_cmds ./run_test.sh 1_mul + echo FLOW=prove_then_verify_tube $run_test 6_array + # echo 1_mul through native bb build, all_cmds flow, to test all cli args. + echo FLOW=all_cmds $run_test 1_mul # barretenberg-acir-tests-bb-ultra-plonk: # Exclude honk tests. for t in $plonk_tests; do - run FLOW=prove_then_verify ./run_test.sh $(basename $t) + echo FLOW=prove_then_verify $run_test $(basename $t) done - run FLOW=prove_then_verify RECURSIVE=true ./run_test.sh assert_statement - run FLOW=prove_then_verify RECURSIVE=true ./run_test.sh double_verify_proof + echo FLOW=prove_then_verify RECURSIVE=true $run_test assert_statement + echo FLOW=prove_then_verify RECURSIVE=true $run_test double_verify_proof # barretenberg-acir-tests-bb-ultra-honk: # Exclude plonk tests. for t in $honk_tests; do - run SYS=ultra_honk FLOW=prove_then_verify ./run_test.sh $(basename $t) + echo SYS=ultra_honk FLOW=prove_then_verify $run_test $(basename $t) done - run SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true ./run_test.sh assert_statement - run SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true ./run_test.sh double_verify_honk_proof - run SYS=ultra_honk FLOW=prove_and_verify_program ./run_test.sh merkle_insert - run SYS=ultra_rollup_honk FLOW=prove_and_verify ./run_test.sh verify_rollup_honk_proof - + echo SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true $run_test assert_statement + echo SYS=ultra_honk FLOW=prove_then_verify RECURSIVE=true $run_test double_verify_honk_proof + echo SYS=ultra_honk FLOW=prove_and_verify_program $run_test merkle_insert + echo SYS=ultra_rollup_honk FLOW=prove_then_verify $run_test verify_rollup_honk_proof # barretenberg-acir-tests-bb-client-ivc: - run FLOW=prove_then_verify_client_ivc ./run_test.sh 6_array - run FLOW=prove_then_verify_client_ivc ./run_test.sh databus - run FLOW=prove_then_verify_client_ivc ./run_test.sh databus_two_calldata - - # Close parallels input file descriptor and wait for completion. - exec 3>&- - wait $pid - - cache_upload_flag barretenberg-acir-tests-$hash - github_endgroup + echo FLOW=prove_then_verify_client_ivc $run_test 6_array + echo FLOW=prove_then_verify_client_ivc $run_test databus + echo FLOW=prove_then_verify_client_ivc $run_test databus_two_calldata } -export -f build test +export -f build_tests test case "$cmd" in "clean") git clean -fdx (cd ../../noir/noir-repo/test_programs/execution_success && git clean -fdx) ;; - ""|"fast") + ""|"fast"|"full") ;; - "full") - denoise build + "build-tests") + build_tests ;; "ci") - denoise build - denoise test + build_tests + test ;; "hash") hash ;; "test") - denoise test + test + ;; + "test-cmds") + test_cmds ;; *) echo "Unknown command: $cmd" diff --git a/barretenberg/acir_tests/browser-test-app/yarn.lock b/barretenberg/acir_tests/browser-test-app/yarn.lock index 37157884379..4ffc4c0bdf5 100644 --- a/barretenberg/acir_tests/browser-test-app/yarn.lock +++ b/barretenberg/acir_tests/browser-test-app/yarn.lock @@ -7,7 +7,7 @@ __metadata: "@aztec/bb.js@file:../../ts::locator=browser-test-app%40workspace%3A.": version: 0.67.1 - resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=29e47a&locator=browser-test-app%40workspace%3A." + resolution: "@aztec/bb.js@file:../../ts#../../ts::hash=cd38cd&locator=browser-test-app%40workspace%3A." dependencies: comlink: "npm:^4.4.1" commander: "npm:^12.1.0" @@ -17,7 +17,7 @@ __metadata: tslib: "npm:^2.4.0" bin: bb.js: ./dest/node/main.js - checksum: 10c0/c01128ff74f29b6bbc5c46362792525ef5612c5fc8787341551bcf457ba9816a971e24a74292ab230c47b0b9efe8d7e0d1cabd44247e1b6e718727d0b6372400 + checksum: 10c0/c6c1476f5f5d5cc1ea7022043e00870ee0743fd73a532c171586ab74bac53f3888c648bd4057de5a602e4a556cbb5d91454f57e0875ab002ccc87e7f83f12e43 languageName: node linkType: hard diff --git a/barretenberg/acir_tests/run_test_browser.sh b/barretenberg/acir_tests/run_test_browser.sh index 1b565ea54a2..bec27a2ec43 100755 --- a/barretenberg/acir_tests/run_test_browser.sh +++ b/barretenberg/acir_tests/run_test_browser.sh @@ -6,6 +6,8 @@ cleanup() { } trap cleanup EXIT +cd $(dirname $0) + # Skipping firefox because this headless firefox is so slow. export BROWSER=${BROWSER:-chrome,webkit} diff --git a/barretenberg/cpp/bootstrap.sh b/barretenberg/cpp/bootstrap.sh index aad3427e64a..931abd31945 100755 --- a/barretenberg/cpp/bootstrap.sh +++ b/barretenberg/cpp/bootstrap.sh @@ -3,22 +3,8 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} -# Determine system. -if [[ "$OSTYPE" == "darwin"* ]]; then - os=macos -elif [[ "$OSTYPE" == "linux-gnu" ]]; then - os=linux -elif [[ "$OSTYPE" == "linux-musl" ]]; then - os=linux -else - echo "Unknown OS: $OSTYPE" - exit 1 -fi - -# Pick native toolchain. preset=clang16-assert pic_preset="clang16-pic" - hash=$(cache_content_hash .rebuild_patterns) function build_native { @@ -68,36 +54,26 @@ function build { github_group "bb cpp build" export preset pic_preset hash export -f build_native build_wasm build_wasm_threads - parallel --line-buffered -v --tag --memfree 8g denoise {} ::: build_native build_wasm build_wasm_threads + parallel --line-buffered -v --tag denoise {} ::: build_native build_wasm build_wasm_threads github_endgroup } -function test { - if test_should_run barretenberg-test-$hash; then - github_group "bb test" - - echo "Check formatting..." - ./format.sh check - - echo "Building tests..." - denoise cmake --preset $preset -Bbuild "&&" cmake --build build - - # Download ignition transcripts. - # TODO: Use the flattened crs. These old transcripts are a pain. - echo "Downloading srs..." - denoise "cd ./srs_db && ./download_ignition.sh 3 && ./download_grumpkin.sh" - if [ ! -d ./srs_db/grumpkin ]; then - # The Grumpkin SRS is generated manually at the moment, only up to a large enough size for tests - # If tests require more points, the parameter can be increased here. Note: IPA requires - # dyadic_circuit_size + 1 points so in general this number will be a power of two plus 1 - cd ./build && cmake --build . --parallel --target grumpkin_srs_gen && ./bin/grumpkin_srs_gen 32769 - fi +function build_tests { + github_group "bb build tests" + denoise ./format.sh check + denoise cmake --preset $preset -Bbuild "&&" cmake --build build + # Download ignition transcripts. Only needed for tests. + # The actual bb binary uses the flat crs downloaded in barratenberg/bootstrap.sh to ~/.bb-crs. + # TODO: Use the flattened crs. These old transcripts are a pain. + denoise "cd ./srs_db && ./download_ignition.sh 3 && ./download_grumpkin.sh" +} - echo "Testing..." - (cd build && GTEST_COLOR=1 denoise ctest -j32 --output-on-failure) - cache_upload_flag barretenberg-test-$hash - github_endgroup - fi +function test { + test_should_run barretenberg-test-$hash || return 0 + github_group "bb test" + (cd build && GTEST_COLOR=1 denoise ctest -j32 --output-on-failure) + cache_upload_flag barretenberg-test-$hash + github_endgroup } case "$cmd" in @@ -105,22 +81,40 @@ case "$cmd" in git clean -fdx ;; ""|"fast") + # Build bb and wasms. Can be incremental. build ;; "full") + # Deletes all build dirs and build bb and wasms from scratch. rm -rf build* build ;; + "build-tests") + # Build the entire native repo, including all tests and benchmarks. + build_tests + ;; "test") + # Run the tests. Assumes they've been (re)built with a call to build_tests. test ;; "ci") build + build_tests test ;; "hash") echo $hash ;; + "test-cmds") + # Print every individual test command. Can be fed into gnu parallel. + cd build + for bin in ./bin/*_tests; do + bin_name=$(basename $bin) + $bin --gtest_list_tests | \ + awk -vbin=$bin_name '/^[a-zA-Z]/ {suite=$1} /^[ ]/ {print "barretenberg/cpp/scripts/run_test.sh " bin " " suite$1}' | \ + sed 's/\.$//' | grep -v 'DISABLED_' + done + ;; *) echo "Unknown command: $cmd" exit 1 diff --git a/barretenberg/cpp/scripts/run_test.sh b/barretenberg/cpp/scripts/run_test.sh new file mode 100755 index 00000000000..ca424e36aab --- /dev/null +++ b/barretenberg/cpp/scripts/run_test.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# This runs an individual test. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +cd $(dirname $0)/../build + +export GTEST_COLOR=1 +export HARDWARE_CONCURRENCY=8 +# export IGNITION_CRS_PATH="./barretenberg/cpp/srs_db/ignition" +# export GRUMPKIN_CRS_PATH="./barretenberg/cpp/srs_db/grumpkin" + +./bin/$1 --gtest_filter=$2 \ No newline at end of file diff --git a/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp index 586199aea53..66001f55568 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/basics_bench/basics.bench.cpp @@ -433,7 +433,7 @@ void uint_extended_multiplication(State& state) */ static void DoPippengerSetup(const benchmark::State&) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp index 2acbb568272..d5bd296ebac 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/client_ivc.bench.cpp @@ -23,8 +23,8 @@ class ClientIVCBench : public benchmark::Fixture { void SetUp([[maybe_unused]] const ::benchmark::State& state) override { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp index af7ca5ea43d..10bf6c077e6 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/goblin_bench/eccvm.bench.cpp @@ -44,7 +44,7 @@ Builder generate_trace(size_t target_num_gates) void eccvm_generate_prover(State& state) noexcept { - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); size_t target_num_gates = 1 << static_cast(state.range(0)); for (auto _ : state) { @@ -55,7 +55,7 @@ void eccvm_generate_prover(State& state) noexcept void eccvm_prove(State& state) noexcept { - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); size_t target_num_gates = 1 << static_cast(state.range(0)); Builder builder = generate_trace(target_num_gates); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp index 304a0a8a1ef..5f44aba231d 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ipa_bench/ipa.bench.cpp @@ -20,7 +20,7 @@ std::vector> prover_transcripts(MAX_POLYNOMIAL std::vector> opening_claims(MAX_POLYNOMIAL_DEGREE_LOG2 - MIN_POLYNOMIAL_DEGREE_LOG2 + 1); static void DoSetup(const benchmark::State&) { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ck = std::make_shared>(1 << MAX_POLYNOMIAL_DEGREE_LOG2); vk = std::make_shared>(1 << MAX_POLYNOMIAL_DEGREE_LOG2, srs::get_grumpkin_crs_factory()); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp b/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp index 6cacf26a5de..33f16b63f56 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/pippenger_bench/main.cpp @@ -65,7 +65,7 @@ const auto init = []() { // constexpr double add_to_mixed_add_complexity = 1.36; auto reference_string = - std::make_shared>(NUM_POINTS, "../srs_db/ignition"); + std::make_shared>(NUM_POINTS, bb::srs::get_ignition_crs_path()); int pippenger() { @@ -104,7 +104,7 @@ int coset_fft_regular() int main() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::cout << "initializing" << std::endl; init(); std::cout << "executing normal fft" << std::endl; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp index 5f286ce838c..f32e797cb27 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_bench/protogalaxy.bench.cpp @@ -53,7 +53,7 @@ void fold_k(State& state) noexcept using ProtogalaxyProver = ProtogalaxyProver_>; using Builder = typename Flavor::CircuitBuilder; - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto log2_num_gates = static_cast(state.range(0)); diff --git a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp index 3fa5518ab1d..7af8f71cc7a 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/protogalaxy_rounds_bench/protogalaxy_rounds.bench.cpp @@ -18,7 +18,7 @@ void _bench_round(::benchmark::State& state, void (*F)(ProtogalaxyProver_; using ProtogalaxyProver = ProtogalaxyProver_; - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto log2_num_gates = static_cast(state.range(0)); const auto construct_key = [&]() { diff --git a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp index 5e51abb2b8c..1f29432f29f 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/simulator.bench.cpp @@ -24,7 +24,7 @@ template class SimulatorFixture : public benchmark::F void SetUp([[maybe_unused]] const ::benchmark::State& state) override { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp index 0ce805fe424..a2e29f0f366 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/stdlib_hash/pedersen.bench.cpp @@ -8,7 +8,7 @@ #include -#define BARRETENBERG_SRS_PATH "../srs_db/ignition" +#define BARRETENBERG_SRS_PATH bb::srs::get_ignition_crs_path() using namespace benchmark; using namespace bb; diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp index 8a56e671424..7bbcb5cf284 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/mock_circuits.hpp @@ -76,7 +76,7 @@ void construct_proof_with_specified_num_iterations( void (*test_circuit_function)(typename Prover::Flavor::CircuitBuilder&, size_t), size_t num_iterations) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); for (auto _ : state) { // Construct circuit and prover; don't include this part in measurement diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp index 3454e4af3da..621dfba72f9 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_honk_rounds.bench.cpp @@ -63,7 +63,7 @@ BB_PROFILE static void test_round_inner(State& state, MegaProver& prover, size_t BB_PROFILE static void test_round(State& state, size_t index) noexcept { auto log2_num_gates = static_cast(state.range(0)); - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); // TODO(https://github.com/AztecProtocol/barretenberg/issues/761) benchmark both sparse and dense circuits auto prover = bb::mock_circuits::get_prover( diff --git a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp index 19c82f368e4..9264e9d1aea 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/ultra_bench/ultra_plonk_rounds.bench.cpp @@ -49,7 +49,7 @@ BB_PROFILE static void test_round_inner(State& state, plonk::UltraProver& prover } BB_PROFILE static void test_round(State& state, size_t index) noexcept { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); for (auto _ : state) { state.PauseTiming(); // TODO: https://github.com/AztecProtocol/barretenberg/issues/761 benchmark both sparse and dense circuits diff --git a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp index 2967a8bf7a6..ea74f5108ca 100644 --- a/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/benchmark/widgets_bench/widget.bench.cpp @@ -36,7 +36,7 @@ struct BasicPlonkKeyAndTranscript { BasicPlonkKeyAndTranscript get_plonk_key_and_transcript() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto inner_composer = plonk::UltraComposer(); auto builder = typename plonk::UltraComposer::CircuitBuilder(); bb::mock_circuits::generate_basic_arithmetic_circuit(builder, 16); diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp index befb8d82a02..6d617ec2737 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.test.cpp @@ -13,8 +13,8 @@ class ClientIVCTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Flavor = ClientIVC::Flavor; @@ -346,8 +346,8 @@ TEST_F(ClientIVCTests, StructuredPrecomputedVKs) */ TEST(ClientIVCBenchValidation, Full6) { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ClientIVC ivc{ { CLIENT_IVC_BENCH_STRUCTURE } }; size_t total_num_circuits{ 12 }; @@ -365,8 +365,8 @@ TEST(ClientIVCBenchValidation, Full6) TEST(ClientIVCBenchValidation, Full6MockedVKs) { const auto run_test = []() { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); ClientIVC ivc{ { CLIENT_IVC_BENCH_STRUCTURE } }; size_t total_num_circuits{ 12 }; diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp index 2a32853c469..2fa80fd913c 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc_integration.test.cpp @@ -17,8 +17,8 @@ class ClientIVCIntegrationTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Flavor = ClientIVC::Flavor; diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp index 61cb907c0e1..5765a9902dd 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/mock_kernel_pinning.test.cpp @@ -18,7 +18,7 @@ class MockKernelTest : public ::testing::Test { using MockCircuitProducer = PrivateFunctionExecutionMockCircuitProducer; protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(MockKernelTest, PinFoldingKernelSizes) diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp index e6724850291..7ea550a48ec 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commit.bench.cpp @@ -9,7 +9,7 @@ namespace bb { template std::shared_ptr> create_commitment_key(const size_t num_points) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::string srs_path; return std::make_shared>(num_points); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp index f991e1aa164..adafef90c7c 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/commitment_key.test.hpp @@ -18,13 +18,13 @@ template inline std::shared_ptr CreateCommitmentKey(); template <> inline std::shared_ptr> CreateCommitmentKey>() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); return std::make_shared>(COMMITMENT_TEST_NUM_BN254_POINTS); } // For IPA template <> inline std::shared_ptr> CreateCommitmentKey>() { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); return std::make_shared>(COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); } @@ -48,7 +48,7 @@ inline std::shared_ptr> CreateVerifierCom VerifierCommitmentKey>() { auto crs_factory = std::make_shared>( - "../srs_db/grumpkin", COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); + bb::srs::get_grumpkin_crs_path(), COMMITMENT_TEST_NUM_GRUMPKIN_POINTS); return std::make_shared>(COMMITMENT_TEST_NUM_GRUMPKIN_POINTS, crs_factory); } template inline std::shared_ptr CreateVerifierCommitmentKey() diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp index 7006c3003a1..5c2dbfc1218 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/ipa/ipa.fuzzer.cpp @@ -43,10 +43,10 @@ using namespace bb; */ extern "C" void LLVMFuzzerInitialize(int*, char***) { - srs::init_grumpkin_crs_factory("../srs_db/ignition"); + srs::init_grumpkin_crs_factory(bb::srs::get_ignition_crs_path()); ck = std::make_shared>(COMMITMENT_TEST_NUM_POINTS); - auto crs_factory = std::make_shared>("../srs_db/grumpkin", - COMMITMENT_TEST_NUM_POINTS); + auto crs_factory = std::make_shared>( + bb::srs::get_grumpkin_crs_path(), COMMITMENT_TEST_NUM_POINTS); vk = std::make_shared>(COMMITMENT_TEST_NUM_POINTS, crs_factory); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp index 4ec17f8807a..59b94aa5d2c 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes/sparse_commitment.test.cpp @@ -77,7 +77,7 @@ template <> std::shared_ptr> CommitmentKeyTest::create_commitment_key< CommitmentKey>(const size_t num_points) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); return std::make_shared>(num_points); } @@ -86,7 +86,7 @@ template <> std::shared_ptr> CommitmentKeyTest::create_commitment_key< CommitmentKey>(const size_t num_points) { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); return std::make_shared>(num_points); } diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp index 9479dff856a..ca7f2875625 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/ipa_recursive.test.cpp @@ -91,7 +91,7 @@ class IPARecursiveTests : public CommitmentTest { void test_fixed_ipa_recursive_verifier() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); Builder builder_1(build_ipa_recursive_verifier_circuit(1 << 10)); Builder builder_2(build_ipa_recursive_verifier_circuit(1 << 11)); diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp index 97051dc2b08..3716d39da34 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/shplemini.test.cpp @@ -41,7 +41,7 @@ TEST(ShpleminiRecursionTest, ProveAndVerifySingle) using Polynomial = bb::Polynomial; using Transcript = bb::BaseTranscript>; - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto run_shplemini = [](size_t log_circuit_size) { size_t N = 1 << log_circuit_size; constexpr size_t NUM_UNSHIFTED = 2; diff --git a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp index fb70282a51f..4ec991706c9 100644 --- a/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp +++ b/barretenberg/cpp/src/barretenberg/commitment_schemes_recursion/zeromorph.test.cpp @@ -43,7 +43,7 @@ TEST(ZeroMorphRecursionTest, ProveAndVerifySingle) constexpr size_t NUM_UNSHIFTED = 2; constexpr size_t NUM_SHIFTED = 1; - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); std::vector u_challenge(LOG_N); for (size_t idx = 0; idx < LOG_N; ++idx) { u_challenge[idx] = NativeFr::random_element(&engine); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp index c2f9d7d997e..a3864aac069 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.test.cpp @@ -20,7 +20,7 @@ using Composer = plonk::UltraComposer; class AcirFormatTests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(AcirFormatTests, TestASingleConstraintNoPubInputs) { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp index 49ec32e7418..bcdc514b139 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_integration.test.cpp @@ -126,7 +126,7 @@ class AcirIntegrationTest : public ::testing::Test { } protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; class AcirIntegrationSingleTest : public AcirIntegrationTest, public testing::WithParamInterface {}; @@ -135,8 +135,8 @@ class AcirIntegrationFoldingTest : public AcirIntegrationTest, public testing::W protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp index 473ea82cce6..9718c72d3bc 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/avm_recursion_constraint.test.cpp @@ -42,7 +42,7 @@ class AcirAvmRecursionConstraint : public ::testing::Test { using OuterVerificationKey = UltraFlavor::VerificationKey; using OuterBuilder = UltraCircuitBuilder; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } // mutate the input kernel_public_inputs_vec to add end gas values static InnerBuilder create_inner_circuit([[maybe_unused]] std::vector& kernel_public_inputs_vec) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp index 00021bcbbba..4500e1780fd 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/bigint_constraint.test.cpp @@ -17,7 +17,7 @@ using Composer = plonk::UltraComposer; class BigIntTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp index 53ae075c146..6f76f393ae1 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/block_constraint.test.cpp @@ -16,7 +16,7 @@ using Composer = plonk::UltraComposer; class UltraPlonkRAM : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; class MegaHonk : public ::testing::Test { @@ -40,7 +40,7 @@ class MegaHonk : public ::testing::Test { } protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_block_constraint(BlockConstraint& constraint, WitnessVector& witness_values) { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp index a9e08c2eadf..e6e4db3d328 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ec_operations.test.cpp @@ -19,7 +19,7 @@ using curve_ct = bb::stdlib::secp256k1; class EcOperations : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_ec_add_constraint(EcAdd& ec_add_constraint, WitnessVector& witness_values) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp index 9c088a9a9cd..74c592635b2 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256k1.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class ECDSASecp256k1 : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; size_t generate_ecdsa_constraint(EcdsaSecp256k1Constraint& ecdsa_constraint, WitnessVector& witness_values) diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp index 5d46d49e701..4dcec537907 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ecdsa_secp256r1.test.cpp @@ -98,7 +98,7 @@ size_t generate_ecdsa_constraint(EcdsaSecp256r1Constraint& ecdsa_r1_constraint, TEST(ECDSASecp256r1, test_hardcoded) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; @@ -177,7 +177,7 @@ TEST(ECDSASecp256r1, test_hardcoded) TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); @@ -230,7 +230,7 @@ TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) // even though we are just building the circuit. TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); @@ -272,7 +272,7 @@ TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) TEST(ECDSASecp256r1, TestECDSAConstraintFail) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); EcdsaSecp256r1Constraint ecdsa_r1_constraint; WitnessVector witness_values; size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp index bec5fb78019..72ebeb1e9db 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/honk_recursion_constraint.test.cpp @@ -201,8 +201,8 @@ template class AcirHonkRecursionConstraint : public ::testing: protected: static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp index 283f675e59a..57cc857db36 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/ivc_recursion_constraint.test.cpp @@ -131,8 +131,8 @@ class IvcRecursionConstraintTest : public ::testing::Test { protected: void SetUp() override { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } }; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp index a30a79985b1..f9f89dae0a4 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/multi_scalar_mul.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class MSMTests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp index 269898e1225..2f5fd1d2806 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/poseidon2_constraint.test.cpp @@ -18,7 +18,7 @@ using Composer = plonk::UltraComposer; class Poseidon2Tests : public ::testing::Test { protected: - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using fr = field; diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp index e9e8c8ace77..51e7a088a13 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/recursion_constraint.test.cpp @@ -15,7 +15,7 @@ using namespace bb::plonk; using Composer = plonk::UltraComposer; class AcirRecursionConstraint : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; Builder create_inner_circuit() { diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp index 6a256234353..7e76c44f98b 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/sha256_constraint.test.cpp @@ -15,7 +15,7 @@ using Composer = plonk::UltraComposer; class Sha256Tests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(Sha256Tests, TestSha256Compression) diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp index 44181433bd0..0ee34da7aa7 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_circuit_builder.test.cpp @@ -471,7 +471,7 @@ TEST(ECCVMCircuitBuilderTests, InfinityFailure) using Fr = fr; auto P1 = G1::infinity(); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); // Add the same operations to the ECC op queue; the native computation is performed under the hood. auto op_queue = std::make_shared(); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp index 364c602b7d2..16525eb8b9f 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_composer.test.cpp @@ -16,7 +16,7 @@ using namespace bb; class ECCVMTests : public ::testing::Test { protected: - void SetUp() override { srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); }; + void SetUp() override { srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); }; }; namespace { auto& engine = numeric::get_debug_randomness(); diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp index 92d3ffc5f13..c285c8112e8 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_transcript.test.cpp @@ -11,7 +11,7 @@ using namespace bb; class ECCVMTranscriptTests : public ::testing::Test { public: - void SetUp() override { srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); }; + void SetUp() override { srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); }; using FF = grumpkin::fr; using Flavor = ECCVMFlavor; diff --git a/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp b/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp index 0c5393050af..c3d08097fe1 100644 --- a/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/join_split/notes/circuit/value/value_note.test.cpp @@ -14,7 +14,7 @@ using namespace bb::join_split_example::proofs::notes::circuit::value; class ValueNote : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(ValueNote, Commits) diff --git a/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp b/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp index 17689497a75..3daaee9f6e8 100644 --- a/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp +++ b/barretenberg/cpp/src/barretenberg/examples/simple/simple.test.cpp @@ -7,7 +7,7 @@ namespace examples::simple { TEST(examples_simple, create_proof) { - auto srs_path = std::filesystem::absolute("../srs_db/ignition"); + auto srs_path = std::filesystem::absolute(bb::srs::get_ignition_crs_path()); srs::init_crs_factory(srs_path); auto ptrs = create_builder_and_composer(); auto proof = create_proof(ptrs); diff --git a/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp b/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp index e5ee7c6259c..7e850cb2f6f 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp +++ b/barretenberg/cpp/src/barretenberg/flavor/flavor.test.cpp @@ -7,7 +7,7 @@ using namespace bb; TEST(Flavor, Getters) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); using Flavor = UltraFlavor; using FF = Flavor::FF; using ProvingKey = typename Flavor::ProvingKey; diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp index 237e51a46d7..9a23c848af5 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits.hpp @@ -150,7 +150,7 @@ class GoblinMockCircuits { op_queue->set_size_data(); // Manually compute the op queue transcript commitments (which would normally be done by the merge prover) - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto bn254_commitment_key = commitment_key ? commitment_key : std::make_shared(op_queue->get_current_size()); std::array op_queue_commitments; diff --git a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp index 4ea86024cfe..193535fee32 100644 --- a/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp +++ b/barretenberg/cpp/src/barretenberg/goblin/mock_circuits_pinning.test.cpp @@ -14,7 +14,7 @@ using namespace bb; class MegaMockCircuitsPinning : public ::testing::Test { protected: using DeciderProvingKey = DeciderProvingKey_; - static void SetUpTestSuite() { srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(MegaMockCircuitsPinning, FunctionSizes) diff --git a/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp index bfc8c9cff84..4f958be8cb3 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/composer/standard_composer.test.cpp @@ -15,7 +15,7 @@ auto& engine = numeric::get_debug_randomness(); class StandardPlonkComposer : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; TEST_F(StandardPlonkComposer, BaseCase) @@ -45,7 +45,7 @@ TEST_F(StandardPlonkComposer, ComposerFromSerializedKeys) auto pk_data = from_buffer(pk_buf); auto vk_data = from_buffer(vk_buf); - auto crs = std::make_unique>("../srs_db/ignition"); + auto crs = std::make_unique>(bb::srs::get_ignition_crs_path()); auto proving_key = std::make_shared(std::move(pk_data), crs->get_prover_crs(pk_data.circuit_size + 1)); auto verification_key = std::make_shared(std::move(vk_data), crs->get_verifier_crs()); diff --git a/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp index bf20e3800ca..cd25f6a86af 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/composer/ultra_composer.test.cpp @@ -31,7 +31,7 @@ std::vector add_variables(UltraCircuitBuilder& builder, std::vector class ultra_plonk_composer : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } void prove_and_verify(UltraCircuitBuilder& builder, bool expected_result) { @@ -770,7 +770,7 @@ TYPED_TEST(ultra_plonk_composer, range_checks_on_duplicates) // before range constraints are applied to it. TEST(ultra_plonk_composer, range_constraint_small_variable) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = UltraCircuitBuilder(); uint16_t mask = (1 << 8) - 1; diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp index bcc58f7abe8..5c00d808c57 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/commitment_scheme/commitment_scheme.test.cpp @@ -36,8 +36,9 @@ TEST(commitment_scheme, kate_open) plonk::KateCommitmentScheme newKate; // std::shared_ptr> crs_factory = (new - // FileReferenceStringFactory("../srs_db/ignition")); - auto file_crs = std::make_shared>("../srs_db/ignition"); + // FileReferenceStringFactory(bb::srs::get_ignition_crs_path())); + auto file_crs = + std::make_shared>(bb::srs::get_ignition_crs_path()); auto crs = file_crs->get_prover_crs(n); auto circuit_proving_key = std::make_shared(n, 0, crs, CircuitType::STANDARD); work_queue queue(circuit_proving_key.get(), &inp_tx); @@ -94,7 +95,8 @@ TEST(commitment_scheme, kate_batch_open) transcript::StandardTranscript inp_tx = transcript::StandardTranscript(transcript::Manifest()); plonk::KateCommitmentScheme newKate; - auto file_crs = std::make_shared>("../srs_db/ignition"); + auto file_crs = + std::make_shared>(bb::srs::get_ignition_crs_path()); auto crs = file_crs->get_prover_crs(n); auto circuit_proving_key = std::make_shared(n, 0, crs, CircuitType::STANDARD); work_queue queue(circuit_proving_key.get(), &inp_tx); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp index 0e9dbb679ce..164cd306b9a 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/prover/prover.test.cpp @@ -113,7 +113,8 @@ plonk::Prover generate_test_data(const size_t n) // even indices = mul gates, odd incides = add gates - auto reference_string = std::make_shared>(n + 1, "../srs_db/ignition"); + auto reference_string = + std::make_shared>(n + 1, bb::srs::get_ignition_crs_path()); std::shared_ptr key = std::make_shared(n, 0, reference_string, CircuitType::STANDARD); polynomial w_l(n); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp index 63de18110b3..2f858f6d98f 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/proving_key/proving_key.test.cpp @@ -17,7 +17,7 @@ using namespace bb::plonk; // Test proving key serialization/deserialization to/from buffer TEST(proving_key, proving_key_from_serialized_key) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = StandardCircuitBuilder(); auto composer = StandardComposer(); fr a = fr::one(); @@ -55,7 +55,7 @@ TEST(proving_key, proving_key_from_serialized_key) // Test proving key serialization/deserialization to/from buffer using UltraPlonkComposer TEST(proving_key, proving_key_from_serialized_key_ultra) { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); auto builder = UltraCircuitBuilder(); auto composer = UltraComposer(); fr a = fr::one(); diff --git a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp index 8008d2de53b..58275ee9b97 100644 --- a/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk/proof_system/verifier/verifier.test.cpp @@ -39,7 +39,7 @@ plonk::Verifier generate_verifier(std::shared_ptr circuit_proving_k state)); } - auto crs = std::make_shared>("../srs_db/ignition"); + auto crs = std::make_shared>(bb::srs::get_ignition_crs_path()); std::shared_ptr circuit_verification_key = std::make_shared(circuit_proving_key->circuit_size, circuit_proving_key->num_public_inputs, @@ -75,7 +75,8 @@ plonk::Prover generate_test_data(const size_t n) // even indices = mul gates, odd incides = add gates - auto crs = std::make_shared>(n + 1, "../srs_db/ignition"); + auto crs = + std::make_shared>(n + 1, bb::srs::get_ignition_crs_path()); std::shared_ptr key = std::make_shared(n, 0, crs, CircuitType::STANDARD); polynomial w_l(n); diff --git a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp index ccdc191c62a..1d2729bc725 100644 --- a/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp +++ b/barretenberg/cpp/src/barretenberg/plonk_honk_shared/composer/composer_lib.test.cpp @@ -14,7 +14,7 @@ class ComposerLibTests : public ::testing::Test { using FF = typename Flavor::FF; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp b/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp index 0c07b1725ec..8fb6baf47f7 100644 --- a/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp +++ b/barretenberg/cpp/src/barretenberg/polynomials/legacy_polynomials.bench.cpp @@ -8,6 +8,7 @@ #include "barretenberg/ecc/scalar_multiplication/scalar_multiplication.hpp" #include "barretenberg/numeric/bitop/get_msb.hpp" #include "barretenberg/polynomials/polynomial_arithmetic.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "barretenberg/srs/io.hpp" #include @@ -63,7 +64,7 @@ const auto init = []() { printf("generating test data\n"); g2::affine_element g2_x; globals.monomials = (g1::affine_element*)(aligned_alloc(64, sizeof(g1::affine_element) * MAX_GATES * 2)); - srs::IO::read_transcript(&globals.monomials[0], g2_x, MAX_GATES, "../srs_db/ignition"); + srs::IO::read_transcript(&globals.monomials[0], g2_x, MAX_GATES, bb::srs::get_ignition_crs_path()); globals.scalars = (fr*)(aligned_alloc(32, sizeof(fr) * MAX_GATES * MAX_ROUNDS)); globals.data = (fr*)(aligned_alloc(32, sizeof(fr) * (8 * 17 * MAX_GATES))); memset((void*)globals.monomials, 0x00, MAX_GATES * 2 * sizeof(globals.monomials)); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp index bcbd70090d6..d7d3e0418fa 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy.test.cpp @@ -44,7 +44,7 @@ template class ProtogalaxyTests : public testing::Test { using TupleOfKeys = std::tuple>, std::vector>>; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void construct_circuit(Builder& builder) { diff --git a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp index a0ab01417b0..8689f027d1d 100644 --- a/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/factories/mem_crs_factory.test.cpp @@ -3,6 +3,7 @@ #include "barretenberg/ecc/curves/bn254/pairing.hpp" #include "barretenberg/srs/factories/mem_bn254_crs_factory.hpp" #include "barretenberg/srs/factories/mem_grumpkin_crs_factory.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "file_crs_factory.hpp" #include #include @@ -14,14 +15,14 @@ using namespace bb::curve; TEST(reference_string, mem_bn254_file_consistency) { // Load 1024 from file. - auto file_crs = FileCrsFactory("../srs_db/ignition", 1024); + auto file_crs = FileCrsFactory(bb::srs::get_ignition_crs_path(), 1024); // Use low level io lib to read 1024 from file. std::vector points(1024); - ::srs::IO::read_transcript_g1(points.data(), 1024, "../srs_db/ignition"); + ::srs::IO::read_transcript_g1(points.data(), 1024, bb::srs::get_ignition_crs_path()); g2::affine_element g2_point; - ::srs::IO::read_transcript_g2(g2_point, "../srs_db/ignition"); + ::srs::IO::read_transcript_g2(g2_point, bb::srs::get_ignition_crs_path()); MemBn254CrsFactory mem_crs(points, g2_point); auto file_prover_crs = file_crs.get_prover_crs(1024); @@ -48,11 +49,11 @@ TEST(reference_string, mem_bn254_file_consistency) TEST(reference_string, mem_grumpkin_file_consistency) { // Load 1024 from file. - auto file_crs = FileCrsFactory("../srs_db/grumpkin", 1024); + auto file_crs = FileCrsFactory(bb::srs::get_grumpkin_crs_path(), 1024); // Use low level io lib to read 1024 from file. std::vector points(1024); - ::srs::IO::read_transcript_g1(points.data(), 1024, "../srs_db/grumpkin"); + ::srs::IO::read_transcript_g1(points.data(), 1024, bb::srs::get_grumpkin_crs_path()); MemGrumpkinCrsFactory mem_crs(points); auto file_prover_crs = file_crs.get_prover_crs(1024); diff --git a/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp b/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp index d1bf55bee1b..48f35fce448 100644 --- a/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp +++ b/barretenberg/cpp/src/barretenberg/srs/global_crs.hpp @@ -1,9 +1,40 @@ +#pragma once #include "./factories/crs_factory.hpp" #include "barretenberg/ecc/curves/bn254/bn254.hpp" #include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp" namespace bb::srs { +// TODO(cody): Not sure why these functions are even being called from wasm context. +// We end up aborting due to the wasi call to resolve the environment variables. +// Nor do I understand how this "fix" is not failing as most wasi api functions (e.g. open file) should abort. +// The call comes from GoblinProver ctor and call to perform_op_queue_interactions_for_mock_first_circuit. +// Delete this ifdef block once resolved. +#ifdef __wasm__ +inline std::string get_ignition_crs_path() +{ + return "../srs_db/ignition"; +} + +inline std::string get_grumpkin_crs_path() +{ + return "../srs_db/grumpkin"; +} +#else + +inline std::string get_ignition_crs_path() +{ + const char* env_var = std::getenv("IGNITION_CRS_PATH"); + return env_var != nullptr ? std::string(env_var) : "../srs_db/ignition"; +} + +inline std::string get_grumpkin_crs_path() +{ + const char* env_var = std::getenv("GRUMPKIN_CRS_PATH"); + return env_var != nullptr ? std::string(env_var) : "../srs_db/grumpkin"; +} +#endif + // Initializes the crs using files void init_crs_factory(std::string crs_path); void init_grumpkin_crs_factory(std::string crs_path); diff --git a/barretenberg/cpp/src/barretenberg/srs/io.test.cpp b/barretenberg/cpp/src/barretenberg/srs/io.test.cpp index f9d2db9e30f..d24aa44b154 100644 --- a/barretenberg/cpp/src/barretenberg/srs/io.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/io.test.cpp @@ -2,6 +2,7 @@ #include "barretenberg/common/mem.hpp" #include "barretenberg/ecc/curves/bn254/fq12.hpp" #include "barretenberg/ecc/curves/bn254/pairing.hpp" +#include "barretenberg/srs/global_crs.hpp" #include using namespace bb; @@ -11,7 +12,7 @@ TEST(io, read_transcript_loads_well_formed_srs) size_t degree = 100000; g1::affine_element* monomials = (g1::affine_element*)(aligned_alloc(32, sizeof(g1::affine_element) * (degree + 2))); g2::affine_element g2_x; - srs::IO::read_transcript(monomials, g2_x, degree, "../srs_db/ignition"); + srs::IO::read_transcript(monomials, g2_x, degree, bb::srs::get_ignition_crs_path()); EXPECT_EQ(g1::affine_one, monomials[0]); diff --git a/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp b/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp index 5c6b6b996ee..3af3068bf9b 100644 --- a/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp +++ b/barretenberg/cpp/src/barretenberg/srs/scalar_multiplication.test.cpp @@ -15,6 +15,7 @@ #include "barretenberg/ecc/scalar_multiplication/point_table.hpp" #include "barretenberg/numeric/random/engine.hpp" #include "barretenberg/srs/factories/file_crs_factory.hpp" +#include "barretenberg/srs/global_crs.hpp" #include "barretenberg/srs/io.hpp" #include @@ -30,9 +31,9 @@ template class ScalarMultiplicationTests : public ::testing::Te public: const std::string SRS_PATH = []() { if constexpr (std::same_as) { - return "../srs_db/ignition"; + return bb::srs::get_ignition_crs_path(); } else if constexpr (std::same_as) { - return "../srs_db/grumpkin"; + return bb::srs::get_grumpkin_crs_path(); } }(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp index dcee5a4eb73..1e436faba75 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/client_ivc_verifier/client_ivc_recursive_verifier.test.cpp @@ -21,8 +21,8 @@ class ClientIVCRecursionTests : public testing::Test { static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } struct ClientIVCProverOutput { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp index 8c5581e22b6..d180fe037fa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/eccvm_recursive_verifier.test.cpp @@ -32,8 +32,8 @@ template class ECCVMRecursiveTests : public ::testing using OuterDeciderProvingKey = DeciderProvingKey_; static void SetUpTestSuite() { - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); - bb::srs::init_crs_factory("../srs_db/ignition"); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp index 86523f98b2a..fa8b4c676d9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/eccvm_verifier/verifier_commitment_key.test.cpp @@ -11,8 +11,8 @@ template class RecursiveVeriferCommitmentKeyTest : public testi using VK = VerifierCommitmentKey; static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp index fa5b91590c4..14d4ffbad4a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin.test.cpp @@ -11,8 +11,8 @@ class GoblinTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Builder = MegaCircuitBuilder; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp index 75428a74229..18ca69a5d78 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursion.test.cpp @@ -11,8 +11,8 @@ class GoblinRecursionTests : public ::testing::Test { protected: static void SetUpTestSuite() { - srs::init_crs_factory("../srs_db/ignition"); - srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } using Curve = curve::BN254; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp index a7f9512ec9b..bc3a1574ea6 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/goblin_recursive_verifier.test.cpp @@ -19,8 +19,8 @@ class GoblinRecursiveVerifierTests : public testing::Test { static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); - bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); + bb::srs::init_grumpkin_crs_factory(bb::srs::get_grumpkin_crs_path()); } static MegaCircuitBuilder construct_mock_circuit(std::shared_ptr op_queue) @@ -125,8 +125,8 @@ TEST_F(GoblinRecursiveVerifierTests, ECCVMFailure) GoblinRecursiveVerifier verifier{ &builder, verifier_input }; GoblinRecursiveVerifierOutput goblin_rec_verifier_output = verifier.verify(proof); - auto crs_factory = - std::make_shared>("../srs_db/grumpkin", 1 << CONST_ECCVM_LOG_N); + auto crs_factory = std::make_shared>( + bb::srs::get_grumpkin_crs_path(), 1 << CONST_ECCVM_LOG_N); auto grumpkin_verifier_commitment_key = std::make_shared>(1 << CONST_ECCVM_LOG_N, crs_factory); OpeningClaim native_claim = goblin_rec_verifier_output.opening_claim.get_native_opening_claim(); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp index 1dc9e686b80..a7887a9c96e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/goblin_verifier/merge_verifier.test.cpp @@ -35,7 +35,7 @@ template class RecursiveMergeVerifierTest : public test using MergeVerifier = MergeVerifier_; public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief Test recursive merge verification for the ops generated by a sample circuit diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp index 2280ddbac5f..284c500ebef 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_verifier/ultra_recursive_verifier.test.cpp @@ -105,7 +105,7 @@ template class RecursiveVerifierTest : public testing public: static void SetUpTestSuite() { - bb::srs::init_crs_factory("../srs_db/ignition"); + bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); if constexpr (HasIPAAccumulator) { bb::srs::init_grumpkin_crs_factory("../srs_db/grumpkin"); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp index 0abc008cb2f..ae62954416f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verification_key/verification_key.test.cpp @@ -24,7 +24,7 @@ template class VerificationKeyFixture : public testing::Test using Curve = stdlib::bn254; using RecursVk = stdlib::recursion::verification_key; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief generate a random vk data for use in tests @@ -56,7 +56,8 @@ TYPED_TEST(VerificationKeyFixture, VkDataVsRecursionHashNative) verification_key_data vk_data = TestFixture::rand_vk_data(); verification_key_data vk_data_copy = vk_data; - auto file_crs = std::make_unique>("../srs_db/ignition"); + auto file_crs = + std::make_unique>(bb::srs::get_ignition_crs_path()); auto file_verifier = file_crs->get_verifier_crs(); auto native_vk = std::make_shared(std::move(vk_data_copy), file_verifier); @@ -76,7 +77,8 @@ TYPED_TEST(VerificationKeyFixture, HashVsHashNative) verification_key_data vk_data = TestFixture::rand_vk_data(); - auto file_crs = std::make_unique>("../srs_db/ignition"); + auto file_crs = + std::make_unique>(bb::srs::get_ignition_crs_path()); auto file_verifier = file_crs->get_verifier_crs(); auto native_vk = std::make_shared(std::move(vk_data), file_verifier); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp index c1772d50f7c..c6058681fd5 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/plonk_recursion/verifier/verifier.test.cpp @@ -352,7 +352,7 @@ template class stdlib_verifier : public testing::Test { } public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void test_inner_circuit() { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp index 81586173b6c..fcd1a878f25 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/protogalaxy_verifier/protogalaxy_recursive_verifier.test.cpp @@ -52,7 +52,7 @@ template class ProtogalaxyRecursiveTests : public tes using InnerFoldingVerifier = ProtogalaxyVerifier_; using InnerFoldingProver = ProtogalaxyProver_; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief Create a non-trivial arbitrary inner circuit, the proof of which will be recursively verified * diff --git a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp index 05bd7342ce0..9e7c0d5745d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/translator_vm_verifier/translator_recursive_verifier.test.cpp @@ -42,7 +42,7 @@ template class TranslatorRecursiveTests : public ::te using Transcript = InnerFlavor::Transcript; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void test_recursive_verification() { diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp index 162385bdcba..6214b125743 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/flavor_serialization.test.cpp @@ -23,7 +23,7 @@ template class FlavorSerializationTests : public ::testing::Te using VerificationKey = typename Flavor::VerificationKey; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using FlavorTypes = testing::Types; diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp index f03d59be664..526d0ec164d 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/grand_product_library.test.cpp @@ -12,7 +12,7 @@ template class GrandProductTests : public testing::Test { using Polynomial = bb::Polynomial; public: - void SetUp() { srs::init_crs_factory("../srs_db/ignition"); } + void SetUp() { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } static void populate_span(auto& polynomial_view, const auto& polynomial) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp index 0999c063ca4..54579846efa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/permutation_lib.test.cpp @@ -18,7 +18,7 @@ class PermutationHelperTests : public ::testing::Test { virtual void SetUp() { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); circuit_constructor.add_public_variable(1024); circuit_constructor.add_public_variable(1025); diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp index ffbc979548e..2ceab9efb91 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/sumcheck.test.cpp @@ -22,7 +22,7 @@ template class SumcheckTests : public ::testing::Test { using ProverPolynomials = typename Flavor::ProverPolynomials; using RelationSeparator = Flavor::RelationSeparator; const size_t NUM_POLYNOMIALS = Flavor::NUM_ALL_ENTITIES; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } Polynomial random_poly(size_t size) { diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp index 292c868f2c0..ad10259ad9c 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/relation_correctness.test.cpp @@ -33,7 +33,7 @@ template void check_relation(auto circuit_s class TranslatorRelationCorrectnessTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp index b9f2327b747..ef4c99e7d6b 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator.test.cpp @@ -35,7 +35,7 @@ void ensure_non_zero(auto& polynomial) class TranslatorTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; } // namespace diff --git a/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp b/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp index 33636a911dc..f9532294048 100644 --- a/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp +++ b/barretenberg/cpp/src/barretenberg/translator_vm/translator_composer.fuzzer.cpp @@ -3,7 +3,7 @@ #include "barretenberg/translator_vm/translator_verifier.hpp" extern "C" void LLVMFuzzerInitialize(int*, char***) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } /** * @brief A very primitive fuzzer for the composer diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp index f1efed42252..a891f5a11db 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/databus.test.cpp @@ -19,7 +19,7 @@ using FlavorTypes = ::testing::Types; template class DataBusTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Curve = curve::BN254; using FF = Curve::ScalarField; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp index 0804bb3c97b..b4a502c6747 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_honk.test.cpp @@ -21,7 +21,7 @@ using FlavorTypes = ::testing::Types; template class MegaHonkTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Curve = curve::BN254; using FF = Curve::ScalarField; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp index 31f345c83d1..4808bb2c2a8 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/mega_transcript.test.cpp @@ -15,7 +15,7 @@ using FlavorTypes = ::testing::Types; template class MegaTranscriptTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using DeciderProvingKey = DeciderProvingKey_; using FF = Flavor::FF; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp index 9169f22a183..23c90a2bea8 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/relation_correctness.test.cpp @@ -229,7 +229,7 @@ template void create_some_ecc_op_queue_gates(auto& circuit_bui class UltraRelationCorrectnessTests : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp index 2a7c3d5646b..8595d8f17ae 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/sumcheck.test.cpp @@ -19,7 +19,7 @@ using FF = typename Flavor::FF; class SumcheckTestsRealCircuit : public ::testing::Test { protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; /** diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp index b671c9fbb3a..3f7ffe9defe 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_honk.test.cpp @@ -44,7 +44,7 @@ template class UltraHonkTests : public ::testing::Test { }; protected: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } }; using FlavorTypes = testing::Types; diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp index 147db031ead..43a8e0cbb41 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/ultra_transcript.test.cpp @@ -14,7 +14,7 @@ using namespace bb; class UltraTranscriptTests : public ::testing::Test { public: - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } using Flavor = UltraFlavor; using VerificationKey = Flavor::VerificationKey; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp index 3d2ddb3ccdd..e839674ca35 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/arithmetic.test.cpp @@ -209,7 +209,7 @@ class AvmArithmeticTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp index 49c58bbee57..deb1c3e808a 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/bitwise.test.cpp @@ -352,7 +352,7 @@ class AvmBitwiseTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp index 51364e48153..36021469d7e 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/cast.test.cpp @@ -21,7 +21,7 @@ class AvmCastTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp index 955b09be126..aa0b0d4e291 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/comparison.test.cpp @@ -90,7 +90,7 @@ class AvmCmpTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp index 41686e7bf78..8222b152ff3 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/control_flow.test.cpp @@ -35,7 +35,7 @@ class AvmControlFlowTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp index 5ed0171cd44..acbfdfeca82 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/execution.test.cpp @@ -49,7 +49,7 @@ class AvmExecutionTests : public ::testing::Test { // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. void SetUp() override { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); public_inputs.gas_settings.gas_limits.l2_gas = DEFAULT_INITIAL_L2_GAS; public_inputs.gas_settings.gas_limits.da_gas = DEFAULT_INITIAL_DA_GAS; public_inputs.start_gas_used.l2_gas = 0; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp index d32e11811ff..91b81ec1e58 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/gas.test.cpp @@ -12,7 +12,7 @@ using namespace bb::avm_trace; class AvmGasTests : public ::testing::Test { protected: // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. - void SetUp() override { srs::init_crs_factory("../srs_db/ignition"); }; + void SetUp() override { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); }; }; class AvmGasPositiveTests : public AvmGasTests {}; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp index e01f85cefad..12b748a4b8c 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/indirect_mem.test.cpp @@ -13,7 +13,7 @@ class AvmIndirectMemTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp index 4a3502513a5..1cb98178341 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/inter_table.test.cpp @@ -19,7 +19,7 @@ class AvmInterTableTests : public ::testing::Test { : public_inputs(generate_base_public_inputs()) , trace_builder(AvmTraceBuilder(public_inputs)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp index c2f7fc1f1ef..a8c42306045 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/kernel.test.cpp @@ -18,7 +18,7 @@ // class AvmKernelTests : public ::testing::Test { // protected: // // TODO(640): The Standard Honk on Grumpkin test suite fails unless the SRS is initialised for every test. -// void SetUp() override { srs::init_crs_factory("../srs_db/ignition"); }; +// void SetUp() override { srs::init_crs_factory(bb::srs::get_ignition_crs_path()); }; // }; // // class AvmKernelPositiveTests : public AvmKernelTests {}; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp index 687628f936a..a0b551aba25 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/mem_opcodes.test.cpp @@ -22,7 +22,7 @@ class AvmMemOpcodeTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp index f7cb7656e71..a68aa711af8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/memory.test.cpp @@ -14,7 +14,7 @@ class AvmMemoryTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp index 23b23c20435..a9d0d9231cc 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/recursive_verifier.test.cpp @@ -41,7 +41,7 @@ class AvmRecursiveTests : public ::testing::Test { using OuterVerifier = UltraVerifier; using OuterDeciderProvingKey = DeciderProvingKey_; - static void SetUpTestSuite() { bb::srs::init_crs_factory("../srs_db/ignition"); } + static void SetUpTestSuite() { bb::srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } AvmPublicInputs public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp index dbdd0ae929f..88ad944be4d 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/tests/slice.test.cpp @@ -22,7 +22,7 @@ class AvmSliceTests : public ::testing::Test { , trace_builder( AvmTraceBuilder(public_inputs).set_full_precomputed_tables(false).set_range_check_required(false)) { - srs::init_crs_factory("../srs_db/ignition"); + srs::init_crs_factory(bb::srs::get_ignition_crs_path()); } void gen_trace_builder(std::vector const& calldata) diff --git a/barretenberg/ts/bootstrap.sh b/barretenberg/ts/bootstrap.sh index 20733fb6734..48309f59a81 100755 --- a/barretenberg/ts/bootstrap.sh +++ b/barretenberg/ts/bootstrap.sh @@ -20,12 +20,12 @@ function build { } function test { - if test_should_run bb.js-tests-$hash; then - github_group "bb.js test" - denoise yarn test - cache_upload_flag bb.js-tests-$hash - github_endgroup - fi + test_should_run bb.js-tests-$hash || return 0 + + github_group "bb.js test" + denoise yarn test + cache_upload_flag bb.js-tests-$hash + github_endgroup } case "$cmd" in @@ -38,6 +38,13 @@ case "$cmd" in "test") test ;; + "test-cmds") + wd=$(realpath --relative-to=$root $PWD) + ./node_modules/.bin/jest --listTests --testRegex '\.test\.js$' --rootDir ./dest/node | \ + sed "s|$(pwd)/||" | while read -r test; do + echo "$wd/scripts/run_test.sh $test" + done + ;; "ci") build test diff --git a/barretenberg/ts/package.json b/barretenberg/ts/package.json index 090dc36482c..be4d44b18da 100644 --- a/barretenberg/ts/package.json +++ b/barretenberg/ts/package.json @@ -31,23 +31,34 @@ "formatting": "prettier --check ./src && eslint --max-warnings 0 ./src", "formatting:fix": "prettier -w ./src", "test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests", - "test:debug": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand", - "simple_test": "NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts", + "test:debug": "NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules ./node_modules/.bin/jest --no-cache --passWithNoTests --runInBand", + "simple_test": "NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts", "deploy": "npm publish --access public" }, "jest": { "preset": "ts-jest/presets/default-esm", "transform": { - "./src/.*\\.ts": [ - "ts-jest", + "^.+\\.tsx?$": [ + "@swc/jest", { - "useESM": true + "jsc": { + "parser": { + "syntax": "typescript", + "decorators": true + }, + "transform": { + "decoratorVersion": "2022-03" + } + } } ] }, "moduleNameMapper": { "^(\\.{1,2}/.*)\\.js$": "$1" }, + "extensionsToTreatAsEsm": [ + ".ts" + ], "testRegex": "./src/.*\\.test\\.ts$", "rootDir": "./src" }, @@ -62,6 +73,8 @@ "devDependencies": { "@jest/globals": "^29.4.3", "@msgpack/msgpack": "^3.0.0-beta2", + "@swc/core": "^1.10.1", + "@swc/jest": "^0.2.37", "@types/debug": "^4.1.7", "@types/detect-node": "^2.0.0", "@types/jest": "^29.4.0", diff --git a/barretenberg/ts/scripts/build_wasm.sh b/barretenberg/ts/scripts/build_wasm.sh index 022f6c6d7ee..16d423307d7 100755 --- a/barretenberg/ts/scripts/build_wasm.sh +++ b/barretenberg/ts/scripts/build_wasm.sh @@ -1,4 +1,6 @@ #!/bin/sh +# Builds the wasm and copies it into it's location in dest. +# If you want to build the wasm with debug info for stack traces, use NO_STRIP=1. set -e cd $(dirname $0)/.. @@ -10,7 +12,7 @@ if [ -z "$SKIP_CPP_BUILD" ]; then if [ -z "$SKIP_ST_BUILD" ]; then cmake --preset wasm -DCMAKE_MESSAGE_LOG_LEVEL=Warning && cmake --build --preset wasm fi - ./scripts/strip-wasm.sh + [ -z "$NO_STRIP" ] && ./scripts/strip-wasm.sh ./scripts/gzip-wasm.sh cd ../ts fi diff --git a/barretenberg/ts/scripts/run_test.sh b/barretenberg/ts/scripts/run_test.sh new file mode 100755 index 00000000000..dac17f926b4 --- /dev/null +++ b/barretenberg/ts/scripts/run_test.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# This runs an individual test from the dest folder. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +cd $(dirname $0)/.. + +export NODE_OPTIONS="--no-warnings --experimental-vm-modules" + +./node_modules/.bin/jest --testRegex '\.test\.js$' --rootDir ./dest/node $1 \ No newline at end of file diff --git a/barretenberg/ts/scripts/run_tests b/barretenberg/ts/scripts/run_tests deleted file mode 100755 index 0f0d2895cec..00000000000 --- a/barretenberg/ts/scripts/run_tests +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -set -xe - -$(aws ecr get-login --region us-east-2 --no-include-email) 2> /dev/null - -REPOSITORY=bb.js -IMAGE_URI=$($(git rev-parse --show-toplevel)/build-system/scripts/calculate_image_uri $REPOSITORY) -docker run --rm $IMAGE_URI diff --git a/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts b/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts index 76a5d337353..48e5d187ecb 100644 --- a/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts +++ b/barretenberg/ts/src/barretenberg_wasm/barretenberg_wasm_base/index.ts @@ -1,6 +1,5 @@ import createDebug from 'debug'; import { randomBytes } from '../../random/index.js'; -import { killSelf } from '../helpers/index.js'; const debug = createDebug('bb.js:wasm'); @@ -34,9 +33,8 @@ export class BarretenbergWasmBase { view.setBigUint64(out, ts, true); }, proc_exit: () => { - this.logger('PANIC: proc_exit was called. This is maybe caused by "joining" with unstable wasi pthreads.'); - this.logger(new Error().stack!); - killSelf(); + this.logger('PANIC: proc_exit was called.'); + throw new Error(); }, }, diff --git a/barretenberg/ts/yarn.lock b/barretenberg/ts/yarn.lock index 3a88619a180..1573426e9e8 100644 --- a/barretenberg/ts/yarn.lock +++ b/barretenberg/ts/yarn.lock @@ -28,6 +28,8 @@ __metadata: dependencies: "@jest/globals": "npm:^29.4.3" "@msgpack/msgpack": "npm:^3.0.0-beta2" + "@swc/core": "npm:^1.10.1" + "@swc/jest": "npm:^0.2.37" "@types/debug": "npm:^4.1.7" "@types/detect-node": "npm:^2.0.0" "@types/jest": "npm:^29.4.0" @@ -630,6 +632,15 @@ __metadata: languageName: node linkType: hard +"@jest/create-cache-key-function@npm:^29.7.0": + version: 29.7.0 + resolution: "@jest/create-cache-key-function@npm:29.7.0" + dependencies: + "@jest/types": "npm:^29.6.3" + checksum: 10/061ef63b13ec8c8e5d08e4456f03b5cf8c7f9c1cab4fed8402e1479153cafce6eea80420e308ef62027abb7e29b825fcfa06551856bd021d98e92e381bf91723 + languageName: node + linkType: hard + "@jest/environment@npm:^29.7.0": version: 29.7.0 resolution: "@jest/environment@npm:29.7.0" @@ -962,6 +973,151 @@ __metadata: languageName: node linkType: hard +"@swc/core-darwin-arm64@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-darwin-arm64@npm:1.10.1" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-darwin-x64@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-darwin-x64@npm:1.10.1" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@swc/core-linux-arm-gnueabihf@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.10.1" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@swc/core-linux-arm64-gnu@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm64-gnu@npm:1.10.1" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-arm64-musl@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-arm64-musl@npm:1.10.1" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-linux-x64-gnu@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-x64-gnu@npm:1.10.1" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@swc/core-linux-x64-musl@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-linux-x64-musl@npm:1.10.1" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@swc/core-win32-arm64-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-arm64-msvc@npm:1.10.1" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@swc/core-win32-ia32-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-ia32-msvc@npm:1.10.1" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@swc/core-win32-x64-msvc@npm:1.10.1": + version: 1.10.1 + resolution: "@swc/core-win32-x64-msvc@npm:1.10.1" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@swc/core@npm:^1.10.1": + version: 1.10.1 + resolution: "@swc/core@npm:1.10.1" + dependencies: + "@swc/core-darwin-arm64": "npm:1.10.1" + "@swc/core-darwin-x64": "npm:1.10.1" + "@swc/core-linux-arm-gnueabihf": "npm:1.10.1" + "@swc/core-linux-arm64-gnu": "npm:1.10.1" + "@swc/core-linux-arm64-musl": "npm:1.10.1" + "@swc/core-linux-x64-gnu": "npm:1.10.1" + "@swc/core-linux-x64-musl": "npm:1.10.1" + "@swc/core-win32-arm64-msvc": "npm:1.10.1" + "@swc/core-win32-ia32-msvc": "npm:1.10.1" + "@swc/core-win32-x64-msvc": "npm:1.10.1" + "@swc/counter": "npm:^0.1.3" + "@swc/types": "npm:^0.1.17" + peerDependencies: + "@swc/helpers": "*" + dependenciesMeta: + "@swc/core-darwin-arm64": + optional: true + "@swc/core-darwin-x64": + optional: true + "@swc/core-linux-arm-gnueabihf": + optional: true + "@swc/core-linux-arm64-gnu": + optional: true + "@swc/core-linux-arm64-musl": + optional: true + "@swc/core-linux-x64-gnu": + optional: true + "@swc/core-linux-x64-musl": + optional: true + "@swc/core-win32-arm64-msvc": + optional: true + "@swc/core-win32-ia32-msvc": + optional: true + "@swc/core-win32-x64-msvc": + optional: true + peerDependenciesMeta: + "@swc/helpers": + optional: true + checksum: 10/e9c8a42488db77b3c199d1696d45bb9c7e917267e810c091e5161a7096f3db9c01813ade1e942290285210b4590ec7a00399b2ba3edc4d8cae9b2e824fac7d45 + languageName: node + linkType: hard + +"@swc/counter@npm:^0.1.3": + version: 0.1.3 + resolution: "@swc/counter@npm:0.1.3" + checksum: 10/df8f9cfba9904d3d60f511664c70d23bb323b3a0803ec9890f60133954173047ba9bdeabce28cd70ba89ccd3fd6c71c7b0bd58be85f611e1ffbe5d5c18616598 + languageName: node + linkType: hard + +"@swc/jest@npm:^0.2.37": + version: 0.2.37 + resolution: "@swc/jest@npm:0.2.37" + dependencies: + "@jest/create-cache-key-function": "npm:^29.7.0" + "@swc/counter": "npm:^0.1.3" + jsonc-parser: "npm:^3.2.0" + peerDependencies: + "@swc/core": "*" + checksum: 10/bbec37079b4f5c1ff1c95aeec07d08277c646a0c5e16e057ea3a8fe5c6e2bd59bbfc4312e53ddd05d25fa4de20a03607be274f560f28bb5e229dd08124780e16 + languageName: node + linkType: hard + +"@swc/types@npm:^0.1.17": + version: 0.1.17 + resolution: "@swc/types@npm:0.1.17" + dependencies: + "@swc/counter": "npm:^0.1.3" + checksum: 10/ddef1ad5bfead3acdfc41f14e79ba43a99200eb325afbad5716058dbe36358b0513400e9f22aff32432be84a98ae93df95a20b94192f69b8687144270e4eaa18 + languageName: node + linkType: hard + "@tsconfig/node10@npm:^1.0.7": version: 1.0.9 resolution: "@tsconfig/node10@npm:1.0.9" @@ -4753,6 +4909,13 @@ __metadata: languageName: node linkType: hard +"jsonc-parser@npm:^3.2.0": + version: 3.3.1 + resolution: "jsonc-parser@npm:3.3.1" + checksum: 10/9b0dc391f20b47378f843ef1e877e73ec652a5bdc3c5fa1f36af0f119a55091d147a86c1ee86a232296f55c929bba174538c2bf0312610e0817a22de131cc3f4 + languageName: node + linkType: hard + "keyv@npm:^4.5.3": version: 4.5.4 resolution: "keyv@npm:4.5.4" diff --git a/bootstrap.sh b/bootstrap.sh index 2c1373a75ae..e0e4a070cd2 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -13,6 +13,7 @@ export DENOISE=1 export FORCE_COLOR=true cmd=${1:-} +[ -n "$cmd" ] && shift function encourage_dev_container { echo -e "${bold}${red}ERROR: Toolchain incompatibility. We encourage use of our dev container. See build-images/README.md.${reset}" @@ -108,6 +109,52 @@ function check_toolchains { fi } +function test_all { + # Rust is very annoying. + # You sneeze and everything needs recompiling and you can't avoid recompiling when running tests. + # Ensure tests are up-to-date first so parallel doesn't complain about slow startup. + echo "Building tests..." + ./noir/bootstrap.sh build-tests + + # Starting txe servers with incrementing port numbers. + export NUM_TXES=8 + trap 'kill $(jobs -p)' EXIT + for i in $(seq 0 $((NUM_TXES-1))); do + (cd $root/yarn-project/txe && LOG_LEVEL=silent TXE_PORT=$((45730 + i)) yarn start) & + done + echo "Waiting for TXE's to start..." + for i in $(seq 0 $((NUM_TXES-1))); do + while ! nc -z 127.0.0.1 $((45730 + i)) &>/dev/null; do sleep 1; done + done + + echo "Gathering tests to run..." + { + set -euo pipefail + + if [ "$#" -gt 0 ]; then + for arg in "$@"; do + "$arg/bootstrap.sh" test-cmds + done + else + # Ordered with longest running first, to ensure they get scheduled earliest. + ./yarn-project/bootstrap.sh test-cmds + ./noir-projects/bootstrap.sh test-cmds + ./boxes/bootstrap.sh test-cmds + ./barretenberg/bootstrap.sh test-cmds + ./l1-contracts/bootstrap.sh test-cmds + ./noir/bootstrap.sh test-cmds + fi + } | parallel -j96 --bar --joblog joblog.txt --halt now,fail=1 'dump_fail {} >/dev/null' + + slow_jobs=$(cat joblog.txt | \ + awk 'NR>1 && $4 > 300 {print | "sort -k4,4"}' | \ + awk '{print $4 ": " substr($0, index($0, $9))}' | sed -E "s/^(.*: ).*'([^']+)'.*$/\1\2/") + if [ -n "$slow_jobs" ]; then + echo -e "${yellow}WARNING: The following tests exceed 5 minute runtimes. Break them up.${reset}" + echo "$slow_jobs" + fi +} + case "$cmd" in "clean") echo "WARNING: This will erase *all* untracked files, including hooks and submodules." @@ -215,6 +262,10 @@ case "$cmd" in github_endgroup exit ;; + "test-all") + test_all + exit + ;; ""|"fast"|"full"|"test"|"ci") # Drop through. source_bootstrap on script entry has set flags. ;; diff --git a/bootstrap/Dockerfile.alpine b/bootstrap/Dockerfile.alpine deleted file mode 100644 index 81661fd5a70..00000000000 --- a/bootstrap/Dockerfile.alpine +++ /dev/null @@ -1,25 +0,0 @@ -# At present this doesn't work, as we don't have an alpine wasm toolchain we can use (or it's not directly obvious). -# Keeping this around though, as it would be nice to resolve this in the future. -FROM alpine:latest -RUN apk update && apk add --no-cache \ - build-base \ - curl \ - git \ - cmake \ - lsb-release \ - wget \ - gnupg \ - ninja \ - npm \ - pkgconf \ - openssl-dev \ - jq \ - llvm \ - clang \ - rust \ - cargo \ - bash -RUN npm install -g yarn -WORKDIR /usr/src -COPY . . -RUN ./bootstrap.sh \ No newline at end of file diff --git a/bootstrap/Dockerfile.lunar b/bootstrap/Dockerfile.lunar deleted file mode 100644 index daf60c11b61..00000000000 --- a/bootstrap/Dockerfile.lunar +++ /dev/null @@ -1,23 +0,0 @@ -FROM ubuntu:lunar -ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && apt install -y \ - build-essential \ - curl \ - git \ - cmake \ - lsb-release \ - wget \ - software-properties-common \ - gnupg \ - ninja-build \ - npm \ - pkg-config \ - libssl-dev \ - jq -RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN npm install -g yarn -WORKDIR /usr/src -COPY . . -RUN ./bootstrap.sh \ No newline at end of file diff --git a/bootstrap/bootstrap_test.sh b/bootstrap/bootstrap_test.sh deleted file mode 100755 index 8e05b2650ef..00000000000 --- a/bootstrap/bootstrap_test.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -# This script takes the state of your current repository, and clones it inside of a docker container. -# You likely don't have a fresh clone, and it's paramount that to test bootstrapping, we don't have any -# intermediate build state in the context. -# To achieve this we mount your working directory into the container, and then perform the clone into the container. -# After cloning the repo we build the relevant dockerfile to bootstrap. -# "docker-in-docker" is achieved by mounting the host systems docker socket into the container. - -DOCKERFILE=${1:-Dockerfile.lunar} - -docker build -t bootstrap-build - < /dev/null 2>&1; done - -cd /project -docker build -f bootstrap/$DOCKERFILE . -" \ No newline at end of file diff --git a/boxes/.rebuild_patterns b/boxes/.rebuild_patterns new file mode 100644 index 00000000000..dd81b210e0e --- /dev/null +++ b/boxes/.rebuild_patterns @@ -0,0 +1 @@ +^boxes/ \ No newline at end of file diff --git a/boxes/bootstrap.sh b/boxes/bootstrap.sh index fef3cb83f18..1a684cd6bf8 100755 --- a/boxes/bootstrap.sh +++ b/boxes/bootstrap.sh @@ -9,32 +9,38 @@ export NARGO=$PWD/../noir/noir-repo/target/release/nargo export AZTEC_NARGO=$PWD/../aztec-nargo/compile_then_postprocess.sh export AZTEC_BUILDER=$PWD/../yarn-project/builder/aztec-builder-dest -hash=$(cache_content_hash ../noir/.rebuild_patterns \ +hash=$(cache_content_hash \ + .rebuild_patterns \ + ../noir/.rebuild_patterns \ ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ ../barretenberg/*/.rebuild_patterns) function build { - # Moved to test for now as there was no cache here. - return + if ! cache_download boxes-$hash.tar.gz; then + denoise 'yarn && echo "Building... " && yarn build' + cache_upload boxes-$hash.tar.gz boxes/*/{artifacts,dist} + else + denoise yarn + fi } function test { - function test_box { - set -eu - BOX=$1 BROWSER=$2 denoise docker compose -p $1-$2 up --exit-code-from=boxes --force-recreate - } - export -f test_box + test_should_run "boxes-test-$hash" || return 0 github_group "boxes" - if test_should_run "boxes-test-$hash"; then - # TODO: Move back to build and use cache. - denoise 'yarn && echo "Building... " && yarn build' - parallel --tag --line-buffered --timeout 5m --halt now,fail=1 test_box {1} {2} ::: vanilla react ::: chromium webkit - cache_upload_flag boxes-test-$hash - fi + test_cmds | (cd $root; parallel --tag --line-buffered --timeout 5m --halt now,fail=1) + cache_upload_flag boxes-test-$hash github_endgroup } +function test_cmds { + for browser in chromium webkit; do + for box in vanilla react; do + echo "boxes/scripts/run_test.sh $box $browser" + done + done +} + case "$cmd" in "clean") git clean -fdx @@ -45,6 +51,9 @@ case "$cmd" in "test") test ;; + "test-cmds") + test_cmds + ;; "hash") echo $hash ;; diff --git a/boxes/scripts/run_test.sh b/boxes/scripts/run_test.sh new file mode 100755 index 00000000000..0a81e0c9b67 --- /dev/null +++ b/boxes/scripts/run_test.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -eu + +cd $(dirname $0)/.. + +BOX=$1 BROWSER=$2 denoise docker compose -p $1-$2 up --exit-code-from=boxes --force-recreate \ No newline at end of file diff --git a/build-images/bootstrap.sh b/build-images/bootstrap.sh index 6b5d377ad96..ede7695e055 100755 --- a/build-images/bootstrap.sh +++ b/build-images/bootstrap.sh @@ -7,7 +7,6 @@ hash=$(cache_content_hash "^build-images/Earthfile") function build { github_group "build-images build" - export TEST=1 # for test_should_run if test_should_run build-images-$hash; then args="" if [ "${CI:-0}" = 1 ]; then diff --git a/ci3/bootstrap_local b/ci3/bootstrap_local index 28a141afe13..19af7409234 100755 --- a/ci3/bootstrap_local +++ b/ci3/bootstrap_local @@ -19,7 +19,8 @@ docker run --name aztec_build -ti --rm \ --privileged \ -v bootstrap_ci_local_docker:/var/lib/docker \ -v $root:/aztec-packages-host:ro \ - -v $HOME/.aws:/root/.aws \ + -v $HOME/.aws:/root/.aws:ro \ + -v $HOME/.bb-crs:/root/.bb-crs:ro \ aztecprotocol/ci:2.0 bash -c " set -e /usr/local/share/docker-init.sh &> /dev/null diff --git a/ci3/denoise b/ci3/denoise index 986e60f24e6..daee9d6bc4a 100755 --- a/ci3/denoise +++ b/ci3/denoise @@ -17,6 +17,9 @@ dots_per_line=${LINE_WIDTH:-64} dot_count=0 status=0 +# We don't want to lose color just because we're wrapping. +export FORCE_COLOR=1 + # Create a new file descriptor for capturing output exec 3>&1 diff --git a/ci3/dump_fail b/ci3/dump_fail index 5e933822055..f16788421e3 100755 --- a/ci3/dump_fail +++ b/ci3/dump_fail @@ -28,6 +28,7 @@ if [ "$status" -ne 0 ]; then echo -e "$output" echo -e "${blue}--- stderr ---${reset}" cat "$stderr" + echo -e "${blue}--------------${reset}" } >&2 else echo -n "$output" diff --git a/ci3/source b/ci3/source index 063437456d9..d1415c11562 100644 --- a/ci3/source +++ b/ci3/source @@ -2,12 +2,15 @@ # This is a basis for shell scripts that use the ci3 framework. # Set BASH best practices for early error exit and undefined variables. set -euo pipefail +# Enable extended bash globs. +shopt -s extglob # Enter our script directory, allowing usage of scripts from any directory. [ -z "${NO_CD:-}" ] && cd "$(dirname $0)" -# Add ci3 to path. -export ci3="$(git rev-parse --show-toplevel)/ci3" +# We export so we can use from exported functions. +export root="$(git rev-parse --show-toplevel)" +export ci3="$root/ci3" [[ "$PATH" != *"$ci3:" ]] && export PATH=$ci3:$PATH # Conditionally print all statements ran in CI scripts. diff --git a/ci3/source_bootstrap b/ci3/source_bootstrap index 2a3cc2ba030..bfcc4d9c020 100644 --- a/ci3/source_bootstrap +++ b/ci3/source_bootstrap @@ -6,13 +6,9 @@ case "${1:-}" in "ci") export CI=1 export USE_CACHE=${USE_CACHE:-1} - export TEST=1 export DENOISE=${DENOISE:-1} ;; ""|"fast") export USE_CACHE=${USE_CACHE:-1} ;; - "test") - export TEST=1 - ;; esac \ No newline at end of file diff --git a/ci3/test_should_run b/ci3/test_should_run index 6d909bc1618..0bb8e95f145 100755 --- a/ci3/test_should_run +++ b/ci3/test_should_run @@ -1,22 +1,8 @@ #!/bin/bash +# This is called within test functions to provide an early out for running tests in CI. source $(git rev-parse --show-toplevel)/ci3/source -# Are we able to download from a file with the flag name? -# if TEST=0 is explicit, don't run tests. -if [ "${TEST:-}" = 0 ]; then - echo "Skipping test $1 because TEST=0." +# If we're in CI and the cache flag is present, we skip running tests. +if [ "${CI:-0}" -eq 1 ] && cache_download_flag "$1"; then exit 1 -fi - -if [ "${TEST:-}" != 1 ] && [ "${CI:-}" != 1 ]; then - echo "Skipping test $1 because neither CI or TEST are 1." - exit 1 -fi - -# if we download the test s3 flag, don't run this -if cache_download_flag "$1"; then - exit 1 -fi - -# otherwise CI=1 or TEST=1 and we have not found our flag in S3, run -exit 0 \ No newline at end of file +fi \ No newline at end of file diff --git a/l1-contracts/bootstrap.sh b/l1-contracts/bootstrap.sh index ee2d2c69c84..3f2ee1f6b52 100755 --- a/l1-contracts/bootstrap.sh +++ b/l1-contracts/bootstrap.sh @@ -29,14 +29,14 @@ function build { function test { set -eu local test_flag=l1-contracts-test-$hash - if test_should_run $test_flag; then - github_group "l1-contracts test" - solhint --config ./.solhint.json "src/**/*.sol" - forge fmt --check - forge test --no-match-contract UniswapPortalTest - cache_upload_flag $test_flag - github_endgroup - fi + test_should_run $test_flag || return 0 + + github_group "l1-contracts test" + solhint --config ./.solhint.json "src/**/*.sol" + forge fmt --check + forge test --no-match-contract UniswapPortalTest + cache_upload_flag $test_flag + github_endgroup } export -f test @@ -50,6 +50,9 @@ case "$cmd" in "test") test ;; + "test-cmds") + echo "cd l1-contracts && forge test --no-match-contract UniswapPortalTest" + ;; "ci") build denoise test diff --git a/noir-projects/aztec-nr/bootstrap.sh b/noir-projects/aztec-nr/bootstrap.sh new file mode 100755 index 00000000000..2cd5d723371 --- /dev/null +++ b/noir-projects/aztec-nr/bootstrap.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +source $(git rev-parse --show-toplevel)/ci3/source_bootstrap + +cmd=${1:-} + +export RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-16} +export HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} +export NARGO=${NARGO:-../../noir/noir-repo/target/release/nargo} + +function test_cmds { + i=0 + $NARGO test --list-tests --silence-warnings | while read -r package test; do + # We assume there are 8 txe's running. + port=$((45730 + (i++ % ${NUM_TXES:-1}))) + echo "noir-projects/scripts/run_test.sh aztec-nr $package $test $port" + done +} + +function test { + # Starting txe servers with incrementing port numbers. + trap 'kill $(jobs -p)' EXIT + (cd $root/yarn-project/txe && LOG_LEVEL=error TXE_PORT=45730 yarn start) & + echo "Waiting for TXE to start..." + while ! nc -z 127.0.0.1 45730 &>/dev/null; do sleep 1; done + + test_cmds | (cd $root; NARGO_FOREIGN_CALL_TIMEOUT=300000 parallel --bar --halt now,fail=1 'dump_fail {} >/dev/null') +} + +case "$cmd" in + "test") + test + ;; + "test-cmds") + test_cmds + ;; + *) + echo_stderr "Unknown command: $cmd" + exit 1 +esac \ No newline at end of file diff --git a/noir-projects/bootstrap.sh b/noir-projects/bootstrap.sh index 8eeda14eae4..e70da821e60 100755 --- a/noir-projects/bootstrap.sh +++ b/noir-projects/bootstrap.sh @@ -1,40 +1,55 @@ #!/usr/bin/env bash +# TODO: Testing aztec.nr/contracts requires TXE, so must be pushed to after the final yarn project build. source $(git rev-parse --show-toplevel)/ci3/source_bootstrap cmd=${1:-} -if [ "$cmd" = hash ]; then - cache_content_hash .rebuild_patterns - exit -fi - -github_group "noir-projects build" - -# TODO: Move the build image, or better, just use devcontainer as our build container. -# Or just normalize the protocol circuit keys to be added to the contract artifact, base64 encoded instead of hex. -if ! command -v xxd &> /dev/null; then - denoise "apt update && apt install -y xxd" -fi - -# Use fmt as a trick to download dependencies. -# Otherwise parallel runs of nargo will trip over each other trying to download dependencies. -# Also doubles up as our formatting check. -function prep { - set -eu - (cd noir-protocol-circuits && yarn && node ./scripts/generate_variants.js) - for dir in noir-contracts noir-protocol-circuits mock-protocol-circuits aztec-nr; do - (cd $dir && ../../noir/noir-repo/target/release/nargo fmt --check) - done +function build { + github_group "noir-projects build" + + # TODO: Move the build image, or better, just use devcontainer as our build container. + # Or just normalize the protocol circuit keys to be added to the contract artifact, base64 encoded instead of hex. + if ! command -v xxd &> /dev/null; then + denoise "apt update && apt install -y xxd" + fi + + # Use fmt as a trick to download dependencies. + # Otherwise parallel runs of nargo will trip over each other trying to download dependencies. + # Also doubles up as our formatting check. + function prep { + set -eu + (cd noir-protocol-circuits && yarn && node ./scripts/generate_variants.js) + for dir in noir-contracts noir-protocol-circuits mock-protocol-circuits aztec-nr; do + (cd $dir && ../../noir/noir-repo/target/release/nargo fmt --check) + done + } + export -f prep + + denoise prep + + parallel --tag --line-buffered --joblog joblog.txt --halt now,fail=1 ::: \ + "denoise ./mock-protocol-circuits/bootstrap.sh $cmd" \ + "denoise ./noir-protocol-circuits/bootstrap.sh $cmd" \ + "denoise ./noir-contracts/bootstrap.sh $cmd" + + github_endgroup } -export -f prep -denoise prep - -parallel -v --tag --line-buffered --joblog joblog.txt --halt now,fail=1 ::: \ - "denoise ./mock-protocol-circuits/bootstrap.sh $cmd" \ - "denoise ./noir-protocol-circuits/bootstrap.sh $cmd" \ - "denoise ./noir-contracts/bootstrap.sh $cmd" - -github_endgroup - -# TODO: Testing aztec.nr/contracts requires TXE, so must be pushed to after the final yarn project build. \ No newline at end of file +case "$cmd" in + full|fast|ci|test|"") + build + ;; + "test-cmds") + ./noir-protocol-circuits/bootstrap.sh test-cmds + ./noir-contracts/bootstrap.sh test-cmds + ./aztec-nr/bootstrap.sh test-cmds + exit + ;; + "hash") + cache_content_hash .rebuild_patterns + exit + ;; + *) + echo_stderr "Unknown command: $CMD" + exit 1 +esac diff --git a/noir-projects/noir-contracts/bootstrap.sh b/noir-projects/noir-contracts/bootstrap.sh index f2482f75e96..3d8b2b0f646 100755 --- a/noir-projects/noir-contracts/bootstrap.sh +++ b/noir-projects/noir-contracts/bootstrap.sh @@ -142,6 +142,31 @@ function build { # echo -e "uniswap_contract\ncontract_class_registerer_contract" | parallel --joblog joblog.txt -v --line-buffer --tag --halt now,fail=1 compile {} } +function test_cmds { + i=0 + $NARGO test --list-tests --silence-warnings | while read -r package test; do + # We assume there are 8 txe's running. + port=$((45730 + (i++ % ${NUM_TXES:-1}))) + echo "noir-projects/scripts/run_test.sh noir-contracts $package $test $port" + done +} + +function test { + # Starting txe servers with incrementing port numbers. + NUM_TXES=8 + trap 'kill $(jobs -p)' EXIT + for i in $(seq 0 $((NUM_TXES-1))); do + (cd $root/yarn-project/txe && LOG_LEVEL=silent TXE_PORT=$((45730 + i)) yarn start) & + done + echo "Waiting for TXE's to start..." + for i in $(seq 0 $((NUM_TXES-1))); do + while ! nc -z 127.0.0.1 $((45730 + i)) &>/dev/null; do sleep 1; done + done + + echo "Starting test run..." + test_cmds | (cd $root; NARGO_FOREIGN_CALL_TIMEOUT=300000 parallel --bar --halt now,fail=1 'dump_fail {} >/dev/null') +} + case "$cmd" in "clean") git clean -fdx @@ -153,7 +178,10 @@ case "$cmd" in mv "${artifact}.tmp" "$artifact" done ;; - ""|"fast"|"full"|"ci") + ""|"fast"|"full") + build + ;; + "ci") build ;; "compile") @@ -161,8 +189,10 @@ case "$cmd" in build $1 ;; "test") - # TODO: Needs TXE. Handle after yarn-project. - exit 0 + test + ;; + "test-cmds") + test_cmds ;; *) echo_stderr "Unknown command: $cmd" diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 84f930f4b16..b2ba4044009 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -45,8 +45,6 @@ function on_exit() { } trap on_exit EXIT -[ -f package.json ] && denoise "yarn && node ./scripts/generate_variants.js" - mkdir -p $tmp_dir mkdir -p $key_dir @@ -118,6 +116,9 @@ function compile { function build { set +e set -u + + [ -f "package.json" ] && denoise "yarn && node ./scripts/generate_variants.js" + grep -oP '(?<=crates/)[^"]+' Nargo.toml | \ while read -r dir; do toml_file=./crates/$dir/Nargo.toml @@ -133,16 +134,12 @@ function build { function test { set -eu - # Whether we run the tests or not is coarse grained. name=$(basename "$PWD") CIRCUITS_HASH=$(cache_content_hash ../../noir/.rebuild_patterns "^noir-projects/$name") - if ! test_should_run $name-tests-$CIRCUITS_HASH; then - return - fi - github_group "$name test" - RAYON_NUM_THREADS= $NARGO test --silence-warnings + test_should_run $name-tests-$CIRCUITS_HASH || return 0 + + RAYON_NUM_THREADS= $NARGO test --silence-warnings --skip-brillig-constraints-check cache_upload_flag $name-tests-$CIRCUITS_HASH - github_endgroup } export -f compile test build @@ -164,8 +161,13 @@ case "$CMD" in "test") test ;; + "test-cmds") + $NARGO test --list-tests --silence-warnings | while read -r package test; do + echo "noir-projects/scripts/run_test.sh noir-protocol-circuits $package $test" + done + ;; "ci") - parallel --line-buffered bash -c {} ::: build test + parallel --tag --line-buffered {} ::: build test ;; *) echo_stderr "Unknown command: $CMD" diff --git a/noir-projects/scripts/run_test.sh b/noir-projects/scripts/run_test.sh new file mode 100755 index 00000000000..94da2afdbac --- /dev/null +++ b/noir-projects/scripts/run_test.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -eu + +sub_project=$1 +package=$2 +test=$3 +txe_port=${4:-} + +cd $(dirname $0)/../$sub_project + +export RAYON_NUM_THREADS=1 +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 diff --git a/noir/bootstrap.sh b/noir/bootstrap.sh index 2c26204d309..b8fe93766b2 100755 --- a/noir/bootstrap.sh +++ b/noir/bootstrap.sh @@ -19,17 +19,41 @@ function build { function test_hash() { hash_str $hash-$(cache_content_hash .rebuild_patterns_tests) } + function test { test_flag=noir-test-$(test_hash) - if test_should_run $test_flag; then - github_group "noir test" - export COMMIT_HASH="$(echo "$hash" | sed 's/-.*//g')" - export PATH="$PWD/noir-repo/target/release/:$PATH" - parallel --tag --line-buffered --timeout 5m --halt now,fail=1 \ - denoise ::: ./scripts/test_native.sh ./scripts/test_js_packages.sh - cache_upload_flag $test_flag - github_endgroup - fi + test_should_run $test_flag || return 0 + + github_group "noir test" + export COMMIT_HASH="$(echo "$hash" | sed 's/-.*//g')" + export PATH="$PWD/noir-repo/target/release/:$PATH" + # parallel --tag --line-buffered --timeout 5m --halt now,fail=1 \ + # denoise ::: ./scripts/test_native.sh ./scripts/test_js_packages.sh + denoise ./scripts/test_native.sh + denoise ./scripts/test_js_packages.sh + cache_upload_flag $test_flag + github_endgroup +} + +function build_tests { + cd noir-repo + cargo nextest list --workspace --locked --release &>/dev/null +} + +function test_cmds { + cd noir-repo + cargo nextest list --workspace --locked --release -Tjson-pretty 2>/dev/null | \ + jq -r ' + .["rust-suites"][] | + .testcases as $tests | + .["binary-path"] as $binary | + $tests | + to_entries[] | + select(.value.ignored == false and .value["filter-match"].status == "matches") | + "noir/scripts/run_test.sh \($binary) \(.key)"' | \ + sed "s|$PWD/target/release/deps/||" | \ + # TODO: These fail. Figure out why. + grep -vE "(test_caches_open|requests)" } case "$cmd" in @@ -46,6 +70,12 @@ case "$cmd" in build test ;; + "build-tests") + build_tests + ;; + "test-cmds") + test_cmds + ;; "hash") echo $hash ;; diff --git a/noir/noir-repo/.gitignore b/noir/noir-repo/.gitignore index 9bfb8a89331..49d9e2dbb2f 100644 --- a/noir/noir-repo/.gitignore +++ b/noir/noir-repo/.gitignore @@ -51,3 +51,5 @@ tooling/noir_js/lib # docs autogen build /docs/docs/noir_js/reference/ + +codegen \ No newline at end of file diff --git a/noir/noir-repo/tooling/debugger/build.rs b/noir/noir-repo/tooling/debugger/build.rs index 63924de8336..86b7d5e294c 100644 --- a/noir/noir-repo/tooling/debugger/build.rs +++ b/noir/noir-repo/tooling/debugger/build.rs @@ -28,7 +28,10 @@ fn main() { // Rebuild if the tests have changed println!("cargo:rerun-if-changed=tests"); println!("cargo:rerun-if-changed=ignored-tests.txt"); - println!("cargo:rerun-if-changed={}", test_dir.as_os_str().to_str().unwrap()); + // TODO: Why are we tying our test programs to the binary build? + // This took ages to track down, but running the tests changes the timestamps on test_programs files (also bad), + // and that has the knock-on effect of then needing to rebuild the tests after running the tests. + // println!("cargo:rerun-if-changed={}", test_dir.as_os_str().to_str().unwrap()); generate_debugger_tests(&mut test_file, &test_dir); } diff --git a/noir/noir-repo/tooling/nargo_cli/build.rs b/noir/noir-repo/tooling/nargo_cli/build.rs index 17ce6d4dbfd..50ecba67777 100644 --- a/noir/noir-repo/tooling/nargo_cli/build.rs +++ b/noir/noir-repo/tooling/nargo_cli/build.rs @@ -27,7 +27,10 @@ fn main() { // Rebuild if the tests have changed println!("cargo:rerun-if-changed=tests"); - println!("cargo:rerun-if-changed={}", test_dir.as_os_str().to_str().unwrap()); + // TODO: Why are we tying our test programs to the binary build? + // This took ages to track down, but running the tests changes the timestamps on test_programs files (also bad), + // and that has the knock-on effect of then needing to rebuild the tests after running the tests. + // println!("cargo:rerun-if-changed={}", test_dir.as_os_str().to_str().unwrap()); generate_execution_success_tests(&mut test_file, &test_dir); generate_execution_failure_tests(&mut test_file, &test_dir); diff --git a/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs b/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs index 1fd4ed2d873..f9736d0b79e 100644 --- a/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs +++ b/noir/noir-repo/tooling/nargo_cli/src/cli/test_cmd.rs @@ -42,6 +42,10 @@ pub(crate) struct TestCommand { #[clap(long)] exact: bool, + /// Print all matching test names. + #[clap(long)] + list_tests: bool, + #[clap(flatten)] pub(super) package_options: PackageOptions, @@ -170,6 +174,15 @@ impl<'a> TestRunner<'a> { // First compile all packages and collect their tests let packages_tests = self.collect_packages_tests()?; + if self.args.list_tests { + for (package_name, package_tests) in packages_tests { + for test in package_tests { + println!("{} {}", package_name, test.name); + } + } + return Ok(()); + } + // Now gather all tests and how many are per packages let mut tests = Vec::new(); let mut test_count_per_package = BTreeMap::new(); diff --git a/noir/scripts/run_test.sh b/noir/scripts/run_test.sh new file mode 100755 index 00000000000..3693ea1a53f --- /dev/null +++ b/noir/scripts/run_test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -eu + +cd $(dirname $0)/../noir-repo + +export RAYON_NUM_THREADS=1 + +./target/release/deps/$1 --exact $2 \ No newline at end of file diff --git a/yarn-project/accounts/package.json b/yarn-project/accounts/package.json index 83ff41b5309..1468b59bad1 100644 --- a/yarn-project/accounts/package.json +++ b/yarn-project/accounts/package.json @@ -65,12 +65,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 7e9a218284f..478aedf90a1 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -56,12 +56,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec-faucet/package.json b/yarn-project/aztec-faucet/package.json index b0be9805a99..be649f7b998 100644 --- a/yarn-project/aztec-faucet/package.json +++ b/yarn-project/aztec-faucet/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec-node/package.json b/yarn-project/aztec-node/package.json index 6f7ec39ff16..9edee48067e 100644 --- a/yarn-project/aztec-node/package.json +++ b/yarn-project/aztec-node/package.json @@ -54,12 +54,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec.js/package.json b/yarn-project/aztec.js/package.json index a18a0400266..1c00eadb280 100644 --- a/yarn-project/aztec.js/package.json +++ b/yarn-project/aztec.js/package.json @@ -70,12 +70,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/aztec/package.json b/yarn-project/aztec/package.json index d8fca706ba1..49293727193 100644 --- a/yarn-project/aztec/package.json +++ b/yarn-project/aztec/package.json @@ -104,12 +104,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/bb-prover/package.json b/yarn-project/bb-prover/package.json index d8ead63d687..6606d7e14d4 100644 --- a/yarn-project/bb-prover/package.json +++ b/yarn-project/bb-prover/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/bootstrap.sh b/yarn-project/bootstrap.sh index 3398fadc727..5fa2254cf34 100755 --- a/yarn-project/bootstrap.sh +++ b/yarn-project/bootstrap.sh @@ -4,7 +4,8 @@ source $(git rev-parse --show-toplevel)/ci3/source_bootstrap TEST_FLAKES=${TEST_FLAKES:-0} cmd=${1:-} -hash=$(cache_content_hash ../noir/.rebuild_patterns \ +hash=$(cache_content_hash \ + ../noir/.rebuild_patterns \ ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ ../barretenberg/*/.rebuild_patterns) @@ -56,165 +57,13 @@ function build { } function test { - if test_should_run yarn-project-unit-tests-$hash; then - github_group "yarn-project test" - denoise yarn formatting - denoise yarn test - cache_upload_flag yarn-project-unit-tests-$hash - github_endgroup - fi - - test_e2e -} - -function test_e2e { - test_should_run yarn-project-e2e-tests-$hash || return - - github_group "yarn-project e2e tests" - cd end-to-end - - # This is pre-pulled in our build instance ami, so should be a time noop in CI. - denoise docker pull aztecprotocol/build:2.0 - - # List every test individually. Do not put folders. Ensures fair balancing of load and simplifies resource management. - # All tests are run within a docker container to keep them isolated. - # The first element describes how the test should be run, the second is a path to a unique test file. - # Any further elements are environment variables passed to the launching script. - # "simple" tests are single jest tests launched by ./scripts/test_simple.sh in docker. - # "compose" tests are the same, but are launched via docker compose and ./scripts/docker-compose.yml. - # If a test flakes out, mark it as flake in your PR so it no longer runs, and post a message in slack about it. - # To mark it a flake it becomes e.g. "simple-flake" or "compose-flake". - # If you can, try to find whoever is responsible for the test, and have them acknowledge they'll resolve it later. - # DO NOT just re-run your PR and leave flakey tests running to impact on other engineers. - # If you've been tasked with resolving a flakey test, grind on it using e.g.: - # while ./scripts/test.sh simple e2e_2_pxes; do true; done - TESTS=( - "simple e2e_2_pxes" - "simple e2e_account_contracts" - "simple e2e_authwit" - "simple e2e_avm_simulator" - "simple e2e_blacklist_token_contract/access_control" - "simple e2e_blacklist_token_contract/burn" - "simple e2e_blacklist_token_contract/minting" - "simple e2e_blacklist_token_contract/shielding" - "simple e2e_blacklist_token_contract/transfer_private" - "simple e2e_blacklist_token_contract/transfer_public" - "simple e2e_blacklist_token_contract/unshielding" - "simple-flake e2e_block_building" - "simple e2e_bot" - "simple e2e_card_game" - "simple e2e_cheat_codes" - "simple e2e_cross_chain_messaging/l1_to_l2" - "simple e2e_cross_chain_messaging/l2_to_l1" - "simple e2e_cross_chain_messaging/token_bridge_failure_cases" - "simple e2e_cross_chain_messaging/token_bridge_private" - "simple e2e_cross_chain_messaging/token_bridge_public" - "simple e2e_crowdfunding_and_claim" - "simple e2e_deploy_contract/contract_class_registration" - "simple e2e_deploy_contract/deploy_method" - "simple e2e_deploy_contract/legacy" - "simple e2e_deploy_contract/private_initialization" - "simple e2e_escrow_contract" - "simple e2e_event_logs" - "simple e2e_fees/account_init" - "simple e2e_fees/failures" - "simple e2e_fees/fee_juice_payments" - "simple e2e_fees/gas_estimation" - "simple e2e_fees/private_payments" - "simple e2e_keys" - "simple e2e_l1_with_wall_time" - "simple e2e_lending_contract" - "simple e2e_max_block_number" - "simple e2e_multiple_accounts_1_enc_key" - "simple e2e_nested_contract/importer" - "simple e2e_nested_contract/manual_private_call" - "simple e2e_nested_contract/manual_private_enqueue" - "simple e2e_nested_contract/manual_public" - "simple e2e_nft" - "simple e2e_non_contract_account" - "simple e2e_note_getter" - "simple e2e_ordering" - "simple e2e_outbox" - "simple e2e_p2p/gossip_network" - "simple e2e_p2p/rediscovery" - "simple-flake e2e_p2p/reqresp" - "simple-flake e2e_p2p/upgrade_governance_proposer" - "simple e2e_private_voting_contract" - "simple-flake e2e_prover/full FAKE_PROOFS=1" - "simple e2e_prover_coordination" - "simple e2e_public_testnet_transfer" - "simple e2e_state_vars" - "simple e2e_static_calls" - "simple e2e_synching" - "simple e2e_token_contract/access_control" - "simple e2e_token_contract/burn" - "simple e2e_token_contract/minting" - "simple e2e_token_contract/private_transfer_recursion" - "simple e2e_token_contract/reading_constants" - "simple e2e_token_contract/transfer_in_private" - "simple e2e_token_contract/transfer_in_public" - "simple e2e_token_contract/transfer_to_private" - "simple e2e_token_contract/transfer_to_public" - "simple e2e_token_contract/transfer.test" - "simple-flake flakey_e2e_inclusion_proofs_contract" - - "compose composed/docs_examples" - "compose composed/e2e_aztec_js_browser" - "compose composed/e2e_pxe" - "compose composed/e2e_sandbox_example" - "compose composed/integration_l1_publisher" - "compose sample-dapp/index" - "compose sample-dapp/ci/index" - "compose guides/dapp_testing" - "compose guides/up_quick_start" - "compose guides/writing_an_account_contract" - ) - - commands=() - tests=() - env_vars=() - for entry in "${TESTS[@]}"; do - cmd=$(echo "$entry" | awk '{print $1}') - test=$(echo "$entry" | awk '{print $2}') - env=$(echo "$entry" | cut -d' ' -f3-) - if [[ ("$TEST_FLAKES" -eq 1 && "$cmd" =~ .*"-flake") || - ("$TEST_FLAKES" -eq 0 && ! "$cmd" =~ .*"-flake") ]]; then - commands+=("$cmd") - tests+=("$test") - env_vars+=("$env") - fi - done - - # We will halt immediately on failure, unless testing flakes, in which case let it run to the end. - [ "$TEST_FLAKES" -eq 0 ] && local args="--halt now,fail=1" - - rm -rf results - set +e - parallel --timeout 15m --verbose --joblog joblog.txt --results results/{2}-{#}/ ${args:-} \ - '{3} ./scripts/test.sh {1} {2} 2>&1' ::: ${commands[@]} :::+ ${tests[@]} :::+ "${env_vars[@]}" - code=$? - set -e - - # Note this is highly dependent on the command structure above. - # Skip first line (header). - # 7th field (1-indexed) is exit value. - # (NF-1) is the second to last field, so skips the last field "2>&1" to give the test name. - # We can't index from the front because {3} above is a variable length set of env vars. - # We concat the test name with its job number in $1, to allow running the same test with different env vars. - awk 'NR > 1 && $7 != 0 {print $(NF-1) "-" $1}' joblog.txt | while read -r job; do - stdout_file="results/${job}/stdout" - if [ -f "$stdout_file" ]; then - echo "=== Failed Job Output ===" - cat "$stdout_file" - fi - done - - echo "=== Job Log ===" - cat joblog.txt + test_should_run yarn-project-unit-tests-$hash || return 0 + github_group "yarn-project test" + denoise yarn formatting + denoise yarn test + cache_upload_flag yarn-project-unit-tests-$hash github_endgroup - cache_upload_flag yarn-project-e2e-tests-$hash - return $code } case "$cmd" in @@ -233,11 +82,11 @@ case "$cmd" in "test") test ;; - "test-e2e") - TEST=1 test_e2e - ;; - "test-e2e-flakes") - TEST=1 TEST_FLAKES=1 test_e2e + "test-cmds") + for test in !(end-to-end|kv-store|bb-prover|prover-client)/dest/**/*.test.js; do + echo yarn-project/scripts/run_test.sh $test + done + ./end-to-end/bootstrap.sh test-cmds ;; "ci") build full diff --git a/yarn-project/bot/package.json b/yarn-project/bot/package.json index 2bffdb95764..304bac4be34 100644 --- a/yarn-project/bot/package.json +++ b/yarn-project/bot/package.json @@ -44,12 +44,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/builder/package.json b/yarn-project/builder/package.json index 4d646502b29..2232aa01dac 100644 --- a/yarn-project/builder/package.json +++ b/yarn-project/builder/package.json @@ -59,12 +59,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/circuit-types/package.json b/yarn-project/circuit-types/package.json index 7f6445ad14f..42e5e6a1855 100644 --- a/yarn-project/circuit-types/package.json +++ b/yarn-project/circuit-types/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index 535b9124aaf..b5941142e50 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -94,12 +94,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/cli-wallet/package.json b/yarn-project/cli-wallet/package.json index ce535734133..41cd3291767 100644 --- a/yarn-project/cli-wallet/package.json +++ b/yarn-project/cli-wallet/package.json @@ -57,12 +57,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/cli/package.json b/yarn-project/cli/package.json index cc2407f5ee5..21236b4a1c5 100644 --- a/yarn-project/cli/package.json +++ b/yarn-project/cli/package.json @@ -59,12 +59,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/end-to-end/bootstrap.sh b/yarn-project/end-to-end/bootstrap.sh new file mode 100755 index 00000000000..51b3cd813cf --- /dev/null +++ b/yarn-project/end-to-end/bootstrap.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +source $(git rev-parse --show-toplevel)/ci3/source_bootstrap + +cmd=${1:-} + +# hash=$(cache_content_hash ../noir/.rebuild_patterns \ +# ../{avm-transpiler,noir-projects,l1-contracts,yarn-project}/.rebuild_patterns \ +# ../barretenberg/*/.rebuild_patterns) + +function test_cmds { + local run_test="yarn-project/end-to-end/scripts/test.sh" + echo "$run_test simple e2e_2_pxes" + echo "$run_test simple e2e_account_contracts" + echo "$run_test simple e2e_authwit" + echo "$run_test simple e2e_avm_simulator" + echo "$run_test simple e2e_blacklist_token_contract/access_control" + echo "$run_test simple e2e_blacklist_token_contract/burn" + echo "$run_test simple e2e_blacklist_token_contract/minting" + echo "$run_test simple e2e_blacklist_token_contract/shielding" + echo "$run_test simple e2e_blacklist_token_contract/transfer_private" + echo "$run_test simple e2e_blacklist_token_contract/transfer_public" + echo "$run_test simple e2e_blacklist_token_contract/unshielding" + # echo "$run_test simple-flake e2e_block_building" + echo "$run_test simple e2e_bot" + echo "$run_test simple e2e_card_game" + echo "$run_test simple e2e_cheat_codes" + echo "$run_test simple e2e_cross_chain_messaging/l1_to_l2" + echo "$run_test simple e2e_cross_chain_messaging/l2_to_l1" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_failure_cases" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_private" + echo "$run_test simple e2e_cross_chain_messaging/token_bridge_public" + echo "$run_test simple e2e_crowdfunding_and_claim" + echo "$run_test simple e2e_deploy_contract/contract_class_registration" + echo "$run_test simple e2e_deploy_contract/deploy_method" + echo "$run_test simple e2e_deploy_contract/legacy" + echo "$run_test simple e2e_deploy_contract/private_initialization" + echo "$run_test simple e2e_escrow_contract" + echo "$run_test simple e2e_event_logs" + echo "$run_test simple e2e_fees/account_init" + echo "$run_test simple e2e_fees/failures" + echo "$run_test simple e2e_fees/fee_juice_payments" + echo "$run_test simple e2e_fees/gas_estimation" + # echo "$run_test simple e2e_fees/private_payments" + echo "$run_test simple e2e_keys" + echo "$run_test simple e2e_l1_with_wall_time" + echo "$run_test simple e2e_lending_contract" + echo "$run_test simple e2e_max_block_number" + echo "$run_test simple e2e_multiple_accounts_1_enc_key" + echo "$run_test simple e2e_nested_contract/importer" + echo "$run_test simple e2e_nested_contract/manual_private_call" + echo "$run_test simple e2e_nested_contract/manual_private_enqueue" + echo "$run_test simple e2e_nested_contract/manual_public" + echo "$run_test simple e2e_nft" + echo "$run_test simple e2e_non_contract_account" + echo "$run_test simple e2e_note_getter" + echo "$run_test simple e2e_ordering" + echo "$run_test simple e2e_outbox" + echo "$run_test simple e2e_p2p/gossip_network" + # echo "$run_test simple e2e_p2p/rediscovery" + # echo "$run_test simple-flake e2e_p2p/reqresp" + # echo "$run_test simple-flake e2e_p2p/upgrade_governance_proposer" + echo "$run_test simple e2e_private_voting_contract" + # echo "FAKE_PROOFS=1 $run_test simple-flake e2e_prover/full" + echo "$run_test simple e2e_prover_coordination" + echo "$run_test simple e2e_public_testnet_transfer" + echo "$run_test simple e2e_state_vars" + echo "$run_test simple e2e_static_calls" + echo "$run_test simple e2e_synching" + echo "$run_test simple e2e_token_contract/access_control" + echo "$run_test simple e2e_token_contract/burn" + echo "$run_test simple e2e_token_contract/minting" + echo "$run_test simple e2e_token_contract/private_transfer_recursion" + echo "$run_test simple e2e_token_contract/reading_constants" + echo "$run_test simple e2e_token_contract/transfer_in_private" + echo "$run_test simple e2e_token_contract/transfer_in_public" + echo "$run_test simple e2e_token_contract/transfer_to_private" + echo "$run_test simple e2e_token_contract/transfer_to_public" + echo "$run_test simple e2e_token_contract/transfer.test" + # echo "$run_test simple-flake flakey_e2e_inclusion_proofs_contract" + + echo "$run_test compose composed/docs_examples" + echo "$run_test compose composed/e2e_aztec_js_browser" + echo "$run_test compose composed/e2e_pxe" + echo "$run_test compose composed/e2e_sandbox_example" + echo "$run_test compose composed/integration_l1_publisher" + echo "$run_test compose sample-dapp/index" + echo "$run_test compose sample-dapp/ci/index" + echo "$run_test compose guides/dapp_testing" + echo "$run_test compose guides/up_quick_start" + echo "$run_test compose guides/writing_an_account_contract" +} + +case "$cmd" in + "clean") + git clean -fdx + ;; + "test-cmds") + test_cmds + ;; + *) + echo "Unknown command: $cmd" + exit 1 + ;; +esac diff --git a/yarn-project/end-to-end/scripts/test.sh b/yarn-project/end-to-end/scripts/test.sh index c9f31e52fa9..9b37a74ffde 100755 --- a/yarn-project/end-to-end/scripts/test.sh +++ b/yarn-project/end-to-end/scripts/test.sh @@ -12,13 +12,16 @@ set -eu TYPE=$1 export TEST=$2 +cd $(dirname $0) + case "$TYPE" in "simple"|"simple-flake") - name=${TEST//\//_} + # Strip leading non alpha numerics and replace / with _ for the container name. + name=$(echo "${TEST}" | sed 's/^[^a-zA-Z0-9]*//' | tr '/' '_') trap 'docker kill $name &> /dev/null' SIGINT SIGTERM docker run --rm \ --name $name \ - -v$PWD/../..:/root/aztec-packages \ + -v$(git rev-parse --show-toplevel):/root/aztec-packages \ -v$HOME/.bb-crs:/root/.bb-crs \ --mount type=tmpfs,target=/tmp,tmpfs-size=1g \ --mount type=tmpfs,target=/tmp-jest,tmpfs-size=512m \ @@ -27,7 +30,7 @@ case "$TYPE" in aztecprotocol/build:2.0 ./scripts/test_simple.sh $TEST ;; "compose"|"compose-flake") - docker compose -p "${TEST//[\/\.]/_}" -f ./scripts/docker-compose.yml up --exit-code-from=end-to-end --force-recreate + docker compose -p "${TEST//[\/\.]/_}" up --exit-code-from=end-to-end --force-recreate ;; "skip") echo "Skipping test: $TEST" diff --git a/yarn-project/entrypoints/package.json b/yarn-project/entrypoints/package.json index 0614aa497f9..ed5e880828e 100644 --- a/yarn-project/entrypoints/package.json +++ b/yarn-project/entrypoints/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/epoch-cache/package.json b/yarn-project/epoch-cache/package.json index 346af28de71..b7dbabcba86 100644 --- a/yarn-project/epoch-cache/package.json +++ b/yarn-project/epoch-cache/package.json @@ -80,12 +80,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/ethereum/package.json b/yarn-project/ethereum/package.json index 6a4cc9df32a..87ecc3d321e 100644 --- a/yarn-project/ethereum/package.json +++ b/yarn-project/ethereum/package.json @@ -80,12 +80,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/foundation/package.json b/yarn-project/foundation/package.json index 7376d0c2c5c..3a2d12142e1 100644 --- a/yarn-project/foundation/package.json +++ b/yarn-project/foundation/package.json @@ -91,12 +91,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFilesAfterEnv": [ diff --git a/yarn-project/foundation/src/wasm/wasm_module.test.ts b/yarn-project/foundation/src/wasm/wasm_module.test.ts deleted file mode 100644 index 32e293e1e9b..00000000000 --- a/yarn-project/foundation/src/wasm/wasm_module.test.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { readFile } from 'fs/promises'; -import { dirname } from 'path'; - -import { fileURLToPath } from '../url/index.js'; -import { WasmModule } from './wasm_module.js'; - -/** - * Fetch a simple WASM. - */ -async function fetchCode() { - const __dirname = dirname(fileURLToPath(import.meta.url)); - return await readFile(`${__dirname}/fixtures/gcd.wasm`); -} - -describe('simple wasm', () => { - let wasm!: WasmModule; - - beforeAll(async () => { - wasm = new WasmModule(await fetchCode(), () => ({ - /*no imports*/ - })); - await wasm.init(1, 1, /* No init method */ null); - }); - - it('should call gcd with correct result', () => { - expect(wasm.call('gcd', 12312, 12123)).toBe(27); - }); -}); diff --git a/yarn-project/ivc-integration/package.json b/yarn-project/ivc-integration/package.json index 5bc6f9b9709..ed615b1ac09 100644 --- a/yarn-project/ivc-integration/package.json +++ b/yarn-project/ivc-integration/package.json @@ -52,12 +52,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts b/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts index 7e6956cd10b..f8e9cab226d 100644 --- a/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts +++ b/yarn-project/ivc-integration/src/browser_client_ivc_integration.test.ts @@ -16,7 +16,6 @@ import { /* eslint-disable camelcase */ -createDebug.enable('*'); const logger = createDebug('aztec:browser-ivc-test'); jest.setTimeout(120_000); diff --git a/yarn-project/ivc-integration/src/index.ts b/yarn-project/ivc-integration/src/index.ts index d3fc886bf43..67000066875 100644 --- a/yarn-project/ivc-integration/src/index.ts +++ b/yarn-project/ivc-integration/src/index.ts @@ -49,7 +49,6 @@ export { MockPrivateKernelTailVk, }; -createDebug.enable('*'); const logger = createDebug('aztec:ivc-test'); /* eslint-disable camelcase */ @@ -251,9 +250,11 @@ export async function proveThenVerifyAztecClient( bytecodes.map(base64ToUint8Array).map((arr: Uint8Array) => ungzip(arr)), { threads }, ); - - const [proof, vk] = await backend.prove(witnessStack.map((arr: Uint8Array) => ungzip(arr))); - const verified = await backend.verify(proof, vk); - await backend.destroy(); - return verified; + try { + const [proof, vk] = await backend.prove(witnessStack.map((arr: Uint8Array) => ungzip(arr))); + const verified = await backend.verify(proof, vk); + return verified; + } finally { + await backend.destroy(); + } } diff --git a/yarn-project/ivc-integration/src/serve.ts b/yarn-project/ivc-integration/src/serve.ts index be23f105556..3f12245e171 100644 --- a/yarn-project/ivc-integration/src/serve.ts +++ b/yarn-project/ivc-integration/src/serve.ts @@ -2,7 +2,6 @@ import createDebug from 'debug'; import { generate3FunctionTestingIVCStack, proveThenVerifyAztecClient } from './index.js'; -createDebug.enable('*'); const logger = createDebug('aztec:ivc-test'); /* eslint-disable no-console */ diff --git a/yarn-project/key-store/package.json b/yarn-project/key-store/package.json index faa128e9ae1..53c5d9f3cd6 100644 --- a/yarn-project/key-store/package.json +++ b/yarn-project/key-store/package.json @@ -47,12 +47,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/kv-store/package.json b/yarn-project/kv-store/package.json index 2b238f7885d..6cdf31d3f0a 100644 --- a/yarn-project/kv-store/package.json +++ b/yarn-project/kv-store/package.json @@ -15,7 +15,7 @@ "clean": "rm -rf ./dest .tsbuildinfo", "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", - "test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json", + "test:node": "NODE_NO_WARNINGS=1 mocha --config ./.mocharc.json --reporter dot", "test:browser": "wtr --config ./web-test-runner.config.mjs", "test": "yarn test:node && yarn test:browser" }, @@ -82,12 +82,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/kv-store/web-test-runner.config.mjs b/yarn-project/kv-store/web-test-runner.config.mjs index 0458e1fe9a9..933c2c91a4d 100644 --- a/yarn-project/kv-store/web-test-runner.config.mjs +++ b/yarn-project/kv-store/web-test-runner.config.mjs @@ -1,11 +1,8 @@ import { esbuildPlugin } from '@web/dev-server-esbuild'; -import { defaultReporter } from '@web/test-runner'; -import { summaryReporter } from '@web/test-runner'; +import { dotReporter } from '@web/test-runner'; import { playwrightLauncher } from '@web/test-runner-playwright'; import { fileURLToPath } from 'url'; -const reporter = process.env.CI ? summaryReporter() : defaultReporter(); - export default { browsers: [ playwrightLauncher({ product: 'chromium' }), @@ -20,5 +17,5 @@ export default { files: ['./src/**/indexeddb/*.test.ts'], rootDir: fileURLToPath(new URL('../', import.meta.url)), nodeResolve: true, - reporters: [reporter], + reporters: [dotReporter()], }; diff --git a/yarn-project/merkle-tree/package.json b/yarn-project/merkle-tree/package.json index 042840916c4..0179429df93 100644 --- a/yarn-project/merkle-tree/package.json +++ b/yarn-project/merkle-tree/package.json @@ -48,12 +48,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/noir-contracts.js/package.json b/yarn-project/noir-contracts.js/package.json index f37735e091b..b1cea9b52bf 100644 --- a/yarn-project/noir-contracts.js/package.json +++ b/yarn-project/noir-contracts.js/package.json @@ -47,12 +47,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/noir-protocol-circuits-types/package.json b/yarn-project/noir-protocol-circuits-types/package.json index 46b3671294b..720ff230865 100644 --- a/yarn-project/noir-protocol-circuits-types/package.json +++ b/yarn-project/noir-protocol-circuits-types/package.json @@ -54,12 +54,7 @@ ] }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/p2p-bootstrap/package.json b/yarn-project/p2p-bootstrap/package.json index 51671674183..897dbc4b88f 100644 --- a/yarn-project/p2p-bootstrap/package.json +++ b/yarn-project/p2p-bootstrap/package.json @@ -75,12 +75,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/p2p/package.json b/yarn-project/p2p/package.json index 1034444d6d3..10ad63bc58c 100644 --- a/yarn-project/p2p/package.json +++ b/yarn-project/p2p/package.json @@ -55,12 +55,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/package.common.json b/yarn-project/package.common.json index fec3a9a873c..0d372617e69 100644 --- a/yarn-project/package.common.json +++ b/yarn-project/package.common.json @@ -39,7 +39,7 @@ "moduleNameMapper": { "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, - "reporters": [["jest-silent-reporter", { "useDots": true }]], + "reporters": ["default"], "testTimeout": 30000, "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/package.json b/yarn-project/package.json index d05d9baeb5f..4fae37f35e5 100644 --- a/yarn-project/package.json +++ b/yarn-project/package.json @@ -10,7 +10,7 @@ "formatting:fix": "FORCE_COLOR=true yarn workspaces foreach -A -p -v run formatting:fix", "lint": "yarn eslint --cache --ignore-pattern l1-artifacts .", "format": "yarn prettier --cache -w .", - "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test", + "test": "RAYON_NUM_THREADS=4 FORCE_COLOR=true yarn workspaces foreach -A --exclude @aztec/aztec3-packages --exclude @aztec/bb-prover --exclude @aztec/prover-client -p -v run test --reporters=summary", "build": "FORCE_COLOR=true yarn workspaces foreach -A --parallel --topological-dev --verbose --exclude @aztec/aztec3-packages --exclude @aztec/docs run build", "build:fast": "cd foundation && yarn build && cd ../l1-artifacts && yarn build && cd ../circuits.js && yarn build && cd .. && yarn generate && tsc -b", "build:dev": "./watch.sh", @@ -71,7 +71,6 @@ "eslint": "^8.21.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-import": "^2.27.5", - "jest-silent-reporter": "^0.6.0", "madge": "^6.1.0", "prettier": "^2.8.8", "typedoc": "^0.24.8", diff --git a/yarn-project/proof-verifier/package.json b/yarn-project/proof-verifier/package.json index 97cae4df78d..99ded95a154 100644 --- a/yarn-project/proof-verifier/package.json +++ b/yarn-project/proof-verifier/package.json @@ -67,12 +67,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/protocol-contracts/package.json b/yarn-project/protocol-contracts/package.json index f555a517fa0..7bece1c9c02 100644 --- a/yarn-project/protocol-contracts/package.json +++ b/yarn-project/protocol-contracts/package.json @@ -61,12 +61,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/prover-client/package.json b/yarn-project/prover-client/package.json index 43fcfd10c56..e4363feffd5 100644 --- a/yarn-project/prover-client/package.json +++ b/yarn-project/prover-client/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts index fcd971b41e5..f7e5fb2194f 100644 --- a/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_full_rollup.test.ts @@ -85,6 +85,7 @@ describe('prover/bb_prover/full-rollup', () => { ); } }, + 900000, ); // TODO(@PhilWindle): Remove public functions and re-enable once we can handle empty tx slots diff --git a/yarn-project/prover-node/package.json b/yarn-project/prover-node/package.json index 938fec1bf7b..13a872b8864 100644 --- a/yarn-project/prover-node/package.json +++ b/yarn-project/prover-node/package.json @@ -44,12 +44,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/pxe/package.json b/yarn-project/pxe/package.json index 716483f57e1..59069d0f5dc 100644 --- a/yarn-project/pxe/package.json +++ b/yarn-project/pxe/package.json @@ -58,12 +58,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/scripts/package.json b/yarn-project/scripts/package.json index 3fc80b2aec7..be14fa8b141 100644 --- a/yarn-project/scripts/package.json +++ b/yarn-project/scripts/package.json @@ -77,12 +77,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/scripts/run_test.sh b/yarn-project/scripts/run_test.sh new file mode 100755 index 00000000000..3c7ca41af63 --- /dev/null +++ b/yarn-project/scripts/run_test.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# This runs an individual test from the dest folder. +# It's the script used by ./bootstrap.sh test-cmds. +# It means we can return a concise, easy to read, easy to run command for reproducing a test run. +set -eu + +dir=${1%%/*} +test=${1#*dest/} + +export NODE_OPTIONS="--no-warnings --experimental-vm-modules" + +cd $(dirname $0)/../$dir + +# TODO: --forceExit *should not be needed*. Find out what's not being cleaned up. +node ../node_modules/.bin/jest --forceExit --runInBand --testRegex '\.test\.js$' --rootDir dest $test \ No newline at end of file diff --git a/yarn-project/sequencer-client/package.json b/yarn-project/sequencer-client/package.json index 1ad914e4f81..58a2116a91c 100644 --- a/yarn-project/sequencer-client/package.json +++ b/yarn-project/sequencer-client/package.json @@ -106,12 +106,7 @@ "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/simulator/package.json b/yarn-project/simulator/package.json index 487bd0ff5ff..a0bde2ce857 100644 --- a/yarn-project/simulator/package.json +++ b/yarn-project/simulator/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/telemetry-client/package.json b/yarn-project/telemetry-client/package.json index 6cad929392f..7face42b10c 100644 --- a/yarn-project/telemetry-client/package.json +++ b/yarn-project/telemetry-client/package.json @@ -76,12 +76,7 @@ "^(\\.{1,2}/.*)\\.[cm]?js$": "$1" }, "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testRegex": "./src/.*\\.test\\.(js|mjs|ts)$", "rootDir": "./src", diff --git a/yarn-project/txe/package.json b/yarn-project/txe/package.json index d17b71b0533..d35ab5aceea 100644 --- a/yarn-project/txe/package.json +++ b/yarn-project/txe/package.json @@ -19,7 +19,7 @@ "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", "test": "HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-4} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}", "dev": "LOG_LEVEL=debug node ./dest/bin/index.js", - "start": "node ./dest/bin/index.js" + "start": "node --no-warnings ./dest/bin/index.js" }, "inherits": [ "../package.common.json" @@ -51,12 +51,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/types/package.json b/yarn-project/types/package.json index 3a2206e7957..46de945c274 100644 --- a/yarn-project/types/package.json +++ b/yarn-project/types/package.json @@ -52,12 +52,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/validator-client/package.json b/yarn-project/validator-client/package.json index 8970687e0dc..d0b6efa372c 100644 --- a/yarn-project/validator-client/package.json +++ b/yarn-project/validator-client/package.json @@ -53,12 +53,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/world-state/package.json b/yarn-project/world-state/package.json index b3bdd5346c6..a396423edce 100644 --- a/yarn-project/world-state/package.json +++ b/yarn-project/world-state/package.json @@ -54,12 +54,7 @@ ".ts" ], "reporters": [ - [ - "jest-silent-reporter", - { - "useDots": true - } - ] + "default" ], "testTimeout": 30000, "setupFiles": [ diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 3d2aa27b05c..d638abe84d2 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -225,7 +225,6 @@ __metadata: eslint: "npm:^8.21.0" eslint-import-resolver-typescript: "npm:^3.5.5" eslint-plugin-import: "npm:^2.27.5" - jest-silent-reporter: "npm:^0.6.0" madge: "npm:^6.1.0" prettier: "npm:^2.8.8" typedoc: "npm:^0.24.8" @@ -2837,19 +2836,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^26.6.2": - version: 26.6.2 - resolution: "@jest/types@npm:26.6.2" - dependencies: - "@types/istanbul-lib-coverage": "npm:^2.0.0" - "@types/istanbul-reports": "npm:^3.0.0" - "@types/node": "npm:*" - "@types/yargs": "npm:^15.0.0" - chalk: "npm:^4.0.0" - checksum: 10/02d42749c8c6dc7e3184d0ff0293dd91c97233c2e6dc3708d61ef33d3162d4f07ad38d2d8a39abd94cf2fced69b92a87565c7099137c4529809242ca327254af - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -5776,15 +5762,6 @@ __metadata: languageName: node linkType: hard -"@types/yargs@npm:^15.0.0": - version: 15.0.19 - resolution: "@types/yargs@npm:15.0.19" - dependencies: - "@types/yargs-parser": "npm:*" - checksum: 10/c3abcd3472c32c02702f365dc1702a0728562deb8a8c61f3ce2161958d756cc033f7d78567565b4eba62f5869e9b5eac93d4c1dcb2c97af17aafda8f9f892b4b - languageName: node - linkType: hard - "@types/yargs@npm:^17.0.8": version: 17.0.32 resolution: "@types/yargs@npm:17.0.32" @@ -8074,13 +8051,6 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^2.0.0": - version: 2.0.0 - resolution: "ci-info@npm:2.0.0" - checksum: 10/3b374666a85ea3ca43fa49aa3a048d21c9b475c96eb13c133505d2324e7ae5efd6a454f41efe46a152269e9b6a00c9edbe63ec7fa1921957165aae16625acd67 - languageName: node - linkType: hard - "ci-info@npm:^3.2.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" @@ -12308,17 +12278,6 @@ __metadata: languageName: node linkType: hard -"is-ci@npm:^2.0.0": - version: 2.0.0 - resolution: "is-ci@npm:2.0.0" - dependencies: - ci-info: "npm:^2.0.0" - bin: - is-ci: bin.js - checksum: 10/77b869057510f3efa439bbb36e9be429d53b3f51abd4776eeea79ab3b221337fe1753d1e50058a9e2c650d38246108beffb15ccfd443929d77748d8c0cc90144 - languageName: node - linkType: hard - "is-core-module@npm:^2.1.0, is-core-module@npm:^2.11.0, is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1": version: 2.13.1 resolution: "is-core-module@npm:2.13.1" @@ -13390,16 +13349,6 @@ __metadata: languageName: node linkType: hard -"jest-silent-reporter@npm:^0.6.0": - version: 0.6.0 - resolution: "jest-silent-reporter@npm:0.6.0" - dependencies: - chalk: "npm:^4.0.0" - jest-util: "npm:^26.0.0" - checksum: 10/443e0abaf5a6dc8c17da1e8495b7a55f813224adc39b6d1954bf49ff7fe70533b1020571453180dbb8388ace87f8e1dfc79610a4554bb93334f6c4154231c292 - languageName: node - linkType: hard - "jest-snapshot@npm:^29.7.0": version: 29.7.0 resolution: "jest-snapshot@npm:29.7.0" @@ -13428,20 +13377,6 @@ __metadata: languageName: node linkType: hard -"jest-util@npm:^26.0.0": - version: 26.6.2 - resolution: "jest-util@npm:26.6.2" - dependencies: - "@jest/types": "npm:^26.6.2" - "@types/node": "npm:*" - chalk: "npm:^4.0.0" - graceful-fs: "npm:^4.2.4" - is-ci: "npm:^2.0.0" - micromatch: "npm:^4.0.2" - checksum: 10/4502bc699f147d2fa43274af18174b55fd5b956becd1347665217e35a5354e929206abaef580f967ed239587be926c835eb3ca9b5c361205df1988bc8d58a462 - languageName: node - linkType: hard - "jest-util@npm:^29.0.0, jest-util@npm:^29.7.0": version: 29.7.0 resolution: "jest-util@npm:29.7.0"