diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index 6a43fdff5b5..6030d85a771 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -50,6 +50,7 @@ barretenberg-acir-tests-bb-ultra-plonk: # Run every acir test through native bb build prove_then_verify flow for UltraPlonk. # This ensures we test independent pk construction through real/garbage witness data paths. RUN FLOW=prove_then_verify ./run_acir_tests.sh + RUN FLOW=prove_then_verify RECURSIVE=true ./run_acir_tests.sh assert_statement double_verify_proof barretenberg-acir-tests-bb-ultra-honk: FROM ../build-images/+from-registry @@ -67,6 +68,7 @@ barretenberg-acir-tests-bb-ultra-honk: # Run the acir test through native bb build prove_then_verify_ultra_honk flow # Note that the script will skip the Plonk related tests RUN FLOW=prove_then_verify_ultra_honk HONK=true ./run_acir_tests.sh + RUN FLOW=prove_then_verify_ultra_honk HONK=true RECURSIVE=true ./run_acir_tests.sh assert_statement double_verify_honk_proof # Construct and verify a UltraHonk proof for a single program RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash @@ -173,4 +175,4 @@ barretenberg-acir-tests-bb.js: # Run fold_basic test through bb.js which runs ClientIVC on fold basic RUN BIN=../ts/dest/node/main.js FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic # 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_acir_tests.sh 1_mul + RUN BIN=../ts/dest/node/main.js FLOW=all_cmds ./run_acir_tests.sh 1_mul \ No newline at end of file diff --git a/barretenberg/acir_tests/Dockerfile.bb.sol b/barretenberg/acir_tests/Dockerfile.bb.sol index 2f89581c185..9b09ba86d66 100644 --- a/barretenberg/acir_tests/Dockerfile.bb.sol +++ b/barretenberg/acir_tests/Dockerfile.bb.sol @@ -18,8 +18,7 @@ COPY . . # This includes the basic `assert_statement` test that contains a single public input # and the recursive aggregation circuits which use the Keccak based prover. # -# NOTE: When circuits are marked `recursive` it means the backend will use a prover that -# produces SNARK recursion friendly proofs, while the solidity verifier expects proofs -# whose transcript uses Keccak hashing. +# NOTE: The solidity verifier expects proofs whose transcript uses Keccak hashing, +# for which we have to invoke the backend prover without the `--recursive` flag. RUN (cd sol-test && yarn) RUN PARALLEL=1 FLOW=sol ./run_acir_tests.sh assert_statement double_verify_proof double_verify_nested_proof diff --git a/barretenberg/acir_tests/README.md b/barretenberg/acir_tests/README.md index 4d644c672b7..af6bc622d6b 100644 --- a/barretenberg/acir_tests/README.md +++ b/barretenberg/acir_tests/README.md @@ -49,14 +49,14 @@ $ FLOW=all_cmds ./run_acir_tests.sh 1_mul This means we have to generate the proof specific inputs using our backend and pass it back into `double_verify_proof` to regenerate the accurate witness. The following is a temporary solution to manually regenerate the inputs for `double_verify_proof` on a specific Noir branch. -First find `acir_tests/gen_inner_proof_inputs.sh`. Change the $BRANCH env var to your working branch and $PROOF_NAME to your first input you want to recursively verify. The script is going to generate the proof system specific verification key output and proof for the `assert_statement_recursive` test. +First find `acir_tests/gen_inner_proof_inputs.sh`. Change the $BRANCH env var to your working branch and $PROOF_NAME to your first input you want to recursively verify. The script is going to generate the proof system specific verification key output and proof for the `assert_statement` test. To run: ``` ./gen_inner_proof_inputs.sh ``` -To generate a new input you can run the script again. To generate a new file under `assert_statement_recursive/proofs/` be sure to change the $PROOF_NAME inside of the script. +To generate a new input you can run the script again. To generate a new file under `assert_statement/proofs/` be sure to change the $PROOF_NAME inside of the script. You can then copy these inputs over to your working branch in Noir and regenerate the witness for `double_verify_proof`. You can then change the branch in `run_acir_tests.sh` to this Noir working branch as well and `double_verify_proof` should pass. -The same process should then be repeated, but now `double_verify_proof_recursive` will be the circuit for which we will be generating recursive inputs using `gen_inner_proof_inputs.sh`. The recursive artifacts should then supplied as inputs to `double_verify_nested_proof`. \ No newline at end of file +The same process should then be repeated, but now `double_verify_proof_recursive` will be the circuit for which we will be generating recursive inputs using `gen_inner_proof_inputs.sh`. The recursive artifacts should then supplied as inputs to `double_verify_nested_proof`. \ No newline at end of file diff --git a/barretenberg/acir_tests/flows/prove_and_verify.sh b/barretenberg/acir_tests/flows/prove_and_verify.sh index 4d905538991..49dc9a86001 100755 --- a/barretenberg/acir_tests/flows/prove_and_verify.sh +++ b/barretenberg/acir_tests/flows/prove_and_verify.sh @@ -2,7 +2,11 @@ set -eu VFLAG=${VERBOSE:+-v} +FLAGS="-c $CRS_PATH $VFLAG" +if [ "${RECURSIVE}" = "true" ]; then + FLAGS="$FLAGS --recursive" +fi # This is the fastest flow, because it only generates pk/vk once, gate count once, etc. # It may not catch all class of bugs. -$BIN prove_and_verify $VFLAG -c $CRS_PATH -b ./target/program.json +$BIN prove_and_verify $FLAGS -b ./target/program.json diff --git a/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk.sh b/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk.sh index 16f2fd7f398..be9ad0e1231 100755 --- a/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk.sh +++ b/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk.sh @@ -2,5 +2,9 @@ set -eu VFLAG=${VERBOSE:+-v} +FLAGS="-c $CRS_PATH $VFLAG" +if [ "${RECURSIVE}" = "true" ]; then + FLAGS="$FLAGS --recursive" +fi -$BIN prove_and_verify_ultra_honk $VFLAG -c $CRS_PATH -b ./target/program.json +$BIN prove_and_verify_ultra_honk $FLAGS -b ./target/program.json diff --git a/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk_program.sh b/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk_program.sh index 65a6e400226..350bc5630ba 100755 --- a/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk_program.sh +++ b/barretenberg/acir_tests/flows/prove_and_verify_ultra_honk_program.sh @@ -2,5 +2,9 @@ set -eu VFLAG=${VERBOSE:+-v} +FLAGS="-c $CRS_PATH $VFLAG" +if [ "${RECURSIVE}" = "true" ]; then + FLAGS="$FLAGS --recursive" +fi -$BIN prove_and_verify_ultra_honk_program $VFLAG -c $CRS_PATH -b ./target/program.json +$BIN prove_and_verify_ultra_honk_program $FLAGS -b ./target/program.json diff --git a/barretenberg/acir_tests/flows/prove_then_verify.sh b/barretenberg/acir_tests/flows/prove_then_verify.sh index 08d8ea21057..d12a12de216 100755 --- a/barretenberg/acir_tests/flows/prove_then_verify.sh +++ b/barretenberg/acir_tests/flows/prove_then_verify.sh @@ -4,6 +4,9 @@ set -eu VFLAG=${VERBOSE:+-v} BFLAG="-b ./target/program.json" FLAGS="-c $CRS_PATH $VFLAG" +if [ "${RECURSIVE}" = "true" ]; then + FLAGS="$FLAGS --recursive" +fi # Test we can perform the proof/verify flow. # This ensures we test independent pk construction through real/garbage witness data paths. diff --git a/barretenberg/acir_tests/flows/prove_then_verify_ultra_honk.sh b/barretenberg/acir_tests/flows/prove_then_verify_ultra_honk.sh index ac3bb9bc962..aaec7e54017 100755 --- a/barretenberg/acir_tests/flows/prove_then_verify_ultra_honk.sh +++ b/barretenberg/acir_tests/flows/prove_then_verify_ultra_honk.sh @@ -4,6 +4,9 @@ set -eux VFLAG=${VERBOSE:+-v} BFLAG="-b ./target/program.json" FLAGS="-c $CRS_PATH $VFLAG" +if [ "${RECURSIVE}" = "true" ]; then + FLAGS="$FLAGS --recursive" +fi # Test we can perform the proof/verify flow. # This ensures we test independent pk construction through real/garbage witness data paths. diff --git a/barretenberg/acir_tests/gen_inner_proof_inputs.sh b/barretenberg/acir_tests/gen_inner_proof_inputs.sh index 38392d84d89..9b68f0a1998 100755 --- a/barretenberg/acir_tests/gen_inner_proof_inputs.sh +++ b/barretenberg/acir_tests/gen_inner_proof_inputs.sh @@ -20,7 +20,7 @@ export BRANCH ./clone_test_vectors.sh -cd acir_tests/assert_statement_recursive +cd acir_tests/assert_statement PROOF_DIR=$PWD/proofs PROOF_PATH=$PROOF_DIR/$PROOF_NAME @@ -28,7 +28,7 @@ VFLAG=${VERBOSE:+-v} RFLAG=${RECURSIVE:+-r} echo "Write VK to file for assert_statement..." -$BIN write_vk $VFLAG -c $CRS_PATH -o ./target/vk +$BIN write_vk $VFLAG -c $CRS_PATH -o ./target/vk --recursive echo "Write VK as fields for recursion..." $BIN vk_as_fields $VFLAG -c $CRS_PATH -k ./target/vk -o ./target/vk_fields.json @@ -36,7 +36,7 @@ $BIN vk_as_fields $VFLAG -c $CRS_PATH -k ./target/vk -o ./target/vk_fields.json echo "Generate proof to file..." [ -d "$PROOF_DIR" ] || mkdir $PWD/proofs [ -e "$PROOF_PATH" ] || touch $PROOF_PATH -$BIN prove $VFLAG -c $CRS_PATH -b ./target/program.json -o "./proofs/$PROOF_NAME" +$BIN prove $VFLAG -c $CRS_PATH -b ./target/program.json -o "./proofs/$PROOF_NAME" --recursive echo "Write proof as fields for recursion..." $BIN proof_as_fields $VFLAG -c $CRS_PATH -p "./proofs/$PROOF_NAME" -k ./target/vk -o "./proofs/${PROOF_NAME}_fields.json" diff --git a/barretenberg/acir_tests/regenerate_verify_honk_proof_inputs.sh b/barretenberg/acir_tests/regenerate_verify_honk_proof_inputs.sh index ba811246596..e19abaabed7 100755 --- a/barretenberg/acir_tests/regenerate_verify_honk_proof_inputs.sh +++ b/barretenberg/acir_tests/regenerate_verify_honk_proof_inputs.sh @@ -17,7 +17,7 @@ fi export BRANCH # the program for which a proof will be recursively verified -PROGRAM=assert_statement_recursive +PROGRAM=assert_statement # the program containing the recursive verifier RECURSIVE_PROGRAM=verify_honk_proof diff --git a/barretenberg/acir_tests/run_acir_tests.sh b/barretenberg/acir_tests/run_acir_tests.sh index 1b8d413afe6..b31b8708e89 100755 --- a/barretenberg/acir_tests/run_acir_tests.sh +++ b/barretenberg/acir_tests/run_acir_tests.sh @@ -2,6 +2,7 @@ # Env var overrides: # BIN: to specify a different binary to test with (e.g. bb.js or bb.js-dev). # VERBOSE: to enable logging for each test. +# RECURSIVE: to enable --recursive for each test. set -eu # Catch when running in parallel @@ -19,6 +20,7 @@ VERBOSE=${VERBOSE:-} TEST_NAMES=("$@") # We get little performance benefit over 16 cores (in fact it can be worse). HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} +RECURSIVE=${RECURSIVE:-false} FLOW_SCRIPT=$(realpath ./flows/${FLOW}.sh) @@ -28,7 +30,7 @@ else BIN=$(realpath $(which $BIN)) fi -export BIN CRS_PATH VERBOSE BRANCH +export BIN CRS_PATH VERBOSE BRANCH RECURSIVE # copy the gzipped acir test data from noir/noir-repo/test_programs to barretenberg/acir_tests ./clone_test_vectors.sh @@ -47,12 +49,12 @@ SKIP_ARRAY+=(regression_5045) # if HONK is false, we should skip verify_honk_proof if [ "$HONK" = false ]; then # Don't run programs with Honk recursive verifier - SKIP_ARRAY+=(verify_honk_proof double_verify_honk_proof double_verify_honk_proof_recursive) + SKIP_ARRAY+=(verify_honk_proof double_verify_honk_proof) fi if [ "$HONK" = true ]; then # Don't run programs with Plonk recursive verifier(s) - SKIP_ARRAY+=(single_verify_proof double_verify_proof double_verify_proof_recursive double_verify_nested_proof) + SKIP_ARRAY+=(single_verify_proof double_verify_proof double_verify_nested_proof) fi function test() { diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 052ea3774e6..3cfad6d4e46 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -148,13 +148,13 @@ std::string honk_vk_to_json(std::vector& data) * @return true if the proof is valid * @return false if the proof is invalid */ -bool proveAndVerify(const std::string& bytecodePath, const std::string& witnessPath) +bool proveAndVerify(const std::string& bytecodePath, const bool recursive, const std::string& witnessPath) { auto constraint_system = get_constraint_system(bytecodePath, /*honk_recursion=*/false); auto witness = get_witness(witnessPath); acir_proofs::AcirComposer acir_composer{ 0, verbose_logging }; - acir_composer.create_finalized_circuit(constraint_system, witness); + acir_composer.create_finalized_circuit(constraint_system, recursive, witness); init_bn254_crs(acir_composer.get_finalized_dyadic_circuit_size()); Timer pk_timer; @@ -179,7 +179,9 @@ bool proveAndVerify(const std::string& bytecodePath, const std::string& witnessP } template -bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, acir_format::WitnessVector witness) +bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, + const bool recursive, + acir_format::WitnessVector witness) { using Builder = Flavor::CircuitBuilder; using Prover = UltraProver_; @@ -191,7 +193,7 @@ bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, aci honk_recursion = true; } // Construct a bberg circuit from the acir representation - auto builder = acir_format::create_circuit(constraint_system, 0, witness, honk_recursion); + auto builder = acir_format::create_circuit(constraint_system, recursive, 0, witness, honk_recursion); // Construct Honk proof Prover prover{ builder }; @@ -213,7 +215,8 @@ bool proveAndVerifyHonkAcirFormat(acir_format::AcirFormat constraint_system, aci * @param bytecodePath Path to serialized acir circuit data * @param witnessPath Path to serialized acir witness data */ -template bool proveAndVerifyHonk(const std::string& bytecodePath, const std::string& witnessPath) +template +bool proveAndVerifyHonk(const std::string& bytecodePath, const bool recursive, const std::string& witnessPath) { bool honk_recursion = false; if constexpr (IsAnyOf) { @@ -223,7 +226,7 @@ template bool proveAndVerifyHonk(const std::string& bytec auto constraint_system = get_constraint_system(bytecodePath, honk_recursion); auto witness = get_witness(witnessPath); - return proveAndVerifyHonkAcirFormat(constraint_system, witness); + return proveAndVerifyHonkAcirFormat(constraint_system, recursive, witness); } /** @@ -235,18 +238,16 @@ template bool proveAndVerifyHonk(const std::string& bytec * follow. */ template -bool proveAndVerifyHonkProgram(const std::string& bytecodePath, const std::string& witnessPath) +bool proveAndVerifyHonkProgram(const std::string& bytecodePath, const bool recursive, const std::string& witnessPath) { bool honk_recursion = false; if constexpr (IsAnyOf) { honk_recursion = true; } auto program_stack = acir_format::get_acir_program_stack(bytecodePath, witnessPath, honk_recursion); - while (!program_stack.empty()) { auto stack_item = program_stack.back(); - - if (!proveAndVerifyHonkAcirFormat(stack_item.constraints, stack_item.witness)) { + if (!proveAndVerifyHonkAcirFormat(stack_item.constraints, recursive, stack_item.witness)) { return false; } program_stack.pop_back(); @@ -366,7 +367,8 @@ void client_ivc_prove_output_all_msgpack(const std::string& bytecodePath, bool is_kernel = false; for (Program& program : folding_stack) { // Construct a bberg circuit from the acir representation then accumulate it into the IVC - auto circuit = create_circuit(program.constraints, 0, program.witness, false, ivc.goblin.op_queue); + auto circuit = + create_circuit(program.constraints, true, 0, program.witness, false, ivc.goblin.op_queue); // Set the internal is_kernel flag based on the local mechanism only if it has not already been set to true if (!circuit.databus_propagation_data.is_kernel) { @@ -463,8 +465,12 @@ bool foldAndVerifyProgram(const std::string& bytecodePath, const std::string& wi auto stack_item = program_stack.back(); // Construct a bberg circuit from the acir representation - auto builder = acir_format::create_circuit( - stack_item.constraints, 0, stack_item.witness, /*honk_recursion=*/false, ivc.goblin.op_queue); + auto builder = acir_format::create_circuit(stack_item.constraints, + /*recursive=*/true, + 0, + stack_item.witness, + /*honk_recursion=*/false, + ivc.goblin.op_queue); // Set the internal is_kernel flag to trigger automatic appending of kernel logic if true builder.databus_propagation_data.is_kernel = is_kernel; @@ -514,7 +520,7 @@ void client_ivc_prove_output_all(const std::string& bytecodePath, // Construct a bberg circuit from the acir representation auto circuit = acir_format::create_circuit( - stack_item.constraints, 0, stack_item.witness, false, ivc.goblin.op_queue); + stack_item.constraints, true, 0, stack_item.witness, false, ivc.goblin.op_queue); circuit.databus_propagation_data.is_kernel = is_kernel; is_kernel = !is_kernel; // toggle on/off so every second circuit is intepreted as a kernel @@ -652,16 +658,19 @@ void prove_tube(const std::string& output_path) * * @param bytecodePath Path to the file containing the serialized circuit * @param witnessPath Path to the file containing the serialized witness - * @param recursive Whether to use recursive proof generation of non-recursive * @param outputPath Path to write the proof to + * @param recursive Whether to use recursive proof generation of non-recursive */ -void prove(const std::string& bytecodePath, const std::string& witnessPath, const std::string& outputPath) +void prove(const std::string& bytecodePath, + const std::string& witnessPath, + const std::string& outputPath, + const bool recursive) { auto constraint_system = get_constraint_system(bytecodePath, /*honk_recursion=*/false); auto witness = get_witness(witnessPath); acir_proofs::AcirComposer acir_composer{ 0, verbose_logging }; - acir_composer.create_finalized_circuit(constraint_system, witness); + acir_composer.create_finalized_circuit(constraint_system, recursive, witness); init_bn254_crs(acir_composer.get_finalized_dyadic_circuit_size()); acir_composer.init_proving_key(); auto proof = acir_composer.create_proof(); @@ -685,7 +694,8 @@ void prove(const std::string& bytecodePath, const std::string& witnessPath, cons * * @param bytecodePath Path to the file containing the serialized circuit */ -template void gateCount(const std::string& bytecodePath, bool honk_recursion) +template +void gateCount(const std::string& bytecodePath, bool recursive, bool honk_recursion) { // All circuit reports will be built into the string below std::string functions_string = "{\"functions\": [\n "; @@ -693,7 +703,7 @@ template void gateCount(const std::stri size_t i = 0; for (auto constraint_system : constraint_systems) { auto builder = acir_format::create_circuit( - constraint_system, 0, {}, honk_recursion, std::make_shared(), true); + constraint_system, recursive, 0, {}, honk_recursion, std::make_shared(), true); builder.finalize_circuit(/*ensure_nonzero=*/true); size_t circuit_size = builder.num_gates; vinfo("Calculated circuit size in gateCount: ", circuit_size); @@ -767,12 +777,13 @@ bool verify(const std::string& proof_path, const std::string& vk_path) * * @param bytecodePath Path to the file containing the serialized circuit * @param outputPath Path to write the verification key to + * @param recursive Whether to create a SNARK friendly circuit and key */ -void write_vk(const std::string& bytecodePath, const std::string& outputPath) +void write_vk(const std::string& bytecodePath, const std::string& outputPath, const bool recursive) { auto constraint_system = get_constraint_system(bytecodePath, false); acir_proofs::AcirComposer acir_composer{ 0, verbose_logging }; - acir_composer.create_finalized_circuit(constraint_system); + acir_composer.create_finalized_circuit(constraint_system, recursive); acir_composer.finalize_circuit(); init_bn254_crs(acir_composer.get_finalized_dyadic_circuit_size()); acir_composer.init_proving_key(); @@ -787,11 +798,11 @@ void write_vk(const std::string& bytecodePath, const std::string& outputPath) } } -void write_pk(const std::string& bytecodePath, const std::string& outputPath) +void write_pk(const std::string& bytecodePath, const std::string& outputPath, const bool recursive) { auto constraint_system = get_constraint_system(bytecodePath, /*honk_recursion=*/false); acir_proofs::AcirComposer acir_composer{ 0, verbose_logging }; - acir_composer.create_finalized_circuit(constraint_system); + acir_composer.create_finalized_circuit(constraint_system, recursive); acir_composer.finalize_circuit(); init_bn254_crs(acir_composer.get_finalized_dyadic_circuit_size()); auto pk = acir_composer.init_proving_key(); @@ -1069,7 +1080,9 @@ bool avm_verify(const std::filesystem::path& proof_path, const std::filesystem:: * @return UltraProver_ */ template -UltraProver_ compute_valid_prover(const std::string& bytecodePath, const std::string& witnessPath) +UltraProver_ compute_valid_prover(const std::string& bytecodePath, + const std::string& witnessPath, + const bool recursive) { using Builder = Flavor::CircuitBuilder; using Prover = UltraProver_; @@ -1084,7 +1097,7 @@ UltraProver_ compute_valid_prover(const std::string& bytecodePath, const witness = get_witness(witnessPath); } - auto builder = acir_format::create_circuit(constraint_system, 0, witness, honk_recursion); + auto builder = acir_format::create_circuit(constraint_system, recursive, 0, witness, honk_recursion); auto prover = Prover{ builder }; init_bn254_crs(prover.proving_key->proving_key.circuit_size); return std::move(prover); @@ -1102,13 +1115,16 @@ UltraProver_ compute_valid_prover(const std::string& bytecodePath, const * @param outputPath Path to write the proof to */ template -void prove_honk(const std::string& bytecodePath, const std::string& witnessPath, const std::string& outputPath) +void prove_honk(const std::string& bytecodePath, + const std::string& witnessPath, + const std::string& outputPath, + const bool recursive) { // using Builder = Flavor::CircuitBuilder; using Prover = UltraProver_; // Construct Honk proof - Prover prover = compute_valid_prover(bytecodePath, witnessPath); + Prover prover = compute_valid_prover(bytecodePath, witnessPath, recursive); auto proof = prover.construct_proof(); if (outputPath == "-") { writeRawBytesToStdout(to_buffer(proof)); @@ -1163,13 +1179,14 @@ template bool verify_honk(const std::string& proof_path, * @param bytecodePath Path to the file containing the serialized circuit * @param outputPath Path to write the verification key to */ -template void write_vk_honk(const std::string& bytecodePath, const std::string& outputPath) +template +void write_vk_honk(const std::string& bytecodePath, const std::string& outputPath, const bool recursive) { using Prover = UltraProver_; using VerificationKey = Flavor::VerificationKey; // Construct a verification key from a partial form of the proving key which only has precomputed entities - Prover prover = compute_valid_prover(bytecodePath, ""); + Prover prover = compute_valid_prover(bytecodePath, "", recursive); VerificationKey vk(prover.proving_key->proving_key); auto serialized_vk = to_buffer(vk); @@ -1193,7 +1210,8 @@ template void write_vk_honk(const std::string& bytecodePa template void write_recursion_inputs_honk(const std::string& bytecodePath, const std::string& witnessPath, - const std::string& outputPath) + const std::string& outputPath, + const bool recursive) { using Builder = Flavor::CircuitBuilder; using Prover = UltraProver_; @@ -1201,9 +1219,9 @@ void write_recursion_inputs_honk(const std::string& bytecodePath, using FF = Flavor::FF; bool honk_recursion = true; - auto constraints = get_constraint_system(bytecodePath, /*honk_recursion=*/true); + auto constraints = get_constraint_system(bytecodePath, honk_recursion); auto witness = get_witness(witnessPath); - auto builder = acir_format::create_circuit(constraints, 0, witness, honk_recursion); + auto builder = acir_format::create_circuit(constraints, recursive, 0, witness, honk_recursion); // Construct Honk proof and verification key Prover prover{ builder }; @@ -1282,14 +1300,18 @@ template void vk_as_fields_honk(const std::string& vk_pat * @param bytecodePath Path to the file containing the serialized circuit * @param witnessPath Path to the file containing the serialized witness * @param outputPath Directory into which we write the proof and verification key data + * @param recursive Whether to a build SNARK friendly proof */ -void prove_output_all(const std::string& bytecodePath, const std::string& witnessPath, const std::string& outputPath) +void prove_output_all(const std::string& bytecodePath, + const std::string& witnessPath, + const std::string& outputPath, + const bool recursive) { auto constraint_system = get_constraint_system(bytecodePath, /*honk_recursion=*/false); auto witness = get_witness(witnessPath); acir_proofs::AcirComposer acir_composer{ 0, verbose_logging }; - acir_composer.create_finalized_circuit(constraint_system, witness); + acir_composer.create_finalized_circuit(constraint_system, recursive, witness); acir_composer.finalize_circuit(); init_bn254_crs(acir_composer.get_finalized_dyadic_circuit_size()); acir_composer.init_proving_key(); @@ -1335,11 +1357,13 @@ void prove_output_all(const std::string& bytecodePath, const std::string& witnes * @param bytecodePath Path to the file containing the serialized circuit * @param witnessPath Path to the file containing the serialized witness * @param outputPath Directory into which we write the proof and verification key data + * @param recursive Whether to build a SNARK friendly proof */ template void prove_honk_output_all(const std::string& bytecodePath, const std::string& witnessPath, - const std::string& outputPath) + const std::string& outputPath, + const bool recursive) { using Builder = Flavor::CircuitBuilder; using Prover = UltraProver_; @@ -1353,7 +1377,7 @@ void prove_honk_output_all(const std::string& bytecodePath, auto constraint_system = get_constraint_system(bytecodePath, honk_recursion); auto witness = get_witness(witnessPath); - auto builder = acir_format::create_circuit(constraint_system, 0, witness, honk_recursion); + auto builder = acir_format::create_circuit(constraint_system, recursive, 0, witness, honk_recursion); // Construct Honk proof Prover prover{ builder }; @@ -1421,6 +1445,7 @@ int main(int argc, char* argv[]) std::string vk_path = get_option(args, "-k", "./target/vk"); std::string pk_path = get_option(args, "-r", "./target/pk"); bool honk_recursion = flag_present(args, "-h"); + bool recursive = flag_present(args, "--recursive"); // Not every flavor handles it. CRS_PATH = get_option(args, "-c", CRS_PATH); // Skip CRS initialization for any command which doesn't require the CRS. @@ -1429,21 +1454,20 @@ int main(int argc, char* argv[]) return 0; } if (command == "prove_and_verify") { - return proveAndVerify(bytecode_path, witness_path) ? 0 : 1; + return proveAndVerify(bytecode_path, recursive, witness_path) ? 0 : 1; } if (command == "prove_and_verify_ultra_honk") { - return proveAndVerifyHonk(bytecode_path, witness_path) ? 0 : 1; + return proveAndVerifyHonk(bytecode_path, recursive, witness_path) ? 0 : 1; } if (command == "prove_and_verify_mega_honk") { - return proveAndVerifyHonk(bytecode_path, witness_path) ? 0 : 1; + return proveAndVerifyHonk(bytecode_path, recursive, witness_path) ? 0 : 1; } if (command == "prove_and_verify_ultra_honk_program") { - return proveAndVerifyHonkProgram(bytecode_path, witness_path) ? 0 : 1; + return proveAndVerifyHonkProgram(bytecode_path, recursive, witness_path) ? 0 : 1; } if (command == "prove_and_verify_mega_honk_program") { - return proveAndVerifyHonkProgram(bytecode_path, witness_path) ? 0 : 1; + return proveAndVerifyHonkProgram(bytecode_path, recursive, witness_path) ? 0 : 1; } - // TODO(https://github.com/AztecProtocol/barretenberg/issues/1050) we need a verify_client_ivc bb cli command // TODO(#7371): remove this if (command == "client_ivc_prove_output_all_msgpack") { std::filesystem::path output_dir = get_option(args, "-o", "./target"); @@ -1469,16 +1493,16 @@ int main(int argc, char* argv[]) if (command == "prove") { std::string output_path = get_option(args, "-o", "./proofs/proof"); - prove(bytecode_path, witness_path, output_path); + prove(bytecode_path, witness_path, output_path, recursive); } else if (command == "prove_output_all") { std::string output_path = get_option(args, "-o", "./proofs"); - prove_output_all(bytecode_path, witness_path, output_path); + prove_output_all(bytecode_path, witness_path, output_path, recursive); } else if (command == "prove_ultra_honk_output_all") { std::string output_path = get_option(args, "-o", "./proofs"); - prove_honk_output_all(bytecode_path, witness_path, output_path); + prove_honk_output_all(bytecode_path, witness_path, output_path, recursive); } else if (command == "prove_mega_honk_output_all") { std::string output_path = get_option(args, "-o", "./proofs"); - prove_honk_output_all(bytecode_path, witness_path, output_path); + prove_honk_output_all(bytecode_path, witness_path, output_path, recursive); } else if (command == "client_ivc_prove_output_all") { std::string output_path = get_option(args, "-o", "./target"); client_ivc_prove_output_all(bytecode_path, witness_path, output_path); @@ -1491,9 +1515,9 @@ int main(int argc, char* argv[]) auto tube_vk_path = output_path + "/vk"; return verify_honk(tube_proof_path, tube_vk_path) ? 0 : 1; } else if (command == "gates") { - gateCount(bytecode_path, honk_recursion); + gateCount(bytecode_path, recursive, honk_recursion); } else if (command == "gates_mega_honk") { - gateCount(bytecode_path, honk_recursion); + gateCount(bytecode_path, recursive, honk_recursion); } else if (command == "verify") { return verify(proof_path, vk_path) ? 0 : 1; } else if (command == "contract") { @@ -1504,10 +1528,10 @@ int main(int argc, char* argv[]) contract_honk(output_path, vk_path); } else if (command == "write_vk") { std::string output_path = get_option(args, "-o", "./target/vk"); - write_vk(bytecode_path, output_path); + write_vk(bytecode_path, output_path, recursive); } else if (command == "write_pk") { std::string output_path = get_option(args, "-o", "./target/pk"); - write_pk(bytecode_path, output_path); + write_pk(bytecode_path, output_path, recursive); } else if (command == "proof_as_fields") { std::string output_path = get_option(args, "-o", proof_path + "_fields.json"); proof_as_fields(proof_path, vk_path, output_path); @@ -1516,7 +1540,7 @@ int main(int argc, char* argv[]) vk_as_fields(vk_path, output_path); } else if (command == "write_recursion_inputs_honk") { std::string output_path = get_option(args, "-o", "./target"); - write_recursion_inputs_honk(bytecode_path, witness_path, output_path); + write_recursion_inputs_honk(bytecode_path, witness_path, output_path, recursive); #ifndef DISABLE_AZTEC_VM } else if (command == "avm_prove") { std::filesystem::path avm_calldata_path = get_option(args, "--avm-calldata", "./target/avm_calldata.bin"); @@ -1533,31 +1557,31 @@ int main(int argc, char* argv[]) #endif } else if (command == "prove_ultra_honk") { std::string output_path = get_option(args, "-o", "./proofs/proof"); - prove_honk(bytecode_path, witness_path, output_path); + prove_honk(bytecode_path, witness_path, output_path, recursive); } else if (command == "prove_ultra_keccak_honk") { std::string output_path = get_option(args, "-o", "./proofs/proof"); - prove_honk(bytecode_path, witness_path, output_path); + prove_honk(bytecode_path, witness_path, output_path, recursive); } else if (command == "prove_ultra_keccak_honk_output_all") { std::string output_path = get_option(args, "-o", "./proofs/proof"); - prove_honk_output_all(bytecode_path, witness_path, output_path); + prove_honk_output_all(bytecode_path, witness_path, output_path, recursive); } else if (command == "verify_ultra_honk") { return verify_honk(proof_path, vk_path) ? 0 : 1; } else if (command == "verify_ultra_keccak_honk") { return verify_honk(proof_path, vk_path) ? 0 : 1; } else if (command == "write_vk_ultra_honk") { std::string output_path = get_option(args, "-o", "./target/vk"); - write_vk_honk(bytecode_path, output_path); + write_vk_honk(bytecode_path, output_path, recursive); } else if (command == "write_vk_ultra_keccak_honk") { std::string output_path = get_option(args, "-o", "./target/vk"); - write_vk_honk(bytecode_path, output_path); + write_vk_honk(bytecode_path, output_path, recursive); } else if (command == "prove_mega_honk") { std::string output_path = get_option(args, "-o", "./proofs/proof"); - prove_honk(bytecode_path, witness_path, output_path); + prove_honk(bytecode_path, witness_path, output_path, recursive); } else if (command == "verify_mega_honk") { return verify_honk(proof_path, vk_path) ? 0 : 1; } else if (command == "write_vk_mega_honk") { std::string output_path = get_option(args, "-o", "./target/vk"); - write_vk_honk(bytecode_path, output_path); + write_vk_honk(bytecode_path, output_path, recursive); } else if (command == "proof_as_fields_honk") { std::string output_path = get_option(args, "-o", proof_path + "_fields.json"); proof_as_fields_honk(proof_path, output_path); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp index 7b08678ad71..4d5a83a308f 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.cpp @@ -399,15 +399,14 @@ AggregationObjectIndices process_avm_recursion_constraints(Builder& builder, */ template <> UltraCircuitBuilder create_circuit(AcirFormat& constraint_system, + bool recursive, const size_t size_hint, const WitnessVector& witness, bool honk_recursion, [[maybe_unused]] std::shared_ptr, bool collect_gates_per_opcode) { - Builder builder{ - size_hint, witness, constraint_system.public_inputs, constraint_system.varnum, constraint_system.recursive - }; + Builder builder{ size_hint, witness, constraint_system.public_inputs, constraint_system.varnum, recursive }; bool has_valid_witness_assignments = !witness.empty(); build_constraints( @@ -429,6 +428,7 @@ UltraCircuitBuilder create_circuit(AcirFormat& constraint_system, */ template <> MegaCircuitBuilder create_circuit(AcirFormat& constraint_system, + [[maybe_unused]] bool recursive, [[maybe_unused]] const size_t size_hint, const WitnessVector& witness, bool honk_recursion, @@ -470,6 +470,7 @@ MegaCircuitBuilder create_kernel_circuit(AcirFormat& constraint_system, // Construct the main kernel circuit logic excluding recursive verifiers auto circuit = create_circuit(constraint_system, + /*recursive=*/false, size_hint, witness, /*honk_recursion=*/false, diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.hpp index 79a750b2e89..dba936225f6 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_format.hpp @@ -75,7 +75,6 @@ struct AcirFormat { // of another SNARK. For example, a recursive friendly proof may use Blake3Pedersen for // hashing in its transcript, while we still want a prove that uses Keccak for its transcript in order // to be able to verify SNARKs on Ethereum. - bool recursive; uint32_t num_acir_opcodes; @@ -200,6 +199,12 @@ struct AcirProgramStack { template Builder create_circuit(AcirFormat& constraint_system, + // Specifies whether a prover that produces SNARK recursion friendly proofs should be used. + // The proof produced when this flag is true should be friendly for recursive verification inside + // of another SNARK. For example, a recursive friendly proof may use Blake3Pedersen for + // hashing in its transcript, while we still want a prove that uses Keccak for its transcript in + // order to be able to verify SNARKs on Ethereum. + bool recursive, const size_t size_hint = 0, const WitnessVector& witness = {}, bool honk_recursion = false, 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 199bfac3ca6..d3fb922732e 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 @@ -39,7 +39,6 @@ TEST_F(AcirFormatTests, TestASingleConstraintNoPubInputs) AcirFormat constraint_system{ .varnum = 4, - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -71,7 +70,7 @@ TEST_F(AcirFormatTests, TestASingleConstraintNoPubInputs) }; mock_opcode_indices(constraint_system); WitnessVector witness{ 0, 0, 1 }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -160,7 +159,6 @@ TEST_F(AcirFormatTests, TestLogicGateFromNoirCircuit) AcirFormat constraint_system{ .varnum = 6, - .recursive = false, .num_acir_opcodes = 7, .public_inputs = { 1 }, .logic_constraints = { logic_constraint }, @@ -196,7 +194,7 @@ TEST_F(AcirFormatTests, TestLogicGateFromNoirCircuit) WitnessVector witness{ 5, 10, 15, 5, inverse_of_five, 1, }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -240,7 +238,6 @@ TEST_F(AcirFormatTests, TestSchnorrVerifyPass) AcirFormat constraint_system{ .varnum = 81, - .recursive = false, .num_acir_opcodes = 76, .public_inputs = {}, .logic_constraints = {}, @@ -302,7 +299,7 @@ TEST_F(AcirFormatTests, TestSchnorrVerifyPass) witness[i] = message_string[i]; } - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -346,7 +343,6 @@ TEST_F(AcirFormatTests, TestSchnorrVerifySmallRange) }; AcirFormat constraint_system{ .varnum = 81, - .recursive = false, .num_acir_opcodes = 76, .public_inputs = {}, .logic_constraints = {}, @@ -409,7 +405,7 @@ TEST_F(AcirFormatTests, TestSchnorrVerifySmallRange) } // TODO: actually sign a schnorr signature! - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -455,7 +451,6 @@ TEST_F(AcirFormatTests, TestKeccakPermutation) AcirFormat constraint_system{ .varnum = 51, - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -491,7 +486,7 @@ TEST_F(AcirFormatTests, TestKeccakPermutation) 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }; - auto builder = create_circuit(constraint_system, /*size_hint=*/0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint=*/0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); auto proof = prover.construct_proof(); @@ -529,7 +524,6 @@ TEST_F(AcirFormatTests, TestCollectsGateCounts) AcirFormat constraint_system{ .varnum = 4, - .recursive = false, .num_acir_opcodes = 2, .public_inputs = {}, .logic_constraints = {}, @@ -561,8 +555,13 @@ TEST_F(AcirFormatTests, TestCollectsGateCounts) }; mock_opcode_indices(constraint_system); WitnessVector witness{ 5, 27, 32 }; - auto builder = - create_circuit(constraint_system, /*size_hint*/ 0, witness, false, std::make_shared(), true); + auto builder = create_circuit(constraint_system, + /*recursive*/ false, + /*size_hint*/ 0, + witness, + false, + std::make_shared(), + true); EXPECT_EQ(constraint_system.gates_per_opcode, std::vector({ 2, 1 })); } @@ -655,7 +654,6 @@ TEST_F(AcirFormatTests, TestBigAdd) size_t num_variables = witness_values.size(); AcirFormat constraint_system{ .varnum = static_cast(num_variables + 1), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -687,7 +685,7 @@ TEST_F(AcirFormatTests, TestBigAdd) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); auto composer = Composer(); auto prover = composer.create_prover(builder); 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 4420223e9dd..3719a9ec15c 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 @@ -154,7 +154,8 @@ TEST_P(AcirIntegrationSingleTest, DISABLED_ProveAndVerifyProgram) false); // TODO(https://github.com/AztecProtocol/barretenberg/issues/1013): Assumes Flavor is not UltraHonk // Construct a bberg circuit from the acir representation - Builder builder = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + Builder builder = + acir_format::create_circuit(acir_program.constraints, /*recursive*/ false, 0, acir_program.witness); // Construct and verify Honk proof if constexpr (IsPlonkFlavor) { @@ -192,7 +193,6 @@ INSTANTIATE_TEST_SUITE_P(AcirTests, "array_to_slice_constant_length", "assert", "assert_statement", - "assert_statement_recursive", "assign_ex", "bigint", "bit_and", @@ -259,7 +259,6 @@ INSTANTIATE_TEST_SUITE_P(AcirTests, "diamond_deps_0", "double_verify_nested_proof", "double_verify_proof", - "double_verify_proof_recursive", "ecdsa_secp256k1", "ecdsa_secp256r1", "ecdsa_secp256r1_3x", @@ -381,7 +380,8 @@ TEST_P(AcirIntegrationFoldingTest, DISABLED_ProveAndVerifyProgramStack) auto program = program_stack.back(); // Construct a bberg circuit from the acir representation - auto builder = acir_format::create_circuit(program.constraints, 0, program.witness); + auto builder = + acir_format::create_circuit(program.constraints, /*recursive*/ false, 0, program.witness); // Construct and verify Honk proof for the individidual circuit EXPECT_TRUE(prove_and_verify_honk(builder)); @@ -408,8 +408,8 @@ TEST_P(AcirIntegrationFoldingTest, DISABLED_FoldAndVerifyProgramStack) auto program = program_stack.back(); // Construct a bberg circuit from the acir representation - auto circuit = - acir_format::create_circuit(program.constraints, 0, program.witness, false, ivc.goblin.op_queue); + auto circuit = acir_format::create_circuit( + program.constraints, /*recursive*/ false, 0, program.witness, false, ivc.goblin.op_queue); ivc.accumulate(circuit); @@ -440,7 +440,8 @@ TEST_F(AcirIntegrationTest, DISABLED_Databus) acir_format::AcirProgram acir_program = get_program_data_from_test_file(test_name); // Construct a bberg circuit from the acir representation - Builder builder = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + Builder builder = + acir_format::create_circuit(acir_program.constraints, /*recursive*/ false, 0, acir_program.witness); // This prints a summary of the types of gates in the circuit builder.blocks.summarize(); @@ -464,7 +465,8 @@ TEST_F(AcirIntegrationTest, DISABLED_DatabusTwoCalldata) acir_format::AcirProgram acir_program = get_program_data_from_test_file(test_name); // Construct a bberg circuit from the acir representation - Builder builder = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + Builder builder = + acir_format::create_circuit(acir_program.constraints, /*recursive*/ false, 0, acir_program.witness); // Check that the databus columns in the builder have been populated as expected const auto& calldata = builder.get_calldata(); @@ -518,7 +520,8 @@ TEST_F(AcirIntegrationTest, DISABLED_UpdateAcirCircuit) // Assumes Flavor is not UltraHonk // Construct a bberg circuit from the acir representation - auto circuit = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + auto circuit = + acir_format::create_circuit(acir_program.constraints, /*recursive*/ false, 0, acir_program.witness); EXPECT_TRUE(CircuitChecker::check(circuit)); @@ -557,7 +560,8 @@ TEST_F(AcirIntegrationTest, DISABLED_HonkRecursion) /*honk_recursion=*/false); // Construct a bberg circuit from the acir representation - auto circuit = acir_format::create_circuit(acir_program.constraints, 0, acir_program.witness); + auto circuit = + acir_format::create_circuit(acir_program.constraints, /*recursive*/ false, 0, acir_program.witness); EXPECT_TRUE(CircuitChecker::check(circuit)); EXPECT_TRUE(prove_and_verify_honk(circuit)); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp index bf7eb2dd8de..2dd6e2df128 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/acir_to_constraint_buf.cpp @@ -800,7 +800,6 @@ AcirFormat circuit_serde_to_acir_format(Program::Circuit const& circuit, bool ho AcirFormat af; // `varnum` is the true number of variables, thus we add one to the index which starts at zero af.varnum = circuit.current_witness_index + 1; - af.recursive = circuit.recursive; af.num_acir_opcodes = static_cast(circuit.opcodes.size()); af.public_inputs = join({ map(circuit.public_parameters.value, [](auto e) { return e.value; }), map(circuit.return_values.value, [](auto e) { return e.value; }) }); 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 c4e98e0d88f..bb49d13b0e4 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 @@ -117,13 +117,13 @@ class AcirAvmRecursionConstraint : public ::testing::Test { AcirFormat constraint_system; constraint_system.varnum = static_cast(witness.size()); - constraint_system.recursive = false; constraint_system.num_acir_opcodes = static_cast(avm_recursion_constraints.size()); constraint_system.avm_recursion_constraints = avm_recursion_constraints; constraint_system.original_opcode_indices = create_empty_original_opcode_indices(); mock_opcode_indices(constraint_system); - auto outer_circuit = create_circuit(constraint_system, /*size_hint*/ 0, witness, /*honk_recursion=*/true); + auto outer_circuit = + create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness, /*honk_recursion=*/true); return outer_circuit; } }; 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 295b66cdba7..fbb07a8bdc1 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 @@ -172,7 +172,6 @@ TEST_F(BigIntTests, TestBigIntConstraintMultiple) auto contraints5 = generate_big_int_op_constraint(BigIntOperationType::Div, fr(8), fr(2), witness); AcirFormat constraint_system{ .varnum = static_cast(witness.size() + 1), - .recursive = false, .num_acir_opcodes = 5, .public_inputs = {}, .logic_constraints = {}, @@ -210,7 +209,7 @@ TEST_F(BigIntTests, TestBigIntConstraintMultiple) mock_opcode_indices(constraint_system); constraint_system.varnum = static_cast(witness.size() + 1); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -245,7 +244,6 @@ TEST_F(BigIntTests, TestBigIntConstraintSimple) AcirFormat constraint_system{ .varnum = 5, - .recursive = false, .num_acir_opcodes = 3, .public_inputs = {}, .logic_constraints = {}, @@ -280,7 +278,7 @@ TEST_F(BigIntTests, TestBigIntConstraintSimple) WitnessVector witness{ 0, 3, 6, 3, 0, }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); auto proof = prover.construct_proof(); @@ -302,7 +300,6 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse) AcirFormat constraint_system{ .varnum = static_cast(witness.size() + 1), - .recursive = false, .num_acir_opcodes = 5, .public_inputs = {}, .logic_constraints = {}, @@ -343,7 +340,7 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse) constraint_system.varnum = static_cast(witness.size() + 1); mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -364,7 +361,6 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse2) AcirFormat constraint_system{ .varnum = static_cast(witness.size() + 1), - .recursive = false, .num_acir_opcodes = 5, .public_inputs = {}, .logic_constraints = {}, @@ -405,7 +401,7 @@ TEST_F(BigIntTests, TestBigIntConstraintReuse2) constraint_system.varnum = static_cast(witness.size() + 1); mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); @@ -447,7 +443,6 @@ TEST_F(BigIntTests, TestBigIntDIV) AcirFormat constraint_system{ .varnum = 5, - .recursive = false, .num_acir_opcodes = 4, .public_inputs = {}, .logic_constraints = {}, @@ -482,13 +477,13 @@ TEST_F(BigIntTests, TestBigIntDIV) WitnessVector witness{ 0, 6, 3, 2, 0, }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); auto proof = prover.construct_proof(); EXPECT_TRUE(CircuitChecker::check(builder)); - auto builder2 = create_circuit(constraint_system, /*size_hint*/ 0, WitnessVector{}); + auto builder2 = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, WitnessVector{}); EXPECT_TRUE(CircuitChecker::check(builder)); auto verifier2 = composer.create_ultra_with_keccak_verifier(builder); EXPECT_EQ(verifier2.verify_proof(proof), true); 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 8aec43aa612..571172e6876 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 @@ -140,7 +140,6 @@ TEST_F(UltraPlonkRAM, TestBlockConstraint) size_t num_variables = generate_block_constraint(block, witness_values); AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 7, .public_inputs = {}, .logic_constraints = {}, @@ -172,7 +171,7 @@ TEST_F(UltraPlonkRAM, TestBlockConstraint) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); auto composer = Composer(); auto prover = composer.create_prover(builder); @@ -191,7 +190,6 @@ TEST_F(MegaHonk, Databus) AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -224,7 +222,7 @@ TEST_F(MegaHonk, Databus) mock_opcode_indices(constraint_system); // Construct a bberg circuit from the acir representation - auto circuit = acir_format::create_circuit(constraint_system, 0, witness_values); + auto circuit = acir_format::create_circuit(constraint_system, /*recursive*/ false, 0, witness_values); EXPECT_TRUE(prove_and_verify(circuit)); } @@ -297,7 +295,6 @@ TEST_F(MegaHonk, DatabusReturn) AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 2, .public_inputs = {}, .logic_constraints = {}, @@ -330,7 +327,7 @@ TEST_F(MegaHonk, DatabusReturn) mock_opcode_indices(constraint_system); // Construct a bberg circuit from the acir representation - auto circuit = acir_format::create_circuit(constraint_system, 0, witness_values); + auto circuit = acir_format::create_circuit(constraint_system, /*recursive*/ false, 0, witness_values); EXPECT_TRUE(prove_and_verify(circuit)); } 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 193388efb3b..8f254c77c0d 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 @@ -62,7 +62,6 @@ TEST_F(EcOperations, TestECOperations) AcirFormat constraint_system{ .varnum = static_cast(num_variables + 1), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -94,7 +93,7 @@ TEST_F(EcOperations, TestECOperations) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); auto composer = Composer(); auto prover = composer.create_prover(builder); @@ -198,7 +197,6 @@ TEST_F(EcOperations, TestECMultiScalarMul) size_t num_variables = witness_values.size(); AcirFormat constraint_system{ .varnum = static_cast(num_variables + 1), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -230,7 +228,7 @@ TEST_F(EcOperations, TestECMultiScalarMul) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); auto composer = Composer(); auto prover = composer.create_prover(builder); 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 041c925122a..e6a9245a640 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 @@ -94,7 +94,6 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintSucceed) size_t num_variables = generate_ecdsa_constraint(ecdsa_k1_constraint, witness_values); AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -126,7 +125,7 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintSucceed) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); EXPECT_EQ(builder.get_variable(ecdsa_k1_constraint.result), 1); @@ -148,7 +147,6 @@ TEST_F(ECDSASecp256k1, TestECDSACompilesForVerifier) size_t num_variables = generate_ecdsa_constraint(ecdsa_k1_constraint, witness_values); AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -180,7 +178,7 @@ TEST_F(ECDSASecp256k1, TestECDSACompilesForVerifier) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system); + auto builder = create_circuit(constraint_system, /*recursive*/ false); } TEST_F(ECDSASecp256k1, TestECDSAConstraintFail) @@ -197,7 +195,6 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintFail) AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -229,7 +226,7 @@ TEST_F(ECDSASecp256k1, TestECDSAConstraintFail) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); EXPECT_EQ(builder.get_variable(ecdsa_k1_constraint.result), 0); auto composer = Composer(); 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 b6d29989d83..077f51b1bc2 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 @@ -128,7 +128,6 @@ TEST(ECDSASecp256r1, test_hardcoded) AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -165,7 +164,7 @@ TEST(ECDSASecp256r1, test_hardcoded) ecdsa_verify_signature(message, pub_key, signature); EXPECT_EQ(we_ballin, true); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); EXPECT_EQ(builder.get_variable(ecdsa_r1_constraint.result), 1); auto composer = Composer(); @@ -184,7 +183,6 @@ TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -216,7 +214,7 @@ TEST(ECDSASecp256r1, TestECDSAConstraintSucceed) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); EXPECT_EQ(builder.get_variable(ecdsa_r1_constraint.result), 1); auto composer = Composer(); @@ -238,7 +236,6 @@ TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) size_t num_variables = generate_ecdsa_constraint(ecdsa_r1_constraint, witness_values); AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -270,7 +267,7 @@ TEST(ECDSASecp256r1, TestECDSACompilesForVerifier) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system); + auto builder = create_circuit(constraint_system, /*recursive*/ false); } TEST(ECDSASecp256r1, TestECDSAConstraintFail) @@ -288,7 +285,6 @@ TEST(ECDSASecp256r1, TestECDSAConstraintFail) AcirFormat constraint_system{ .varnum = static_cast(num_variables), - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -320,7 +316,7 @@ TEST(ECDSASecp256r1, TestECDSAConstraintFail) }; mock_opcode_indices(constraint_system); - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness_values); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness_values); EXPECT_EQ(builder.get_variable(ecdsa_r1_constraint.result), 0); auto composer = Composer(); 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 3914ef1c38b..de6005c1942 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 @@ -90,7 +90,6 @@ class AcirHonkRecursionConstraint : public ::testing::Test { AcirFormat constraint_system{ .varnum = 6, - .recursive = true, .num_acir_opcodes = 7, .public_inputs = { 1, 2 }, .logic_constraints = { logic_constraint }, @@ -126,7 +125,8 @@ class AcirHonkRecursionConstraint : public ::testing::Test { WitnessVector witness{ 5, 10, 15, 5, inverse_of_five, 1, }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness, /*honk recursion*/ true); + auto builder = + create_circuit(constraint_system, /*recursive*/ true, /*size_hint*/ 0, witness, /*honk recursion*/ true); return builder; } @@ -170,13 +170,13 @@ class AcirHonkRecursionConstraint : public ::testing::Test { AcirFormat constraint_system{}; constraint_system.varnum = static_cast(witness.size()); - constraint_system.recursive = true; constraint_system.num_acir_opcodes = static_cast(honk_recursion_constraints.size()); constraint_system.honk_recursion_constraints = honk_recursion_constraints; constraint_system.original_opcode_indices = create_empty_original_opcode_indices(); mock_opcode_indices(constraint_system); - auto outer_circuit = create_circuit(constraint_system, /*size_hint*/ 0, witness, /*honk recursion*/ true); + auto outer_circuit = + create_circuit(constraint_system, /*recursive*/ true, /*size_hint*/ 0, witness, /*honk recursion*/ true); return outer_circuit; } 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 a77b017fdfa..11339b3de7b 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 @@ -136,7 +136,6 @@ class IvcRecursionConstraintTest : public ::testing::Test { // Construct a constraint system containing the business logic and ivc recursion constraints program.constraints.varnum = static_cast(program.witness.size()); - program.constraints.recursive = false; program.constraints.num_acir_opcodes = static_cast(ivc_recursion_constraints.size()); program.constraints.poly_triple_constraints = { pub_input_constraint }; program.constraints.ivc_recursion_constraints = ivc_recursion_constraints; 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 bc8dd7d8c90..fa8e711d0af 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 @@ -62,7 +62,6 @@ TEST_F(MSMTests, TestMSM) AcirFormat constraint_system{ .varnum = 9, - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -101,12 +100,12 @@ TEST_F(MSMTests, TestMSM) fr(0), }; - auto builder = create_circuit(constraint_system, /*size_hint=*/0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint=*/0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); auto proof = prover.construct_proof(); - auto builder2 = create_circuit(constraint_system, /*size_hint=*/0, {}); + auto builder2 = create_circuit(constraint_system, /*recursive*/ false, /*size_hint=*/0, {}); auto composer2 = Composer(); auto verifier = composer2.create_ultra_with_keccak_verifier(builder2); 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 9c07431abe8..6cb0592d9aa 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 @@ -42,7 +42,6 @@ TEST_F(Poseidon2Tests, TestPoseidon2Permutation) AcirFormat constraint_system{ .varnum = 9, - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -86,7 +85,7 @@ TEST_F(Poseidon2Tests, TestPoseidon2Permutation) fr(std::string("0x2e11c5cff2a22c64d01304b778d78f6998eff1ab73163a35603f54794c30847a")), }; - auto builder = create_circuit(constraint_system, /*size_hint=*/0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint=*/0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); 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 301bd915005..ddaf4e6ac7c 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 @@ -87,7 +87,6 @@ Builder create_inner_circuit() AcirFormat constraint_system{ .varnum = 6, - .recursive = true, .num_acir_opcodes = 7, .public_inputs = { 1, 2 }, .logic_constraints = { logic_constraint }, @@ -123,7 +122,7 @@ Builder create_inner_circuit() WitnessVector witness{ 5, 10, 15, 5, inverse_of_five, 1, }; - auto builder = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ true, /*size_hint*/ 0, witness); return builder; } @@ -248,7 +247,6 @@ Builder create_outer_circuit(std::vector& inner_circuits) AcirFormat constraint_system{ .varnum = static_cast(witness.size()), - .recursive = false, .num_acir_opcodes = static_cast(recursion_constraints.size()), .public_inputs = {}, .logic_constraints = {}, @@ -280,7 +278,7 @@ Builder create_outer_circuit(std::vector& inner_circuits) }; mock_opcode_indices(constraint_system); - auto outer_circuit = create_circuit(constraint_system, /*size_hint*/ 0, witness); + auto outer_circuit = create_circuit(constraint_system, /*recursive*/ false, /*size_hint*/ 0, witness); return outer_circuit; } diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp index 7fd958cc60f..d02312f3d21 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_format/serde/acir.hpp @@ -1365,7 +1365,6 @@ struct Circuit { Program::PublicInputs public_parameters; Program::PublicInputs return_values; std::vector> assert_messages; - bool recursive; friend bool operator==(const Circuit&, const Circuit&); std::vector bincodeSerialize() const; @@ -6724,9 +6723,6 @@ inline bool operator==(const Circuit& lhs, const Circuit& rhs) if (!(lhs.assert_messages == rhs.assert_messages)) { return false; } - if (!(lhs.recursive == rhs.recursive)) { - return false; - } return true; } @@ -6761,7 +6757,6 @@ void serde::Serializable::serialize(const Program::Circuit& ob serde::Serializable::serialize(obj.public_parameters, serializer); serde::Serializable::serialize(obj.return_values, serializer); serde::Serializable::serialize(obj.assert_messages, serializer); - serde::Serializable::serialize(obj.recursive, serializer); serializer.decrease_container_depth(); } @@ -6778,7 +6773,6 @@ Program::Circuit serde::Deserializable::deserialize(Deserializ obj.public_parameters = serde::Deserializable::deserialize(deserializer); obj.return_values = serde::Deserializable::deserialize(deserializer); obj.assert_messages = serde::Deserializable::deserialize(deserializer); - obj.recursive = serde::Deserializable::deserialize(deserializer); deserializer.decrease_container_depth(); return obj; } 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 b057ee17493..f59dfb8b9b8 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 @@ -37,7 +37,6 @@ TEST_F(Sha256Tests, TestSha256Compression) AcirFormat constraint_system{ .varnum = 34, - .recursive = false, .num_acir_opcodes = 1, .public_inputs = {}, .logic_constraints = {}, @@ -103,7 +102,7 @@ TEST_F(Sha256Tests, TestSha256Compression) 557795688, static_cast(3481642555) }; - auto builder = create_circuit(constraint_system, /*size_hint=*/0, witness); + auto builder = create_circuit(constraint_system, /*recursive*/ false, /*size_hint=*/0, witness); auto composer = Composer(); auto prover = composer.create_ultra_with_keccak_prover(builder); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp index 341d06d3541..fd1495414b5 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.cpp @@ -30,12 +30,19 @@ AcirComposer::AcirComposer(size_t size_hint, bool verbose) */ template void AcirComposer::create_finalized_circuit(acir_format::AcirFormat& constraint_system, + bool recursive, WitnessVector const& witness, bool collect_gates_per_opcode) { vinfo("building circuit..."); - builder_ = acir_format::create_circuit( - constraint_system, size_hint_, witness, false, std::make_shared(), collect_gates_per_opcode); + vinfo("should be recursive friendly: ", recursive); + builder_ = acir_format::create_circuit(constraint_system, + recursive, + size_hint_, + witness, + false, + std::make_shared(), + collect_gates_per_opcode); finalize_circuit(); vinfo("gates: ", builder_.get_estimated_total_circuit_size()); vinfo("circuit is recursive friendly: ", builder_.is_recursive_circuit); @@ -60,9 +67,11 @@ std::vector AcirComposer::create_proof() vinfo("creating proof..."); std::vector proof; if (builder_.is_recursive_circuit) { + vinfo("creating recursive prover..."); auto prover = composer.create_prover(builder_); proof = prover.construct_proof().proof_data; } else { + vinfo("creating ultra with keccak prover..."); auto prover = composer.create_ultra_with_keccak_prover(builder_); proof = prover.construct_proof().proof_data; } @@ -149,6 +158,7 @@ std::vector AcirComposer::serialize_verification_key_into_fields() } template void AcirComposer::create_finalized_circuit(acir_format::AcirFormat& constraint_system, + bool recursive, WitnessVector const& witness, bool collect_gates_per_opcode); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.hpp index 73ca0b11e11..682f3a51da4 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/acir_composer.hpp @@ -18,6 +18,7 @@ class AcirComposer { template void create_finalized_circuit(acir_format::AcirFormat& constraint_system, + bool recursive, WitnessVector const& witness = {}, bool collect_gates_per_opcode = false); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp index 48e9eb7ef14..16553a32d4a 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.cpp @@ -13,14 +13,12 @@ #include #include -WASM_EXPORT void acir_get_circuit_sizes(uint8_t const* acir_vec, - bool const* honk_recursion, - uint32_t* total, - uint32_t* subgroup) +WASM_EXPORT void acir_get_circuit_sizes( + uint8_t const* acir_vec, bool const* recursive, bool const* honk_recursion, uint32_t* total, uint32_t* subgroup) { auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), *honk_recursion); - auto builder = acir_format::create_circuit(constraint_system, 1 << 19, {}, *honk_recursion); + auto builder = acir_format::create_circuit(constraint_system, recursive, 1 << 19, {}, *honk_recursion); builder.finalize_circuit(/*ensure_nonzero=*/true); *total = htonl((uint32_t)builder.get_finalized_total_circuit_size()); *subgroup = htonl((uint32_t)builder.get_circuit_subgroup_size(builder.get_finalized_total_circuit_size())); @@ -36,41 +34,42 @@ WASM_EXPORT void acir_delete_acir_composer(in_ptr acir_composer_ptr) delete reinterpret_cast(*acir_composer_ptr); } -WASM_EXPORT void acir_init_proving_key(in_ptr acir_composer_ptr, uint8_t const* acir_vec) +WASM_EXPORT void acir_init_proving_key(in_ptr acir_composer_ptr, uint8_t const* acir_vec, bool const* recursive) { auto acir_composer = reinterpret_cast(*acir_composer_ptr); auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/false); - acir_composer->create_finalized_circuit(constraint_system); + acir_composer->create_finalized_circuit(constraint_system, *recursive); acir_composer->init_proving_key(); } -WASM_EXPORT void acir_create_proof(in_ptr acir_composer_ptr, - uint8_t const* acir_vec, - uint8_t const* witness_vec, - uint8_t** out) +WASM_EXPORT void acir_create_proof( + in_ptr acir_composer_ptr, uint8_t const* acir_vec, bool const* recursive, uint8_t const* witness_vec, uint8_t** out) { auto acir_composer = reinterpret_cast(*acir_composer_ptr); auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/false); auto witness = acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)); - acir_composer->create_finalized_circuit(constraint_system, witness); + acir_composer->create_finalized_circuit(constraint_system, *recursive, witness); acir_composer->init_proving_key(); auto proof_data = acir_composer->create_proof(); *out = to_heap_buffer(proof_data); } -WASM_EXPORT void acir_prove_and_verify_ultra_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, bool* result) +WASM_EXPORT void acir_prove_and_verify_ultra_honk(uint8_t const* acir_vec, + bool const* recursive, + uint8_t const* witness_vec, + bool* result) { auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/true); auto witness = acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)); - auto builder = - acir_format::create_circuit(constraint_system, 0, witness, /*honk_recursion=*/true); + auto builder = acir_format::create_circuit( + constraint_system, *recursive, 0, witness, /*honk_recursion=*/true); UltraProver prover{ builder }; auto proof = prover.construct_proof(); @@ -82,7 +81,10 @@ WASM_EXPORT void acir_prove_and_verify_ultra_honk(uint8_t const* acir_vec, uint8 info("verified: ", *result); } -WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* acir_vec, uint8_t const* witness_vec, bool* result) +WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* acir_vec, + bool const* recursive, + uint8_t const* witness_vec, + bool* result) { using ProgramStack = acir_format::AcirProgramStack; using Builder = MegaCircuitBuilder; @@ -102,8 +104,12 @@ WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* acir_vec, uin auto stack_item = program_stack.back(); // Construct a bberg circuit from the acir representation - auto builder = acir_format::create_circuit( - stack_item.constraints, 0, stack_item.witness, /*honk_recursion=*/false, ivc.goblin.op_queue); + auto builder = acir_format::create_circuit(stack_item.constraints, + *recursive, + 0, + stack_item.witness, + /*honk_recursion=*/false, + ivc.goblin.op_queue); builder.databus_propagation_data.is_kernel = is_kernel; is_kernel = !is_kernel; // toggle on/off so every second circuit is intepreted as a kernel @@ -116,14 +122,17 @@ WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* acir_vec, uin info("acir_fold_and_verify_program_stack result: ", *result); } -WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, bool* result) +WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* acir_vec, + bool const* recursive, + uint8_t const* witness_vec, + bool* result) { auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/false); auto witness = acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)); - auto builder = - acir_format::create_circuit(constraint_system, 0, witness, /*honk_recursion=*/false); + auto builder = acir_format::create_circuit( + constraint_system, *recursive, 0, witness, /*honk_recursion=*/false); MegaProver prover{ builder }; auto proof = prover.construct_proof(); @@ -155,12 +164,15 @@ WASM_EXPORT void acir_get_verification_key(in_ptr acir_composer_ptr, uint8_t** o *out = to_heap_buffer(to_buffer(*vk)); } -WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, uint8_t const* acir_vec, uint8_t** out) +WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, + uint8_t const* acir_vec, + bool const* recursive, + uint8_t** out) { auto acir_composer = reinterpret_cast(*acir_composer_ptr); auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/false); - acir_composer->create_finalized_circuit(constraint_system); + acir_composer->create_finalized_circuit(constraint_system, *recursive); auto pk = acir_composer->init_proving_key(); // We flatten to a vector first, as that's how we treat it on the calling side. *out = to_heap_buffer(to_buffer(*pk)); @@ -206,14 +218,17 @@ WASM_EXPORT void acir_serialize_verification_key_into_fields(in_ptr acir_compose write(out_key_hash, vk_hash); } -WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out) +WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, + bool const* recursive, + uint8_t const* witness_vec, + uint8_t** out) { auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/true); auto witness = acir_format::witness_buf_to_witness_data(from_buffer>(witness_vec)); - auto builder = - acir_format::create_circuit(constraint_system, 0, witness, /*honk_recursion=*/true); + auto builder = acir_format::create_circuit( + constraint_system, *recursive, 0, witness, /*honk_recursion=*/true); UltraProver prover{ builder }; auto proof = prover.construct_proof(); @@ -235,14 +250,15 @@ WASM_EXPORT void acir_verify_ultra_honk(uint8_t const* proof_buf, uint8_t const* *result = verifier.verify_proof(proof); } -WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, uint8_t** out) +WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, bool const* recursive, uint8_t** out) { using DeciderProvingKey = DeciderProvingKey_; using VerificationKey = UltraFlavor::VerificationKey; auto constraint_system = acir_format::circuit_buf_to_acir_format(from_buffer>(acir_vec), /*honk_recursion=*/true); - auto builder = acir_format::create_circuit(constraint_system, 0, {}, /*honk_recursion=*/true); + auto builder = + acir_format::create_circuit(constraint_system, *recursive, 0, {}, /*honk_recursion=*/true); DeciderProvingKey proving_key(builder); VerificationKey vk(proving_key.proving_key); diff --git a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp index 9015aeaf94d..2ed4613b666 100644 --- a/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp +++ b/barretenberg/cpp/src/barretenberg/dsl/acir_proofs/c_bind.hpp @@ -7,6 +7,7 @@ using namespace bb; WASM_EXPORT void acir_get_circuit_sizes(uint8_t const* constraint_system_buf, + bool const* recursive, bool const* honk_recursion, uint32_t* total, uint32_t* subgroup); @@ -15,7 +16,9 @@ WASM_EXPORT void acir_new_acir_composer(uint32_t const* size_hint, out_ptr out); WASM_EXPORT void acir_delete_acir_composer(in_ptr acir_composer_ptr); -WASM_EXPORT void acir_init_proving_key(in_ptr acir_composer_ptr, uint8_t const* constraint_system_buf); +WASM_EXPORT void acir_init_proving_key(in_ptr acir_composer_ptr, + uint8_t const* constraint_system_buf, + bool const* recursive); /** * It would have been nice to just hold onto the constraint_system in the acir_composer, but we can't waste the @@ -24,6 +27,7 @@ WASM_EXPORT void acir_init_proving_key(in_ptr acir_composer_ptr, uint8_t const* */ WASM_EXPORT void acir_create_proof(in_ptr acir_composer_ptr, uint8_t const* constraint_system_buf, + bool const* recursive, uint8_t const* witness_buf, uint8_t** out); @@ -32,6 +36,7 @@ WASM_EXPORT void acir_create_proof(in_ptr acir_composer_ptr, * */ WASM_EXPORT void acir_prove_and_verify_ultra_honk(uint8_t const* constraint_system_buf, + bool const* recursive, uint8_t const* witness_buf, bool* result); @@ -40,6 +45,7 @@ WASM_EXPORT void acir_prove_and_verify_ultra_honk(uint8_t const* constraint_syst * */ WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* constraint_system_buf, + bool const* recursive, uint8_t const* witness_buf, bool* result); @@ -48,6 +54,7 @@ WASM_EXPORT void acir_prove_and_verify_mega_honk(uint8_t const* constraint_syste * */ WASM_EXPORT void acir_fold_and_verify_program_stack(uint8_t const* constraint_system_buf, + bool const* recursive, uint8_t const* witness_buf, bool* result); @@ -57,7 +64,10 @@ WASM_EXPORT void acir_init_verification_key(in_ptr acir_composer_ptr); WASM_EXPORT void acir_get_verification_key(in_ptr acir_composer_ptr, uint8_t** out); -WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, uint8_t const* acir_vec, uint8_t** out); +WASM_EXPORT void acir_get_proving_key(in_ptr acir_composer_ptr, + uint8_t const* acir_vec, + bool const* recursive, + uint8_t** out); WASM_EXPORT void acir_verify_proof(in_ptr acir_composer_ptr, uint8_t const* proof_buf, bool* result); @@ -72,11 +82,14 @@ WASM_EXPORT void acir_serialize_verification_key_into_fields(in_ptr acir_compose fr::vec_out_buf out_vkey, fr::out_buf out_key_hash); -WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, uint8_t const* witness_vec, uint8_t** out); +WASM_EXPORT void acir_prove_ultra_honk(uint8_t const* acir_vec, + bool const* recursive, + uint8_t const* witness_vec, + uint8_t** out); WASM_EXPORT void acir_verify_ultra_honk(uint8_t const* proof_buf, uint8_t const* vk_buf, bool* result); -WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, uint8_t** out); +WASM_EXPORT void acir_write_vk_ultra_honk(uint8_t const* acir_vec, bool const* recursive, uint8_t** out); WASM_EXPORT void acir_proof_as_fields_ultra_honk(uint8_t const* proof_buf, fr::vec_out_buf out); diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp index 12ab5e5b543..238dcc86b0e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/circuit_builder_base.hpp @@ -40,8 +40,8 @@ template class CircuitBuilderBase { AggregationObjectPubInputIndices recursive_proof_public_input_indices; bool contains_recursive_proof = false; - // We only know from the circuit description whether a circuit should use a prover which produces - // proofs that are friendly to verify in a circuit themselves. However, a verifier does not need a full circuit + // We know from the CLI arguments during proving whether a circuit should use a prover which produces + // proofs that are friendly to verify in a circuit themselves. A verifier does not need a full circuit // description and should be able to verify a proof with just the verification key and the proof. // This field exists to later set the same field in the verification key, and make sure // that we are using the correct prover/verifier. diff --git a/barretenberg/exports.json b/barretenberg/exports.json index d6819afe1e5..67c4854c607 100644 --- a/barretenberg/exports.json +++ b/barretenberg/exports.json @@ -505,6 +505,10 @@ "name": "constraint_system_buf", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "honk_recursion", "type": "const bool *" @@ -563,6 +567,10 @@ { "name": "constraint_system_buf", "type": "const uint8_t *" + }, + { + "name": "recursive", + "type": "const bool *" } ], "outArgs": [], @@ -579,6 +587,10 @@ "name": "constraint_system_buf", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "witness_buf", "type": "const uint8_t *" @@ -599,6 +611,10 @@ "name": "constraint_system_buf", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "witness_buf", "type": "const uint8_t *" @@ -619,6 +635,10 @@ "name": "constraint_system_buf", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "witness_buf", "type": "const uint8_t *" @@ -639,6 +659,10 @@ "name": "constraint_system_buf", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "witness_buf", "type": "const uint8_t *" @@ -704,6 +728,10 @@ { "name": "acir_vec", "type": "const uint8_t *" + }, + { + "name": "recursive", + "type": "const bool *" } ], "outArgs": [ @@ -801,6 +829,10 @@ "name": "acir_vec", "type": "const uint8_t *" }, + { + "name": "recursive", + "type": "const bool *" + }, { "name": "witness_vec", "type": "const uint8_t *" @@ -840,6 +872,10 @@ { "name": "acir_vec", "type": "const uint8_t *" + }, + { + "name": "recursive", + "type": "const bool *" } ], "outArgs": [ @@ -882,4 +918,4 @@ ], "isAsync": false } -] +] \ No newline at end of file diff --git a/barretenberg/ts/src/barretenberg/backend.ts b/barretenberg/ts/src/barretenberg/backend.ts index 0919f030e5c..4657463be90 100644 --- a/barretenberg/ts/src/barretenberg/backend.ts +++ b/barretenberg/ts/src/barretenberg/backend.ts @@ -1,4 +1,4 @@ -import { BackendOptions, Barretenberg } from './index.js'; +import { BackendOptions, Barretenberg, CircuitOptions } from './index.js'; import { RawBuffer } from '../types/raw_buffer.js'; import { decompressSync as gunzip } from 'fflate'; import { @@ -21,22 +21,30 @@ export class UltraPlonkBackend { protected acirUncompressedBytecode: Uint8Array; - constructor(acirBytecode: string, protected options: BackendOptions = { threads: 1 }) { + constructor( + acirBytecode: string, + protected backendOptions: BackendOptions = { threads: 1 }, + protected circuitOptions: CircuitOptions = { recursive: false }, + ) { this.acirUncompressedBytecode = acirToUint8Array(acirBytecode); } /** @ignore */ async instantiate(): Promise { if (!this.api) { - const api = await Barretenberg.new(this.options); + const api = await Barretenberg.new(this.backendOptions); const honkRecursion = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [_total, subgroupSize] = await api.acirGetCircuitSizes(this.acirUncompressedBytecode, honkRecursion); + const [_total, subgroupSize] = await api.acirGetCircuitSizes( + this.acirUncompressedBytecode, + this.circuitOptions.recursive, + honkRecursion, + ); await api.initSRSForCircuitSize(subgroupSize); this.acirComposer = await api.acirNewAcirComposer(subgroupSize); - await api.acirInitProvingKey(this.acirComposer, this.acirUncompressedBytecode); + await api.acirInitProvingKey(this.acirComposer, this.acirUncompressedBytecode, this.circuitOptions.recursive); this.api = api; } } @@ -47,6 +55,7 @@ export class UltraPlonkBackend { const proofWithPublicInputs = await this.api.acirCreateProof( this.acirComposer, this.acirUncompressedBytecode, + this.circuitOptions.recursive, gunzip(compressedWitness), ); @@ -69,8 +78,8 @@ export class UltraPlonkBackend { * Instead of passing the proof and verification key as a byte array, we pass them * as fields which makes it cheaper to verify in a circuit. * - * The proof that is passed here will have been created using a circuit - * that has the #[recursive] attribute on its `main` method. + * The proof that is passed here will have been created by passing the `recursive` + * parameter to a backend. * * The number of public inputs denotes how many public inputs are in the inner proof. * @@ -145,15 +154,19 @@ export class UltraHonkBackend { protected api!: Barretenberg; protected acirUncompressedBytecode: Uint8Array; - constructor(acirBytecode: string, protected options: BackendOptions = { threads: 1 }) { + constructor( + acirBytecode: string, + protected backendOptions: BackendOptions = { threads: 1 }, + protected circuitOptions: CircuitOptions = { recursive: false }, + ) { this.acirUncompressedBytecode = acirToUint8Array(acirBytecode); } /** @ignore */ async instantiate(): Promise { if (!this.api) { - const api = await Barretenberg.new(this.options); + const api = await Barretenberg.new(this.backendOptions); const honkRecursion = true; - await api.acirInitSRS(this.acirUncompressedBytecode, honkRecursion); + await api.acirInitSRS(this.acirUncompressedBytecode, this.circuitOptions.recursive, honkRecursion); // We don't init a proving key here in the Honk API // await api.acirInitProvingKey(this.acirComposer, this.acirUncompressedBytecode); @@ -165,6 +178,7 @@ export class UltraHonkBackend { await this.instantiate(); const proofWithPublicInputs = await this.api.acirProveUltraHonk( this.acirUncompressedBytecode, + this.circuitOptions.recursive, gunzip(compressedWitness), ); @@ -194,14 +208,14 @@ export class UltraHonkBackend { async verifyProof(proofData: ProofData): Promise { await this.instantiate(); const proof = reconstructHonkProof(flattenFieldsAsArray(proofData.publicInputs), proofData.proof); - const vkBuf = await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode); + const vkBuf = await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode, this.circuitOptions.recursive); return await this.api.acirVerifyUltraHonk(proof, new RawBuffer(vkBuf)); } async getVerificationKey(): Promise { await this.instantiate(); - return await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode); + return await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode, this.circuitOptions.recursive); } // TODO(https://github.com/noir-lang/noir/issues/5661): Update this to handle Honk recursive aggregation in the browser once it is ready in the backend itself @@ -222,7 +236,7 @@ export class UltraHonkBackend { // TODO: perhaps we should put this in the init function. Need to benchmark // TODO how long it takes. - const vkBuf = await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode); + const vkBuf = await this.api.acirWriteVkUltraHonk(this.acirUncompressedBytecode, this.circuitOptions.recursive); const vk = await this.api.acirVkAsFieldsUltraHonk(vkBuf); return { diff --git a/barretenberg/ts/src/barretenberg/index.ts b/barretenberg/ts/src/barretenberg/index.ts index 5a0a14a2f9b..96b9b7d5c23 100644 --- a/barretenberg/ts/src/barretenberg/index.ts +++ b/barretenberg/ts/src/barretenberg/index.ts @@ -24,6 +24,11 @@ export type BackendOptions = { crsPath?: string; }; +export type CircuitOptions = { + /** @description Whether to produce SNARK friendly proofs */ + recursive: boolean; +}; + /** * The main class library consumers interact with. * It extends the generated api, and provides a static constructor "new" to compose components. @@ -61,9 +66,9 @@ export class Barretenberg extends BarretenbergApi { await this.srsInitSrs(new RawBuffer(crs.getG1Data()), crs.numPoints, new RawBuffer(crs.getG2Data())); } - async acirInitSRS(bytecode: Uint8Array, honkRecursion: boolean): Promise { + async acirInitSRS(bytecode: Uint8Array, recursive: boolean, honkRecursion: boolean): Promise { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [_total, subgroupSize] = await this.acirGetCircuitSizes(bytecode, honkRecursion); + const [_total, subgroupSize] = await this.acirGetCircuitSizes(bytecode, recursive, honkRecursion); return this.initSRSForCircuitSize(subgroupSize); } diff --git a/barretenberg/ts/src/barretenberg_api/index.ts b/barretenberg/ts/src/barretenberg_api/index.ts index dca7e7cabdd..06290eda204 100644 --- a/barretenberg/ts/src/barretenberg_api/index.ts +++ b/barretenberg/ts/src/barretenberg_api/index.ts @@ -328,8 +328,12 @@ export class BarretenbergApi { return; } - async acirGetCircuitSizes(constraintSystemBuf: Uint8Array, honkRecursion: boolean): Promise<[number, number]> { - const inArgs = [constraintSystemBuf, honkRecursion].map(serializeBufferable); + async acirGetCircuitSizes( + constraintSystemBuf: Uint8Array, + recursive: boolean, + honkRecursion: boolean, + ): Promise<[number, number]> { + const inArgs = [constraintSystemBuf, recursive, honkRecursion].map(serializeBufferable); const outTypes: OutputType[] = [NumberDeserializer(), NumberDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_get_circuit_sizes', @@ -364,8 +368,8 @@ export class BarretenbergApi { return; } - async acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array): Promise { - const inArgs = [acirComposerPtr, constraintSystemBuf].map(serializeBufferable); + async acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, recursive: boolean): Promise { + const inArgs = [acirComposerPtr, constraintSystemBuf, recursive].map(serializeBufferable); const outTypes: OutputType[] = []; const result = await this.wasm.callWasmExport( 'acir_init_proving_key', @@ -379,9 +383,10 @@ export class BarretenbergApi { async acirCreateProof( acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, + recursive: boolean, witnessBuf: Uint8Array, ): Promise { - const inArgs = [acirComposerPtr, constraintSystemBuf, witnessBuf].map(serializeBufferable); + const inArgs = [acirComposerPtr, constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_create_proof', @@ -392,8 +397,12 @@ export class BarretenbergApi { return out[0]; } - async acirProveAndVerifyUltraHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Promise { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + async acirProveAndVerifyUltraHonk( + constraintSystemBuf: Uint8Array, + recursive: boolean, + witnessBuf: Uint8Array, + ): Promise { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_prove_and_verify_ultra_honk', @@ -404,8 +413,12 @@ export class BarretenbergApi { return out[0]; } - async acirProveAndVerifyMegaHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Promise { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + async acirProveAndVerifyMegaHonk( + constraintSystemBuf: Uint8Array, + recursive: boolean, + witnessBuf: Uint8Array, + ): Promise { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_prove_and_verify_mega_honk', @@ -416,8 +429,12 @@ export class BarretenbergApi { return out[0]; } - async acirFoldAndVerifyProgramStack(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Promise { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + async acirFoldAndVerifyProgramStack( + constraintSystemBuf: Uint8Array, + recursive: boolean, + witnessBuf: Uint8Array, + ): Promise { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_fold_and_verify_program_stack', @@ -464,8 +481,8 @@ export class BarretenbergApi { return out[0]; } - async acirGetProvingKey(acirComposerPtr: Ptr, acirVec: Uint8Array): Promise { - const inArgs = [acirComposerPtr, acirVec].map(serializeBufferable); + async acirGetProvingKey(acirComposerPtr: Ptr, acirVec: Uint8Array, recursive: boolean): Promise { + const inArgs = [acirComposerPtr, acirVec, recursive].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_get_proving_key', @@ -528,8 +545,8 @@ export class BarretenbergApi { return out as any; } - async acirProveUltraHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Promise { - const inArgs = [acirVec, witnessVec].map(serializeBufferable); + async acirProveUltraHonk(acirVec: Uint8Array, recursive: boolean, witnessVec: Uint8Array): Promise { + const inArgs = [acirVec, recursive, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_prove_ultra_honk', @@ -552,8 +569,8 @@ export class BarretenbergApi { return out[0]; } - async acirWriteVkUltraHonk(acirVec: Uint8Array): Promise { - const inArgs = [acirVec].map(serializeBufferable); + async acirWriteVkUltraHonk(acirVec: Uint8Array, recursive: boolean): Promise { + const inArgs = [acirVec, recursive].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = await this.wasm.callWasmExport( 'acir_write_vk_ultra_honk', @@ -904,8 +921,12 @@ export class BarretenbergApiSync { return; } - acirGetCircuitSizes(constraintSystemBuf: Uint8Array, honkRecursion: boolean): [number, number, number] { - const inArgs = [constraintSystemBuf, honkRecursion].map(serializeBufferable); + acirGetCircuitSizes( + constraintSystemBuf: Uint8Array, + recursive: boolean, + honkRecursion: boolean, + ): [number, number, number] { + const inArgs = [constraintSystemBuf, recursive, honkRecursion].map(serializeBufferable); const outTypes: OutputType[] = [NumberDeserializer(), NumberDeserializer()]; const result = this.wasm.callWasmExport( 'acir_get_circuit_sizes', @@ -940,8 +961,8 @@ export class BarretenbergApiSync { return; } - acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array): void { - const inArgs = [acirComposerPtr, constraintSystemBuf].map(serializeBufferable); + acirInitProvingKey(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, recursive: boolean): void { + const inArgs = [acirComposerPtr, constraintSystemBuf, recursive].map(serializeBufferable); const outTypes: OutputType[] = []; const result = this.wasm.callWasmExport( 'acir_init_proving_key', @@ -952,8 +973,13 @@ export class BarretenbergApiSync { return; } - acirCreateProof(acirComposerPtr: Ptr, constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): Uint8Array { - const inArgs = [acirComposerPtr, constraintSystemBuf, witnessBuf].map(serializeBufferable); + acirCreateProof( + acirComposerPtr: Ptr, + constraintSystemBuf: Uint8Array, + recursive: boolean, + witnessBuf: Uint8Array, + ): Uint8Array { + const inArgs = [acirComposerPtr, constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_create_proof', @@ -964,8 +990,8 @@ export class BarretenbergApiSync { return out[0]; } - acirProveAndVerifyUltraHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): boolean { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + acirProveAndVerifyUltraHonk(constraintSystemBuf: Uint8Array, recursive: boolean, witnessBuf: Uint8Array): boolean { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = this.wasm.callWasmExport( 'acir_prove_and_verify_ultra_honk', @@ -976,8 +1002,8 @@ export class BarretenbergApiSync { return out[0]; } - acirProveAndVerifyMegaHonk(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): boolean { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + acirProveAndVerifyMegaHonk(constraintSystemBuf: Uint8Array, recursive: boolean, witnessBuf: Uint8Array): boolean { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = this.wasm.callWasmExport( 'acir_prove_and_verify_mega_honk', @@ -988,8 +1014,8 @@ export class BarretenbergApiSync { return out[0]; } - acirFoldAndVerifyProgramStack(constraintSystemBuf: Uint8Array, witnessBuf: Uint8Array): boolean { - const inArgs = [constraintSystemBuf, witnessBuf].map(serializeBufferable); + acirFoldAndVerifyProgramStack(constraintSystemBuf: Uint8Array, recursive: boolean, witnessBuf: Uint8Array): boolean { + const inArgs = [constraintSystemBuf, recursive, witnessBuf].map(serializeBufferable); const outTypes: OutputType[] = [BoolDeserializer()]; const result = this.wasm.callWasmExport( 'acir_fold_and_verify_program_stack', @@ -1036,8 +1062,8 @@ export class BarretenbergApiSync { return out[0]; } - acirGetProvingKey(acirComposerPtr: Ptr, acirVec: Uint8Array): Uint8Array { - const inArgs = [acirComposerPtr, acirVec].map(serializeBufferable); + acirGetProvingKey(acirComposerPtr: Ptr, acirVec: Uint8Array, recursive: boolean): Uint8Array { + const inArgs = [acirComposerPtr, acirVec, recursive].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_get_proving_key', @@ -1096,8 +1122,8 @@ export class BarretenbergApiSync { return out as any; } - acirProveUltraHonk(acirVec: Uint8Array, witnessVec: Uint8Array): Uint8Array { - const inArgs = [acirVec, witnessVec].map(serializeBufferable); + acirProveUltraHonk(acirVec: Uint8Array, recursive: boolean, witnessVec: Uint8Array): Uint8Array { + const inArgs = [acirVec, recursive, witnessVec].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_prove_ultra_honk', @@ -1120,8 +1146,8 @@ export class BarretenbergApiSync { return out[0]; } - acirWriteVkUltraHonk(acirVec: Uint8Array): Uint8Array { - const inArgs = [acirVec].map(serializeBufferable); + acirWriteVkUltraHonk(acirVec: Uint8Array, recursive: boolean): Uint8Array { + const inArgs = [acirVec, recursive].map(serializeBufferable); const outTypes: OutputType[] = [BufferDeserializer()]; const result = this.wasm.callWasmExport( 'acir_write_vk_ultra_honk', diff --git a/barretenberg/ts/src/main.ts b/barretenberg/ts/src/main.ts index 389f554be9e..1d3af06dd2e 100755 --- a/barretenberg/ts/src/main.ts +++ b/barretenberg/ts/src/main.ts @@ -34,8 +34,8 @@ function getBytecode(bytecodePath: string) { } // TODO(https://github.com/AztecProtocol/barretenberg/issues/1126): split this into separate Plonk and Honk functions as their gate count differs -async function getGatesUltra(bytecodePath: string, honkRecursion: boolean, api: Barretenberg) { - const { total } = await computeCircuitSize(bytecodePath, honkRecursion, api); +async function getGatesUltra(bytecodePath: string, recursive: boolean, honkRecursion: boolean, api: Barretenberg) { + const { total } = await computeCircuitSize(bytecodePath, recursive, honkRecursion, api); return total; } @@ -45,18 +45,24 @@ function getWitness(witnessPath: string) { return decompressed; } -async function computeCircuitSize(bytecodePath: string, honkRecursion: boolean, api: Barretenberg) { +async function computeCircuitSize(bytecodePath: string, recursive: boolean, honkRecursion: boolean, api: Barretenberg) { debug(`computing circuit size...`); const bytecode = getBytecode(bytecodePath); - const [total, subgroup] = await api.acirGetCircuitSizes(bytecode, honkRecursion); + const [total, subgroup] = await api.acirGetCircuitSizes(bytecode, recursive, honkRecursion); return { total, subgroup }; } -async function initUltraPlonk(bytecodePath: string, crsPath: string, subgroupSizeOverride = -1, honkRecursion = false) { +async function initUltraPlonk( + bytecodePath: string, + recursive: boolean, + crsPath: string, + subgroupSizeOverride = -1, + honkRecursion = false, +) { const api = await Barretenberg.new({ threads }); // TODO(https://github.com/AztecProtocol/barretenberg/issues/1126): use specific UltraPlonk function - const circuitSize = await getGatesUltra(bytecodePath, honkRecursion, api); + const circuitSize = await getGatesUltra(bytecodePath, recursive, honkRecursion, api); // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): remove subgroupSizeOverride hack for goblin const subgroupSize = Math.max(subgroupSizeOverride, Math.pow(2, Math.ceil(Math.log2(circuitSize)))); @@ -80,11 +86,11 @@ async function initUltraPlonk(bytecodePath: string, crsPath: string, subgroupSiz return { api, acirComposer, circuitSize, subgroupSize }; } -async function initUltraHonk(bytecodePath: string, crsPath: string) { +async function initUltraHonk(bytecodePath: string, recursive: boolean, crsPath: string) { const api = await Barretenberg.new({ threads }); // TODO(https://github.com/AztecProtocol/barretenberg/issues/1126): use specific UltraHonk function - const circuitSize = await getGatesUltra(bytecodePath, /*honkRecursion=*/ true, api); + const circuitSize = await getGatesUltra(bytecodePath, recursive, /*honkRecursion=*/ true, api); // TODO(https://github.com/AztecProtocol/barretenberg/issues/811): remove subgroupSizeOverride hack for goblin const dyadicCircuitSize = Math.pow(2, Math.ceil(Math.log2(circuitSize))); @@ -99,7 +105,7 @@ async function initUltraHonk(bytecodePath: string, crsPath: string) { return { api, circuitSize, dyadicCircuitSize }; } -async function initClientIVC(bytecodePath: string, crsPath: string) { +async function initClientIVC(bytecodePath: string, recursive: boolean, crsPath: string) { const api = await Barretenberg.new({ threads }); debug('loading BN254 and Grumpkin crs...'); @@ -126,24 +132,24 @@ async function initLite() { return { api, acirComposer }; } -export async function proveAndVerify(bytecodePath: string, witnessPath: string, crsPath: string) { +export async function proveAndVerify(bytecodePath: string, recursive: boolean, witnessPath: string, crsPath: string) { /* eslint-disable camelcase */ const acir_test = path.basename(process.cwd()); - const { api, acirComposer, circuitSize, subgroupSize } = await initUltraPlonk(bytecodePath, crsPath); + const { api, acirComposer, circuitSize, subgroupSize } = await initUltraPlonk(bytecodePath, recursive, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); const pkTimer = new Timer(); - await api.acirInitProvingKey(acirComposer, bytecode); + await api.acirInitProvingKey(acirComposer, bytecode, recursive); writeBenchmark('pk_construction_time', pkTimer.ms(), { acir_test, threads }); writeBenchmark('gate_count', circuitSize, { acir_test, threads }); writeBenchmark('subgroup_size', subgroupSize, { acir_test, threads }); const proofTimer = new Timer(); - const proof = await api.acirCreateProof(acirComposer, bytecode, witness); + const proof = await api.acirCreateProof(acirComposer, bytecode, recursive, witness); writeBenchmark('proof_construction_time', proofTimer.ms(), { acir_test, threads }); debug(`verifying...`); @@ -156,14 +162,19 @@ export async function proveAndVerify(bytecodePath: string, witnessPath: string, /* eslint-enable camelcase */ } -export async function proveAndVerifyUltraHonk(bytecodePath: string, witnessPath: string, crsPath: string) { +export async function proveAndVerifyUltraHonk( + bytecodePath: string, + recursive: boolean, + witnessPath: string, + crsPath: string, +) { /* eslint-disable camelcase */ - const { api } = await initUltraHonk(bytecodePath, crsPath); + const { api } = await initUltraHonk(bytecodePath, false, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); - const verified = await api.acirProveAndVerifyUltraHonk(bytecode, witness); + const verified = await api.acirProveAndVerifyUltraHonk(bytecode, recursive, witness); return verified; } finally { await api.destroy(); @@ -171,14 +182,19 @@ export async function proveAndVerifyUltraHonk(bytecodePath: string, witnessPath: /* eslint-enable camelcase */ } -export async function proveAndVerifyMegaHonk(bytecodePath: string, witnessPath: string, crsPath: string) { +export async function proveAndVerifyMegaHonk( + bytecodePath: string, + recursive: boolean, + witnessPath: string, + crsPath: string, +) { /* eslint-disable camelcase */ - const { api } = await initUltraPlonk(bytecodePath, crsPath); + const { api } = await initUltraPlonk(bytecodePath, false, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); - const verified = await api.acirProveAndVerifyMegaHonk(bytecode, witness); + const verified = await api.acirProveAndVerifyMegaHonk(bytecode, recursive, witness); return verified; } finally { await api.destroy(); @@ -186,14 +202,19 @@ export async function proveAndVerifyMegaHonk(bytecodePath: string, witnessPath: /* eslint-enable camelcase */ } -export async function foldAndVerifyProgram(bytecodePath: string, witnessPath: string, crsPath: string) { +export async function foldAndVerifyProgram( + bytecodePath: string, + recursive: boolean, + witnessPath: string, + crsPath: string, +) { /* eslint-disable camelcase */ - const { api } = await initClientIVC(bytecodePath, crsPath); + const { api } = await initClientIVC(bytecodePath, recursive, crsPath); try { const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); - const verified = await api.acirFoldAndVerifyProgramStack(bytecode, witness); + const verified = await api.acirFoldAndVerifyProgramStack(bytecode, recursive, witness); debug(`verified: ${verified}`); return verified; } finally { @@ -202,13 +223,19 @@ export async function foldAndVerifyProgram(bytecodePath: string, witnessPath: st /* eslint-enable camelcase */ } -export async function prove(bytecodePath: string, witnessPath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); +export async function prove( + bytecodePath: string, + recursive: boolean, + witnessPath: string, + crsPath: string, + outputPath: string, +) { + const { api, acirComposer } = await initUltraPlonk(bytecodePath, recursive, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); - const proof = await api.acirCreateProof(acirComposer, bytecode, witness); + const proof = await api.acirCreateProof(acirComposer, bytecode, recursive, witness); debug(`done.`); if (outputPath === '-') { @@ -223,10 +250,10 @@ export async function prove(bytecodePath: string, witnessPath: string, crsPath: } } -export async function gateCountUltra(bytecodePath: string, honkRecursion: boolean) { +export async function gateCountUltra(bytecodePath: string, recursive: boolean, honkRecursion: boolean) { const api = await Barretenberg.new({ threads: 1 }); try { - const numberOfGates = await getGatesUltra(bytecodePath, honkRecursion, api); + const numberOfGates = await getGatesUltra(bytecodePath, recursive, honkRecursion, api); debug(`number of gates: : ${numberOfGates}`); // Create an 8-byte buffer and write the number into it. // Writing number directly to stdout will result in a variable sized @@ -270,12 +297,12 @@ export async function contract(outputPath: string, vkPath: string) { } } -export async function writeVk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); +export async function writeVk(bytecodePath: string, recursive: boolean, crsPath: string, outputPath: string) { + const { api, acirComposer } = await initUltraPlonk(bytecodePath, recursive, crsPath); try { debug('initing proving key...'); const bytecode = getBytecode(bytecodePath); - await api.acirInitProvingKey(acirComposer, bytecode); + await api.acirInitProvingKey(acirComposer, bytecode, recursive); debug('initing verification key...'); const vk = await api.acirGetVerificationKey(acirComposer); @@ -292,12 +319,12 @@ export async function writeVk(bytecodePath: string, crsPath: string, outputPath: } } -export async function writePk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api, acirComposer } = await initUltraPlonk(bytecodePath, crsPath); +export async function writePk(bytecodePath: string, recursive: boolean, crsPath: string, outputPath: string) { + const { api, acirComposer } = await initUltraPlonk(bytecodePath, recursive, crsPath); try { debug('initing proving key...'); const bytecode = getBytecode(bytecodePath); - const pk = await api.acirGetProvingKey(acirComposer, bytecode); + const pk = await api.acirGetProvingKey(acirComposer, bytecode, recursive); if (outputPath === '-') { process.stdout.write(pk); @@ -362,13 +389,19 @@ export async function vkAsFields(vkPath: string, vkeyOutputPath: string) { } } -export async function proveUltraHonk(bytecodePath: string, witnessPath: string, crsPath: string, outputPath: string) { - const { api } = await initUltraHonk(bytecodePath, crsPath); +export async function proveUltraHonk( + bytecodePath: string, + recursive: boolean, + witnessPath: string, + crsPath: string, + outputPath: string, +) { + const { api } = await initUltraHonk(bytecodePath, recursive, crsPath); try { debug(`creating proof...`); const bytecode = getBytecode(bytecodePath); const witness = getWitness(witnessPath); - const proof = await api.acirProveUltraHonk(bytecode, witness); + const proof = await api.acirProveUltraHonk(bytecode, recursive, witness); debug(`done.`); if (outputPath === '-') { @@ -383,12 +416,12 @@ export async function proveUltraHonk(bytecodePath: string, witnessPath: string, } } -export async function writeVkUltraHonk(bytecodePath: string, crsPath: string, outputPath: string) { - const { api } = await initUltraHonk(bytecodePath, crsPath); +export async function writeVkUltraHonk(bytecodePath: string, recursive: boolean, crsPath: string, outputPath: string) { + const { api } = await initUltraHonk(bytecodePath, recursive, crsPath); try { const bytecode = getBytecode(bytecodePath); debug('initing verification key...'); - const vk = await api.acirWriteVkUltraHonk(bytecode); + const vk = await api.acirWriteVkUltraHonk(bytecode, recursive); if (outputPath === '-') { process.stdout.write(vk); @@ -471,10 +504,11 @@ program .command('prove_and_verify') .description('Generate a proof and verify it. Process exits with success or failure code.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Whether to use a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') - .action(async ({ bytecodePath, witnessPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, crsPath }) => { handleGlobalOptions(); - const result = await proveAndVerify(bytecodePath, witnessPath, crsPath); + const result = await proveAndVerify(bytecodePath, recursive, witnessPath, crsPath); process.exit(result ? 0 : 1); }); @@ -482,10 +516,11 @@ program .command('prove_and_verify_ultra_honk') .description('Generate an UltraHonk proof and verify it. Process exits with success or failure code.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Whether to use a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') - .action(async ({ bytecodePath, witnessPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, crsPath }) => { handleGlobalOptions(); - const result = await proveAndVerifyUltraHonk(bytecodePath, witnessPath, crsPath); + const result = await proveAndVerifyUltraHonk(bytecodePath, recursive, witnessPath, crsPath); process.exit(result ? 0 : 1); }); @@ -493,10 +528,11 @@ program .command('prove_and_verify_mega_honk') .description('Generate a MegaHonk proof and verify it. Process exits with success or failure code.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Whether to use a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') - .action(async ({ bytecodePath, witnessPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, crsPath }) => { handleGlobalOptions(); - const result = await proveAndVerifyMegaHonk(bytecodePath, witnessPath, crsPath); + const result = await proveAndVerifyMegaHonk(bytecodePath, recursive, witnessPath, crsPath); process.exit(result ? 0 : 1); }); @@ -504,10 +540,11 @@ program .command('fold_and_verify_program') .description('Accumulate a set of circuits using ClientIvc then verify. Process exits with success or failure code.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') - .action(async ({ bytecodePath, witnessPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, crsPath }) => { handleGlobalOptions(); - const result = await foldAndVerifyProgram(bytecodePath, witnessPath, crsPath); + const result = await foldAndVerifyProgram(bytecodePath, recursive, witnessPath, crsPath); process.exit(result ? 0 : 1); }); @@ -515,21 +552,23 @@ program .command('prove') .description('Generate a proof and write it to a file.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') .option('-o, --output-path ', 'Specify the proof output path', './proofs/proof') - .action(async ({ bytecodePath, witnessPath, outputPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, outputPath, crsPath }) => { handleGlobalOptions(); - await prove(bytecodePath, witnessPath, crsPath, outputPath); + await prove(bytecodePath, recursive, witnessPath, crsPath, outputPath); }); program .command('gates') .description('Print Ultra Builder gate count to standard output.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .option('-hr, --honk-recursion', 'Specify whether to use UltraHonk recursion', false) - .action(async ({ bytecodePath: bytecodePath, honkRecursion: honkRecursion }) => { + .action(async ({ bytecodePath, recursive, honkRecursion: honkRecursion }) => { handleGlobalOptions(); - await gateCountUltra(bytecodePath, honkRecursion); + await gateCountUltra(bytecodePath, recursive, honkRecursion); }); program @@ -558,20 +597,22 @@ program .command('write_vk') .description('Output verification key.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .option('-o, --output-path ', 'Specify the path to write the key') - .action(async ({ bytecodePath, outputPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, outputPath, crsPath }) => { handleGlobalOptions(); - await writeVk(bytecodePath, crsPath, outputPath); + await writeVk(bytecodePath, recursive, crsPath, outputPath); }); program .command('write_pk') .description('Output proving key.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .requiredOption('-o, --output-path ', 'Specify the path to write the key') - .action(async ({ bytecodePath, outputPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, outputPath, crsPath }) => { handleGlobalOptions(); - await writePk(bytecodePath, crsPath, outputPath); + await writePk(bytecodePath, recursive, crsPath, outputPath); }); program @@ -599,21 +640,23 @@ program .command('prove_ultra_honk') .description('Generate a proof and write it to a file.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .option('-w, --witness-path ', 'Specify the witness path', './target/witness.gz') .option('-o, --output-path ', 'Specify the proof output path', './proofs/proof') - .action(async ({ bytecodePath, witnessPath, outputPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, witnessPath, outputPath, crsPath }) => { handleGlobalOptions(); - await proveUltraHonk(bytecodePath, witnessPath, crsPath, outputPath); + await proveUltraHonk(bytecodePath, recursive, witnessPath, crsPath, outputPath); }); program .command('write_vk_ultra_honk') .description('Output verification key.') .option('-b, --bytecode-path ', 'Specify the bytecode path', './target/program.json') + .option('-r, --recursive', 'Create a SNARK friendly proof', false) .requiredOption('-o, --output-path ', 'Specify the path to write the key') - .action(async ({ bytecodePath, outputPath, crsPath }) => { + .action(async ({ bytecodePath, recursive, outputPath, crsPath }) => { handleGlobalOptions(); - await writeVkUltraHonk(bytecodePath, crsPath, outputPath); + await writeVkUltraHonk(bytecodePath, recursive, crsPath, outputPath); }); program diff --git a/noir-projects/aztec-nr/aztec/src/macros/functions/mod.nr b/noir-projects/aztec-nr/aztec/src/macros/functions/mod.nr index bc74d225c19..ed363f2c807 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/functions/mod.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/functions/mod.nr @@ -213,7 +213,6 @@ pub comptime fn private(f: FunctionDefinition) -> Quoted { }; let modified_body = modify_fn_body(body, to_prepend, to_append); f.set_body(modified_body); - f.add_attribute("recursive"); f.set_return_type( quote { dep::protocol_types::abis::private_circuit_public_inputs::PrivateCircuitPublicInputs } .as_type(), diff --git a/noir-projects/noir-protocol-circuits/crates/empty-nested/src/main.nr b/noir-projects/noir-protocol-circuits/crates/empty-nested/src/main.nr index 2bd1dda122b..6f594ac47c1 100644 --- a/noir-projects/noir-protocol-circuits/crates/empty-nested/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/empty-nested/src/main.nr @@ -1,6 +1,5 @@ struct Empty {} -#[recursive] fn main(_inputs: Empty) -> pub Empty { assert(true); Empty {} diff --git a/noir-projects/noir-protocol-circuits/crates/parity-base/src/main.nr b/noir-projects/noir-protocol-circuits/crates/parity-base/src/main.nr index 8dbc300f0f3..8fea34b8cf8 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-base/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-base/src/main.nr @@ -1,6 +1,5 @@ use dep::parity_lib::{BaseParityInputs, ParityPublicInputs}; -#[recursive] fn main(inputs: BaseParityInputs) -> pub ParityPublicInputs { inputs.base_parity_circuit() } diff --git a/noir-projects/noir-protocol-circuits/crates/parity-root/src/main.nr b/noir-projects/noir-protocol-circuits/crates/parity-root/src/main.nr index 05850ad6169..abb7584bc6f 100644 --- a/noir-projects/noir-protocol-circuits/crates/parity-root/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/parity-root/src/main.nr @@ -1,6 +1,5 @@ use dep::parity_lib::{ParityPublicInputs, RootParityInputs}; -#[recursive] fn main(inputs: RootParityInputs) -> pub ParityPublicInputs { inputs.root_parity_circuit() } diff --git a/noir-projects/noir-protocol-circuits/crates/private-kernel-empty/src/main.nr b/noir-projects/noir-protocol-circuits/crates/private-kernel-empty/src/main.nr index dbee20b81c0..1eeeb229b1b 100644 --- a/noir-projects/noir-protocol-circuits/crates/private-kernel-empty/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/private-kernel-empty/src/main.nr @@ -1,7 +1,6 @@ use dep::private_kernel_lib::PrivateKernelEmptyPrivateInputs; use dep::types::KernelCircuitPublicInputs; -#[recursive] fn main(input: PrivateKernelEmptyPrivateInputs) -> pub KernelCircuitPublicInputs { input.execute() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-private-simulated/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-base-private-simulated/src/main.nr index e2093b6e0c9..69331eba551 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-private-simulated/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-private-simulated/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::base::{BaseOrMergeRollupPublicInputs, PrivateBaseRollupInputs}; -#[recursive] unconstrained fn main(inputs: PrivateBaseRollupInputs) -> pub BaseOrMergeRollupPublicInputs { inputs.execute() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-private/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-base-private/src/main.nr index c6dea8ed5bc..839f5b0e6fa 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-private/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-private/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::base::{BaseOrMergeRollupPublicInputs, PrivateBaseRollupInputs}; -#[recursive] fn main(inputs: PrivateBaseRollupInputs) -> pub BaseOrMergeRollupPublicInputs { inputs.execute() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-public-simulated/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-base-public-simulated/src/main.nr index 57a1b92ab02..3d93aa20d0e 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-public-simulated/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-public-simulated/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::base::{BaseOrMergeRollupPublicInputs, PublicBaseRollupInputs}; -#[recursive] unconstrained fn main(inputs: PublicBaseRollupInputs) -> pub BaseOrMergeRollupPublicInputs { inputs.execute() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-base-public/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-base-public/src/main.nr index 30aad3b7daf..e1e2618162a 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-base-public/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-base-public/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::base::{BaseOrMergeRollupPublicInputs, PublicBaseRollupInputs}; -#[recursive] fn main(inputs: PublicBaseRollupInputs) -> pub BaseOrMergeRollupPublicInputs { inputs.execute() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-block-root-empty/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-block-root-empty/src/main.nr index 459ebf947e1..e1dcc617997 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-block-root-empty/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-block-root-empty/src/main.nr @@ -1,6 +1,5 @@ use rollup_lib::block_root::{BlockRootOrBlockMergePublicInputs, EmptyBlockRootRollupInputs}; -#[recursive] fn main(inputs: EmptyBlockRootRollupInputs) -> pub BlockRootOrBlockMergePublicInputs { inputs.empty_block_root_rollup_circuit() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-block-root/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-block-root/src/main.nr index 33bcb5c457e..cb8caaea834 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-block-root/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-block-root/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::block_root::{BlockRootOrBlockMergePublicInputs, BlockRootRollupInputs}; -#[recursive] fn main(inputs: BlockRootRollupInputs) -> pub BlockRootOrBlockMergePublicInputs { inputs.block_root_rollup_circuit() } diff --git a/noir-projects/noir-protocol-circuits/crates/rollup-merge/src/main.nr b/noir-projects/noir-protocol-circuits/crates/rollup-merge/src/main.nr index 108aadfa738..3b3883d6b84 100644 --- a/noir-projects/noir-protocol-circuits/crates/rollup-merge/src/main.nr +++ b/noir-projects/noir-protocol-circuits/crates/rollup-merge/src/main.nr @@ -1,6 +1,5 @@ use dep::rollup_lib::merge::{BaseOrMergeRollupPublicInputs, MergeRollupInputs}; -#[recursive] fn main(inputs: MergeRollupInputs) -> pub BaseOrMergeRollupPublicInputs { inputs.merge_rollup_circuit() } diff --git a/noir-projects/scripts/generate_vk_json.js b/noir-projects/scripts/generate_vk_json.js index f0538f6bf2d..47aebef30d7 100644 --- a/noir-projects/scripts/generate_vk_json.js +++ b/noir-projects/scripts/generate_vk_json.js @@ -82,16 +82,26 @@ function getBarretenbergHash() { }); } -function generateArtifactHash(barretenbergHash, bytecodeHash, isMegaHonk) { +function generateArtifactHash( + barretenbergHash, + bytecodeHash, + isMegaHonk, + isRecursive +) { return `${barretenbergHash}-${bytecodeHash}-${ isMegaHonk ? "mega-honk" : "ultra-honk" - }`; + }-${isRecursive}`; } -async function getArtifactHash(artifactPath, isMegaHonk) { +async function getArtifactHash(artifactPath, isMegaHonk, isRecursive) { const bytecodeHash = await getBytecodeHash(artifactPath); const barretenbergHash = await getBarretenbergHash(); - return generateArtifactHash(barretenbergHash, bytecodeHash, isMegaHonk); + return generateArtifactHash( + barretenbergHash, + bytecodeHash, + isMegaHonk, + isRecursive + ); } async function hasArtifactHashChanged(artifactHash, vkDataPath) { @@ -125,8 +135,13 @@ async function processArtifact( syncWithS3 ) { const isMegaHonk = isMegaHonkCircuit(artifactName); + const isRecursive = true; - const artifactHash = await getArtifactHash(artifactPath, isMegaHonk); + const artifactHash = await getArtifactHash( + artifactPath, + isMegaHonk, + isRecursive + ); const vkDataPath = vkDataFileNameForArtifactName(outputFolder, artifactName); @@ -145,7 +160,8 @@ async function processArtifact( outputFolder, artifactPath, artifactHash, - isMegaHonk + isMegaHonk, + isRecursive ); if (syncWithS3) { await writeVKToS3(artifactName, artifactHash, JSON.stringify(vkData)); @@ -162,7 +178,8 @@ async function generateVKData( outputFolder, artifactPath, artifactHash, - isMegaHonk + isMegaHonk, + isRecursive ) { if (isMegaHonk) { console.log("Generating new mega honk vk for", artifactName); @@ -178,7 +195,12 @@ async function generateVKData( const writeVkCommand = `${BB_BIN_PATH} ${ isMegaHonk ? "write_vk_mega_honk" : "write_vk_ultra_honk" - } -h -b "${artifactPath}" -o "${binaryVkPath}"`; + } -h -b "${artifactPath}" -o "${binaryVkPath}" ${ + isRecursive ? "--recursive" : "" + }`; + + console.log("WRITE VK CMD: ", writeVkCommand); + const vkAsFieldsCommand = `${BB_BIN_PATH} ${ isMegaHonk ? "vk_as_fields_mega_honk" : "vk_as_fields_ultra_honk" } -k "${binaryVkPath}" -o "${jsonVkPath}"`; diff --git a/noir/noir-repo/acvm-repo/acir/benches/serialization.rs b/noir/noir-repo/acvm-repo/acir/benches/serialization.rs index 792200c8912..dd6a5c8b1cf 100644 --- a/noir/noir-repo/acvm-repo/acir/benches/serialization.rs +++ b/noir/noir-repo/acvm-repo/acir/benches/serialization.rs @@ -38,7 +38,6 @@ fn sample_program(num_opcodes: usize) -> Program { public_parameters: PublicInputs(BTreeSet::from([Witness(5)])), return_values: PublicInputs(BTreeSet::from([Witness(6)])), assert_messages: Vec::new(), - recursive: false, }], unconstrained_functions: Vec::new(), } diff --git a/noir/noir-repo/acvm-repo/acir/codegen/acir.cpp b/noir/noir-repo/acvm-repo/acir/codegen/acir.cpp index 0880b5a0cbe..96d029a8f41 100644 --- a/noir/noir-repo/acvm-repo/acir/codegen/acir.cpp +++ b/noir/noir-repo/acvm-repo/acir/codegen/acir.cpp @@ -1305,7 +1305,6 @@ namespace Program { Program::PublicInputs public_parameters; Program::PublicInputs return_values; std::vector> assert_messages; - bool recursive; friend bool operator==(const Circuit&, const Circuit&); std::vector bincodeSerialize() const; @@ -5589,7 +5588,6 @@ namespace Program { if (!(lhs.public_parameters == rhs.public_parameters)) { return false; } if (!(lhs.return_values == rhs.return_values)) { return false; } if (!(lhs.assert_messages == rhs.assert_messages)) { return false; } - if (!(lhs.recursive == rhs.recursive)) { return false; } return true; } @@ -5621,7 +5619,6 @@ void serde::Serializable::serialize(const Program::Circuit &ob serde::Serializable::serialize(obj.public_parameters, serializer); serde::Serializable::serialize(obj.return_values, serializer); serde::Serializable::serialize(obj.assert_messages, serializer); - serde::Serializable::serialize(obj.recursive, serializer); serializer.decrease_container_depth(); } @@ -5637,7 +5634,6 @@ Program::Circuit serde::Deserializable::deserialize(Deserializ obj.public_parameters = serde::Deserializable::deserialize(deserializer); obj.return_values = serde::Deserializable::deserialize(deserializer); obj.assert_messages = serde::Deserializable::deserialize(deserializer); - obj.recursive = serde::Deserializable::deserialize(deserializer); deserializer.decrease_container_depth(); return obj; } diff --git a/noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs b/noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs index f700fefe0cd..eddf61be100 100644 --- a/noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs +++ b/noir/noir-repo/acvm-repo/acir/src/circuit/mod.rs @@ -68,11 +68,6 @@ pub struct Circuit { // c++ code at the moment when it is, due to OpcodeLocation needing a comparison // implementation which is never generated. pub assert_messages: Vec<(OpcodeLocation, AssertionPayload)>, - - /// States whether the backend should use a SNARK recursion friendly prover. - /// If implemented by a backend, this means that proofs generated with this circuit - /// will be friendly for recursively verifying inside of another SNARK. - pub recursive: bool, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -445,7 +440,6 @@ mod tests { public_parameters: PublicInputs(BTreeSet::from_iter(vec![Witness(2), Witness(12)])), return_values: PublicInputs(BTreeSet::from_iter(vec![Witness(4), Witness(12)])), assert_messages: Default::default(), - recursive: false, }; let program = Program { functions: vec![circuit], unconstrained_functions: Vec::new() }; @@ -481,7 +475,6 @@ mod tests { public_parameters: PublicInputs(BTreeSet::from_iter(vec![Witness(2)])), return_values: PublicInputs(BTreeSet::from_iter(vec![Witness(2)])), assert_messages: Default::default(), - recursive: false, }; let program = Program { functions: vec![circuit], unconstrained_functions: Vec::new() }; diff --git a/noir/noir-repo/acvm-repo/acir/tests/test_program_serialization.rs b/noir/noir-repo/acvm-repo/acir/tests/test_program_serialization.rs index a915cb95d07..9ab153b9f61 100644 --- a/noir/noir-repo/acvm-repo/acir/tests/test_program_serialization.rs +++ b/noir/noir-repo/acvm-repo/acir/tests/test_program_serialization.rs @@ -47,11 +47,11 @@ fn addition_circuit() { let expected_serialization: Vec = vec![ 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 144, 65, 14, 128, 32, 12, 4, 65, 124, 80, 75, 91, - 104, 111, 126, 69, 34, 252, 255, 9, 106, 228, 64, 162, 55, 153, 164, 217, 158, 38, 155, - 245, 238, 97, 189, 206, 187, 55, 161, 231, 214, 19, 254, 129, 126, 162, 107, 25, 92, 4, - 137, 185, 230, 88, 145, 112, 135, 104, 69, 5, 88, 74, 82, 84, 20, 149, 35, 42, 81, 85, 214, - 108, 197, 50, 24, 50, 85, 108, 98, 212, 186, 44, 204, 235, 5, 183, 99, 233, 46, 63, 252, - 110, 216, 56, 184, 15, 78, 146, 74, 173, 20, 141, 1, 0, 0, + 104, 111, 126, 69, 34, 252, 255, 9, 106, 228, 64, 194, 81, 38, 105, 182, 167, 201, 102, + 189, 251, 216, 159, 243, 110, 38, 244, 60, 122, 194, 63, 208, 47, 116, 109, 131, 139, 32, + 49, 215, 28, 43, 18, 158, 16, 173, 168, 0, 75, 73, 138, 138, 162, 114, 69, 37, 170, 202, + 154, 173, 88, 6, 67, 166, 138, 77, 140, 90, 151, 133, 117, 189, 224, 117, 108, 221, 229, + 135, 223, 13, 27, 135, 121, 106, 119, 3, 58, 173, 124, 163, 140, 1, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -91,10 +91,10 @@ fn multi_scalar_mul_circuit() { let bytes = Program::serialize_program(&program); let expected_serialization: Vec = vec![ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 77, 9, 14, 0, 32, 8, 202, 171, 227, 255, 255, 109, - 217, 162, 141, 114, 99, 2, 162, 74, 57, 53, 18, 2, 46, 208, 70, 122, 99, 162, 43, 113, 35, - 239, 102, 157, 230, 1, 94, 19, 45, 209, 145, 11, 202, 43, 238, 56, 249, 133, 254, 255, 187, - 79, 45, 204, 84, 220, 246, 193, 0, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 77, 9, 10, 0, 32, 8, 243, 236, 248, 255, 127, 35, + 163, 5, 35, 97, 184, 205, 169, 42, 183, 102, 65, 193, 21, 218, 73, 31, 44, 116, 35, 238, + 228, 189, 108, 208, 60, 193, 91, 161, 23, 6, 114, 73, 121, 195, 157, 32, 95, 232, 255, 191, + 203, 181, 1, 243, 231, 24, 106, 192, 0, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -134,24 +134,24 @@ fn schnorr_verify_circuit() { let bytes = Program::serialize_program(&program); let expected_serialization: Vec = vec![ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 85, 211, 103, 78, 2, 81, 24, 70, 225, 193, 130, 96, 239, - 189, 96, 239, 189, 35, 34, 34, 34, 34, 238, 130, 253, 47, 129, 192, 9, 223, 36, 7, 146, - 201, 60, 209, 31, 144, 123, 207, 155, 73, 250, 159, 118, 239, 201, 132, 121, 103, 227, 205, - 211, 137, 247, 144, 60, 220, 123, 114, 225, 17, 121, 84, 206, 202, 99, 114, 78, 206, 203, - 227, 242, 132, 60, 41, 79, 201, 211, 242, 140, 60, 43, 207, 201, 243, 242, 130, 188, 40, - 47, 201, 203, 242, 138, 188, 42, 175, 201, 235, 242, 134, 188, 41, 111, 201, 219, 242, 142, - 92, 144, 119, 229, 61, 121, 95, 62, 144, 15, 229, 35, 249, 88, 62, 145, 79, 229, 51, 249, - 92, 190, 144, 47, 229, 43, 249, 90, 190, 145, 111, 229, 59, 249, 94, 126, 144, 31, 229, 39, - 249, 89, 126, 145, 95, 229, 162, 252, 38, 151, 228, 119, 185, 44, 127, 200, 21, 249, 83, - 174, 134, 233, 52, 137, 191, 125, 233, 255, 53, 249, 91, 174, 203, 63, 114, 67, 254, 149, - 155, 242, 159, 220, 10, 255, 199, 247, 183, 244, 59, 216, 38, 155, 100, 139, 108, 144, 237, - 165, 155, 203, 199, 111, 102, 83, 108, 137, 13, 177, 29, 54, 195, 86, 216, 8, 219, 96, 19, - 108, 129, 13, 208, 62, 205, 211, 58, 141, 211, 54, 77, 211, 50, 13, 211, 46, 205, 22, 146, - 126, 163, 180, 73, 147, 180, 72, 131, 180, 71, 115, 180, 70, 99, 180, 69, 83, 180, 68, 67, - 180, 67, 51, 180, 66, 35, 180, 65, 19, 180, 64, 3, 220, 61, 119, 206, 93, 115, 199, 197, - 184, 211, 82, 220, 97, 57, 238, 172, 18, 119, 84, 141, 187, 168, 197, 217, 215, 227, 172, - 27, 113, 182, 205, 56, 203, 244, 204, 210, 115, 75, 116, 158, 3, 159, 46, 43, 32, 188, 53, - 25, 5, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 211, 103, 78, 2, 81, 24, 70, 225, 193, 130, 96, 239, + 189, 96, 239, 189, 35, 34, 34, 34, 82, 118, 193, 254, 151, 64, 224, 132, 111, 146, 67, 50, + 153, 39, 250, 3, 114, 239, 121, 51, 201, 240, 211, 29, 60, 153, 48, 239, 108, 188, 121, + 122, 241, 30, 145, 71, 7, 79, 46, 60, 38, 143, 203, 89, 121, 66, 206, 201, 121, 121, 82, + 158, 146, 167, 229, 25, 121, 86, 158, 147, 231, 229, 5, 121, 81, 94, 146, 151, 229, 21, + 121, 85, 94, 147, 215, 229, 13, 121, 83, 222, 146, 183, 229, 29, 121, 87, 222, 147, 11, + 242, 190, 124, 32, 31, 202, 71, 242, 177, 124, 34, 159, 202, 103, 242, 185, 124, 33, 95, + 202, 87, 242, 181, 124, 35, 223, 202, 119, 242, 189, 252, 32, 63, 202, 79, 242, 179, 252, + 34, 191, 202, 111, 242, 187, 92, 148, 63, 228, 146, 252, 41, 151, 229, 47, 185, 34, 127, + 203, 213, 48, 157, 38, 241, 183, 31, 253, 191, 38, 255, 202, 117, 249, 79, 110, 200, 255, + 114, 83, 110, 201, 237, 112, 39, 190, 191, 173, 223, 193, 54, 217, 36, 91, 100, 131, 108, + 47, 221, 92, 62, 126, 51, 155, 98, 75, 108, 136, 237, 176, 25, 182, 194, 70, 216, 6, 155, + 96, 11, 108, 128, 246, 105, 158, 214, 105, 156, 182, 105, 154, 150, 105, 152, 118, 105, + 182, 144, 12, 27, 165, 77, 154, 164, 69, 26, 164, 61, 154, 163, 53, 26, 163, 45, 154, 162, + 37, 26, 162, 29, 154, 161, 21, 26, 161, 13, 154, 160, 5, 26, 224, 238, 185, 115, 238, 154, + 59, 46, 198, 157, 150, 226, 14, 203, 113, 103, 149, 184, 163, 106, 220, 69, 45, 206, 190, + 30, 103, 221, 136, 179, 109, 198, 89, 166, 103, 150, 158, 91, 162, 243, 244, 167, 15, 14, + 161, 226, 6, 24, 5, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -214,12 +214,12 @@ fn simple_brillig_foreign_call() { let bytes = Program::serialize_program(&program); let expected_serialization: Vec = vec![ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 79, 73, 10, 128, 48, 12, 204, 40, 46, 5, 111, 126, - 36, 254, 192, 207, 120, 240, 226, 65, 196, 247, 91, 48, 129, 80, 218, 122, 48, 3, 33, 147, - 9, 89, 6, 244, 98, 140, 1, 225, 157, 100, 173, 45, 84, 91, 37, 243, 63, 44, 240, 219, 197, - 246, 223, 38, 37, 176, 34, 85, 156, 169, 251, 144, 233, 183, 142, 206, 67, 114, 215, 121, - 63, 15, 84, 135, 222, 157, 98, 244, 194, 247, 227, 222, 206, 11, 31, 19, 165, 186, 164, - 207, 153, 222, 3, 91, 101, 84, 220, 120, 2, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 79, 73, 10, 128, 48, 12, 236, 40, 46, 5, 111, 126, + 36, 254, 192, 207, 120, 240, 226, 65, 196, 247, 91, 48, 129, 80, 186, 28, 154, 129, 144, + 201, 132, 44, 3, 247, 99, 14, 1, 230, 3, 103, 169, 53, 68, 219, 57, 83, 27, 54, 216, 237, + 34, 253, 111, 23, 19, 104, 177, 96, 76, 204, 251, 68, 191, 55, 52, 238, 163, 187, 198, 251, + 105, 114, 101, 200, 221, 37, 196, 200, 252, 188, 222, 227, 126, 80, 153, 200, 213, 57, 125, + 77, 244, 62, 112, 171, 6, 33, 119, 2, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -344,17 +344,17 @@ fn complex_brillig_foreign_call() { let bytes = Program::serialize_program(&program); let expected_serialization: Vec = vec![ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 85, 93, 10, 194, 48, 12, 78, 155, 233, 54, 240, - 205, 11, 8, 122, 128, 76, 47, 176, 187, 136, 111, 138, 62, 122, 124, 45, 75, 88, 23, 139, - 19, 76, 64, 63, 24, 89, 75, 242, 229, 159, 6, 24, 208, 60, 191, 192, 255, 11, 150, 145, - 101, 186, 71, 152, 66, 116, 123, 150, 244, 29, 186, 96, 199, 69, 94, 49, 198, 63, 136, 17, - 29, 98, 132, 172, 255, 63, 216, 111, 203, 190, 152, 214, 15, 11, 251, 83, 193, 176, 95, 75, - 62, 215, 44, 27, 93, 232, 100, 20, 225, 117, 241, 38, 144, 233, 105, 149, 4, 229, 185, 183, - 201, 232, 208, 42, 191, 198, 252, 36, 213, 216, 192, 103, 249, 250, 228, 185, 39, 225, 71, - 23, 126, 234, 132, 191, 114, 234, 83, 173, 234, 149, 231, 146, 251, 93, 193, 56, 129, 199, - 235, 229, 118, 62, 221, 177, 96, 170, 205, 19, 182, 234, 188, 43, 148, 108, 142, 67, 144, - 63, 52, 239, 244, 67, 65, 127, 206, 102, 13, 227, 56, 201, 195, 246, 0, 155, 0, 46, 128, - 245, 6, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 85, 93, 10, 194, 48, 12, 78, 219, 233, 54, 240, + 205, 11, 8, 122, 128, 76, 47, 176, 187, 136, 111, 138, 62, 122, 124, 45, 75, 88, 140, 197, + 9, 38, 224, 62, 24, 89, 75, 242, 229, 159, 6, 24, 208, 60, 191, 64, 255, 11, 146, 145, 100, + 190, 79, 240, 10, 214, 237, 73, 226, 111, 232, 130, 29, 23, 122, 197, 24, 103, 16, 99, 114, + 136, 17, 68, 255, 255, 176, 223, 150, 125, 49, 173, 95, 42, 236, 79, 5, 195, 126, 45, 233, + 92, 147, 108, 116, 161, 179, 81, 132, 247, 197, 147, 224, 225, 105, 149, 4, 229, 184, 183, + 73, 232, 208, 42, 191, 198, 252, 200, 197, 216, 192, 119, 249, 250, 228, 185, 71, 230, 79, + 46, 252, 216, 49, 127, 229, 212, 167, 90, 213, 75, 230, 34, 253, 174, 96, 28, 192, 227, + 245, 114, 59, 159, 238, 169, 96, 170, 205, 51, 182, 234, 188, 43, 148, 108, 138, 131, 33, + 223, 153, 79, 250, 161, 160, 63, 101, 179, 134, 113, 156, 248, 93, 123, 0, 142, 67, 44, + 107, 244, 6, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -393,10 +393,10 @@ fn memory_op_circuit() { let expected_serialization: Vec = vec![ 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 82, 65, 10, 0, 32, 8, 211, 180, 255, 216, 15, 250, - 255, 171, 10, 82, 176, 232, 150, 30, 26, 200, 118, 144, 49, 135, 8, 11, 117, 14, 169, 102, - 229, 162, 140, 78, 219, 206, 137, 174, 44, 111, 104, 217, 190, 24, 236, 75, 113, 94, 146, - 93, 174, 252, 86, 46, 71, 223, 78, 46, 104, 129, 253, 155, 45, 60, 195, 5, 3, 89, 11, 161, - 73, 39, 3, 0, 0, + 255, 171, 10, 82, 176, 58, 166, 135, 6, 178, 29, 100, 204, 33, 194, 66, 157, 67, 170, 89, + 185, 40, 163, 211, 182, 115, 162, 43, 203, 27, 90, 182, 47, 6, 251, 82, 156, 151, 100, 151, + 43, 191, 149, 203, 209, 183, 147, 11, 90, 96, 255, 102, 11, 207, 112, 99, 0, 192, 100, 38, + 199, 38, 3, 0, 0, ]; assert_eq!(bytes, expected_serialization) @@ -495,15 +495,15 @@ fn nested_acir_call_circuit() { let bytes = Program::serialize_program(&program); let expected_serialization: Vec = vec![ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 205, 146, 97, 10, 195, 32, 12, 133, 163, 66, 207, 147, - 24, 173, 241, 223, 174, 50, 153, 189, 255, 17, 214, 177, 148, 57, 17, 250, 99, 14, 250, - 224, 97, 144, 16, 146, 143, 231, 224, 45, 167, 126, 105, 217, 109, 118, 91, 248, 200, 168, - 225, 248, 63, 107, 114, 208, 233, 104, 188, 233, 139, 191, 137, 108, 51, 139, 113, 13, 161, - 38, 95, 137, 233, 142, 62, 23, 137, 24, 98, 89, 133, 132, 162, 196, 135, 23, 230, 42, 65, - 82, 46, 57, 97, 166, 192, 149, 182, 152, 121, 211, 97, 110, 222, 94, 8, 13, 132, 182, 54, - 48, 144, 235, 8, 254, 11, 22, 76, 132, 101, 231, 237, 229, 23, 189, 213, 54, 119, 15, 83, - 212, 199, 172, 175, 191, 226, 102, 96, 140, 251, 202, 84, 13, 204, 141, 224, 25, 176, 161, - 158, 53, 121, 144, 73, 14, 4, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 146, 81, 10, 195, 48, 8, 134, 77, 132, 158, 71, 99, + 210, 152, 183, 93, 101, 97, 233, 253, 143, 176, 142, 165, 44, 100, 133, 62, 52, 125, 232, + 7, 63, 138, 136, 232, 143, 8, 95, 176, 234, 195, 180, 202, 172, 178, 240, 195, 84, 193, 86, + 63, 106, 66, 232, 216, 26, 31, 53, 210, 57, 216, 54, 179, 132, 102, 239, 75, 116, 133, 133, + 159, 228, 82, 214, 64, 62, 228, 89, 89, 57, 104, 120, 57, 21, 41, 234, 53, 166, 156, 34, + 37, 246, 82, 120, 9, 73, 150, 58, 12, 199, 237, 69, 208, 152, 208, 230, 6, 254, 193, 206, + 192, 171, 188, 130, 129, 94, 217, 113, 123, 185, 169, 222, 106, 155, 187, 119, 159, 168, + 255, 178, 62, 199, 174, 102, 110, 102, 170, 129, 177, 15, 120, 228, 215, 30, 111, 39, 140, + 108, 64, 11, 4, 0, 0, ]; assert_eq!(bytes, expected_serialization); } diff --git a/noir/noir-repo/acvm-repo/acvm/src/compiler/optimizers/redundant_range.rs b/noir/noir-repo/acvm-repo/acvm/src/compiler/optimizers/redundant_range.rs index 3570a36a7e7..f9c715a277f 100644 --- a/noir/noir-repo/acvm-repo/acvm/src/compiler/optimizers/redundant_range.rs +++ b/noir/noir-repo/acvm-repo/acvm/src/compiler/optimizers/redundant_range.rs @@ -191,7 +191,6 @@ mod tests { public_parameters: PublicInputs::default(), return_values: PublicInputs::default(), assert_messages: Default::default(), - recursive: false, } } diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/addition.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/addition.ts index 820a415acf3..2b8124e77d7 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/addition.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/addition.ts @@ -3,10 +3,10 @@ import { WitnessMap } from '@noir-lang/acvm_js'; // See `addition_circuit` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 144, 65, 14, 128, 32, 12, 4, 65, 124, 80, 75, 91, 104, 111, 126, 69, 34, 252, - 255, 9, 106, 228, 64, 162, 55, 153, 164, 217, 158, 38, 155, 245, 238, 97, 189, 206, 187, 55, 161, 231, 214, 19, 254, - 129, 126, 162, 107, 25, 92, 4, 137, 185, 230, 88, 145, 112, 135, 104, 69, 5, 88, 74, 82, 84, 20, 149, 35, 42, 81, 85, - 214, 108, 197, 50, 24, 50, 85, 108, 98, 212, 186, 44, 204, 235, 5, 183, 99, 233, 46, 63, 252, 110, 216, 56, 184, 15, - 78, 146, 74, 173, 20, 141, 1, 0, 0, + 255, 9, 106, 228, 64, 194, 81, 38, 105, 182, 167, 201, 102, 189, 251, 216, 159, 243, 110, 38, 244, 60, 122, 194, 63, + 208, 47, 116, 109, 131, 139, 32, 49, 215, 28, 43, 18, 158, 16, 173, 168, 0, 75, 73, 138, 138, 162, 114, 69, 37, 170, + 202, 154, 173, 88, 6, 67, 166, 138, 77, 140, 90, 151, 133, 117, 189, 224, 117, 108, 221, 229, 135, 223, 13, 27, 135, + 121, 106, 119, 3, 58, 173, 124, 163, 140, 1, 0, 0, ]); export const initialWitnessMap: WitnessMap = new Map([ diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/complex_foreign_call.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/complex_foreign_call.ts index 8eb7b7d5059..b2b0aff6ed3 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/complex_foreign_call.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/complex_foreign_call.ts @@ -2,14 +2,14 @@ import { WitnessMap } from '@noir-lang/acvm_js'; // See `complex_brillig_foreign_call` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 85, 93, 10, 194, 48, 12, 78, 155, 233, 54, 240, 205, 11, 8, 122, 128, 76, 47, - 176, 187, 136, 111, 138, 62, 122, 124, 45, 75, 88, 23, 139, 19, 76, 64, 63, 24, 89, 75, 242, 229, 159, 6, 24, 208, 60, - 191, 192, 255, 11, 150, 145, 101, 186, 71, 152, 66, 116, 123, 150, 244, 29, 186, 96, 199, 69, 94, 49, 198, 63, 136, - 17, 29, 98, 132, 172, 255, 63, 216, 111, 203, 190, 152, 214, 15, 11, 251, 83, 193, 176, 95, 75, 62, 215, 44, 27, 93, - 232, 100, 20, 225, 117, 241, 38, 144, 233, 105, 149, 4, 229, 185, 183, 201, 232, 208, 42, 191, 198, 252, 36, 213, 216, - 192, 103, 249, 250, 228, 185, 39, 225, 71, 23, 126, 234, 132, 191, 114, 234, 83, 173, 234, 149, 231, 146, 251, 93, - 193, 56, 129, 199, 235, 229, 118, 62, 221, 177, 96, 170, 205, 19, 182, 234, 188, 43, 148, 108, 142, 67, 144, 63, 52, - 239, 244, 67, 65, 127, 206, 102, 13, 227, 56, 201, 195, 246, 0, 155, 0, 46, 128, 245, 6, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 85, 93, 10, 194, 48, 12, 78, 219, 233, 54, 240, 205, 11, 8, 122, 128, 76, 47, + 176, 187, 136, 111, 138, 62, 122, 124, 45, 75, 88, 140, 197, 9, 38, 224, 62, 24, 89, 75, 242, 229, 159, 6, 24, 208, + 60, 191, 64, 255, 11, 146, 145, 100, 190, 79, 240, 10, 214, 237, 73, 226, 111, 232, 130, 29, 23, 122, 197, 24, 103, + 16, 99, 114, 136, 17, 68, 255, 255, 176, 223, 150, 125, 49, 173, 95, 42, 236, 79, 5, 195, 126, 45, 233, 92, 147, 108, + 116, 161, 179, 81, 132, 247, 197, 147, 224, 225, 105, 149, 4, 229, 184, 183, 73, 232, 208, 42, 191, 198, 252, 200, + 197, 216, 192, 119, 249, 250, 228, 185, 71, 230, 79, 46, 252, 216, 49, 127, 229, 212, 167, 90, 213, 75, 230, 34, 253, + 174, 96, 28, 192, 227, 245, 114, 59, 159, 238, 169, 96, 170, 205, 51, 182, 234, 188, 43, 148, 108, 138, 131, 33, 223, + 153, 79, 250, 161, 160, 63, 101, 179, 134, 113, 156, 248, 93, 123, 0, 142, 67, 44, 107, 244, 6, 0, 0, ]); export const initialWitnessMap: WitnessMap = new Map([ [1, '0x0000000000000000000000000000000000000000000000000000000000000001'], diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/foreign_call.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/foreign_call.ts index dc3c6f23f6f..6cec99a636d 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/foreign_call.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/foreign_call.ts @@ -2,11 +2,11 @@ import { WitnessMap } from '@noir-lang/acvm_js'; // See `simple_brillig_foreign_call` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 79, 73, 10, 128, 48, 12, 204, 40, 46, 5, 111, 126, 36, 254, 192, 207, 120, - 240, 226, 65, 196, 247, 91, 48, 129, 80, 218, 122, 48, 3, 33, 147, 9, 89, 6, 244, 98, 140, 1, 225, 157, 100, 173, 45, - 84, 91, 37, 243, 63, 44, 240, 219, 197, 246, 223, 38, 37, 176, 34, 85, 156, 169, 251, 144, 233, 183, 142, 206, 67, - 114, 215, 121, 63, 15, 84, 135, 222, 157, 98, 244, 194, 247, 227, 222, 206, 11, 31, 19, 165, 186, 164, 207, 153, 222, - 3, 91, 101, 84, 220, 120, 2, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 173, 79, 73, 10, 128, 48, 12, 236, 40, 46, 5, 111, 126, 36, 254, 192, 207, 120, + 240, 226, 65, 196, 247, 91, 48, 129, 80, 186, 28, 154, 129, 144, 201, 132, 44, 3, 247, 99, 14, 1, 230, 3, 103, 169, + 53, 68, 219, 57, 83, 27, 54, 216, 237, 34, 253, 111, 23, 19, 104, 177, 96, 76, 204, 251, 68, 191, 55, 52, 238, 163, + 187, 198, 251, 105, 114, 101, 200, 221, 37, 196, 200, 252, 188, 222, 227, 126, 80, 153, 200, 213, 57, 125, 77, 244, + 62, 112, 171, 6, 33, 119, 2, 0, 0, ]); export const initialWitnessMap: WitnessMap = new Map([ [1, '0x0000000000000000000000000000000000000000000000000000000000000005'], diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/memory_op.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/memory_op.ts index f7443c2258b..2287d31d37e 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/memory_op.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/memory_op.ts @@ -1,9 +1,9 @@ // See `memory_op_circuit` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 82, 65, 10, 0, 32, 8, 211, 180, 255, 216, 15, 250, 255, 171, 10, 82, 176, 232, - 150, 30, 26, 200, 118, 144, 49, 135, 8, 11, 117, 14, 169, 102, 229, 162, 140, 78, 219, 206, 137, 174, 44, 111, 104, - 217, 190, 24, 236, 75, 113, 94, 146, 93, 174, 252, 86, 46, 71, 223, 78, 46, 104, 129, 253, 155, 45, 60, 195, 5, 3, 89, - 11, 161, 73, 39, 3, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 82, 65, 10, 0, 32, 8, 211, 180, 255, 216, 15, 250, 255, 171, 10, 82, 176, 58, + 166, 135, 6, 178, 29, 100, 204, 33, 194, 66, 157, 67, 170, 89, 185, 40, 163, 211, 182, 115, 162, 43, 203, 27, 90, 182, + 47, 6, 251, 82, 156, 151, 100, 151, 43, 191, 149, 203, 209, 183, 147, 11, 90, 96, 255, 102, 11, 207, 112, 99, 0, 192, + 100, 38, 199, 38, 3, 0, 0, ]); export const initialWitnessMap = new Map([ diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/multi_scalar_mul.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/multi_scalar_mul.ts index 239d5473606..3ec589dd0c8 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/multi_scalar_mul.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/multi_scalar_mul.ts @@ -1,8 +1,8 @@ // See `multi_scalar_mul_circuit` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 77, 9, 14, 0, 32, 8, 202, 171, 227, 255, 255, 109, 217, 162, 141, 114, 99, 2, - 162, 74, 57, 53, 18, 2, 46, 208, 70, 122, 99, 162, 43, 113, 35, 239, 102, 157, 230, 1, 94, 19, 45, 209, 145, 11, 202, - 43, 238, 56, 249, 133, 254, 255, 187, 79, 45, 204, 84, 220, 246, 193, 0, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 93, 77, 9, 10, 0, 32, 8, 243, 236, 248, 255, 127, 35, 163, 5, 35, 97, 184, 205, + 169, 42, 183, 102, 65, 193, 21, 218, 73, 31, 44, 116, 35, 238, 228, 189, 108, 208, 60, 193, 91, 161, 23, 6, 114, 73, + 121, 195, 157, 32, 95, 232, 255, 191, 203, 181, 1, 243, 231, 24, 106, 192, 0, 0, 0, ]); export const initialWitnessMap = new Map([ [1, '0x0000000000000000000000000000000000000000000000000000000000000001'], diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/nested_acir_call.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/nested_acir_call.ts index 64051dff93f..5e0bcf25300 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/nested_acir_call.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/nested_acir_call.ts @@ -2,13 +2,13 @@ import { WitnessMap, StackItem, WitnessStack } from '@noir-lang/acvm_js'; // See `nested_acir_call_circuit` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 205, 146, 97, 10, 195, 32, 12, 133, 163, 66, 207, 147, 24, 173, 241, 223, 174, 50, - 153, 189, 255, 17, 214, 177, 148, 57, 17, 250, 99, 14, 250, 224, 97, 144, 16, 146, 143, 231, 224, 45, 167, 126, 105, - 217, 109, 118, 91, 248, 200, 168, 225, 248, 63, 107, 114, 208, 233, 104, 188, 233, 139, 191, 137, 108, 51, 139, 113, - 13, 161, 38, 95, 137, 233, 142, 62, 23, 137, 24, 98, 89, 133, 132, 162, 196, 135, 23, 230, 42, 65, 82, 46, 57, 97, - 166, 192, 149, 182, 152, 121, 211, 97, 110, 222, 94, 8, 13, 132, 182, 54, 48, 144, 235, 8, 254, 11, 22, 76, 132, 101, - 231, 237, 229, 23, 189, 213, 54, 119, 15, 83, 212, 199, 172, 175, 191, 226, 102, 96, 140, 251, 202, 84, 13, 204, 141, - 224, 25, 176, 161, 158, 53, 121, 144, 73, 14, 4, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 213, 146, 81, 10, 195, 48, 8, 134, 77, 132, 158, 71, 99, 210, 152, 183, 93, 101, + 97, 233, 253, 143, 176, 142, 165, 44, 100, 133, 62, 52, 125, 232, 7, 63, 138, 136, 232, 143, 8, 95, 176, 234, 195, + 180, 202, 172, 178, 240, 195, 84, 193, 86, 63, 106, 66, 232, 216, 26, 31, 53, 210, 57, 216, 54, 179, 132, 102, 239, + 75, 116, 133, 133, 159, 228, 82, 214, 64, 62, 228, 89, 89, 57, 104, 120, 57, 21, 41, 234, 53, 166, 156, 34, 37, 246, + 82, 120, 9, 73, 150, 58, 12, 199, 237, 69, 208, 152, 208, 230, 6, 254, 193, 206, 192, 171, 188, 130, 129, 94, 217, + 113, 123, 185, 169, 222, 106, 155, 187, 119, 159, 168, 255, 178, 62, 199, 174, 102, 110, 102, 170, 129, 177, 15, 120, + 228, 215, 30, 111, 39, 140, 108, 64, 11, 4, 0, 0, ]); export const initialWitnessMap: WitnessMap = new Map([ diff --git a/noir/noir-repo/acvm-repo/acvm_js/test/shared/schnorr_verify.ts b/noir/noir-repo/acvm-repo/acvm_js/test/shared/schnorr_verify.ts index 830ca1026d6..d2df63a8ddb 100644 --- a/noir/noir-repo/acvm-repo/acvm_js/test/shared/schnorr_verify.ts +++ b/noir/noir-repo/acvm-repo/acvm_js/test/shared/schnorr_verify.ts @@ -1,19 +1,19 @@ // See `schnorr_verify_circuit` integration test in `acir/tests/test_program_serialization.rs`. export const bytecode = Uint8Array.from([ - 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 85, 211, 103, 78, 2, 81, 24, 70, 225, 193, 130, 96, 239, 189, 96, 239, 189, 35, 34, - 34, 34, 34, 238, 130, 253, 47, 129, 192, 9, 223, 36, 7, 146, 201, 60, 209, 31, 144, 123, 207, 155, 73, 250, 159, 118, - 239, 201, 132, 121, 103, 227, 205, 211, 137, 247, 144, 60, 220, 123, 114, 225, 17, 121, 84, 206, 202, 99, 114, 78, - 206, 203, 227, 242, 132, 60, 41, 79, 201, 211, 242, 140, 60, 43, 207, 201, 243, 242, 130, 188, 40, 47, 201, 203, 242, - 138, 188, 42, 175, 201, 235, 242, 134, 188, 41, 111, 201, 219, 242, 142, 92, 144, 119, 229, 61, 121, 95, 62, 144, 15, - 229, 35, 249, 88, 62, 145, 79, 229, 51, 249, 92, 190, 144, 47, 229, 43, 249, 90, 190, 145, 111, 229, 59, 249, 94, 126, - 144, 31, 229, 39, 249, 89, 126, 145, 95, 229, 162, 252, 38, 151, 228, 119, 185, 44, 127, 200, 21, 249, 83, 174, 134, - 233, 52, 137, 191, 125, 233, 255, 53, 249, 91, 174, 203, 63, 114, 67, 254, 149, 155, 242, 159, 220, 10, 255, 199, 247, - 183, 244, 59, 216, 38, 155, 100, 139, 108, 144, 237, 165, 155, 203, 199, 111, 102, 83, 108, 137, 13, 177, 29, 54, 195, - 86, 216, 8, 219, 96, 19, 108, 129, 13, 208, 62, 205, 211, 58, 141, 211, 54, 77, 211, 50, 13, 211, 46, 205, 22, 146, - 126, 163, 180, 73, 147, 180, 72, 131, 180, 71, 115, 180, 70, 99, 180, 69, 83, 180, 68, 67, 180, 67, 51, 180, 66, 35, - 180, 65, 19, 180, 64, 3, 220, 61, 119, 206, 93, 115, 199, 197, 184, 211, 82, 220, 97, 57, 238, 172, 18, 119, 84, 141, - 187, 168, 197, 217, 215, 227, 172, 27, 113, 182, 205, 56, 203, 244, 204, 210, 115, 75, 116, 158, 3, 159, 46, 43, 32, - 188, 53, 25, 5, 0, 0, + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 77, 211, 103, 78, 2, 81, 24, 70, 225, 193, 130, 96, 239, 189, 96, 239, 189, 35, 34, + 34, 34, 82, 118, 193, 254, 151, 64, 224, 132, 111, 146, 67, 50, 153, 39, 250, 3, 114, 239, 121, 51, 201, 240, 211, 29, + 60, 153, 48, 239, 108, 188, 121, 122, 241, 30, 145, 71, 7, 79, 46, 60, 38, 143, 203, 89, 121, 66, 206, 201, 121, 121, + 82, 158, 146, 167, 229, 25, 121, 86, 158, 147, 231, 229, 5, 121, 81, 94, 146, 151, 229, 21, 121, 85, 94, 147, 215, + 229, 13, 121, 83, 222, 146, 183, 229, 29, 121, 87, 222, 147, 11, 242, 190, 124, 32, 31, 202, 71, 242, 177, 124, 34, + 159, 202, 103, 242, 185, 124, 33, 95, 202, 87, 242, 181, 124, 35, 223, 202, 119, 242, 189, 252, 32, 63, 202, 79, 242, + 179, 252, 34, 191, 202, 111, 242, 187, 92, 148, 63, 228, 146, 252, 41, 151, 229, 47, 185, 34, 127, 203, 213, 48, 157, + 38, 241, 183, 31, 253, 191, 38, 255, 202, 117, 249, 79, 110, 200, 255, 114, 83, 110, 201, 237, 112, 39, 190, 191, 173, + 223, 193, 54, 217, 36, 91, 100, 131, 108, 47, 221, 92, 62, 126, 51, 155, 98, 75, 108, 136, 237, 176, 25, 182, 194, 70, + 216, 6, 155, 96, 11, 108, 128, 246, 105, 158, 214, 105, 156, 182, 105, 154, 150, 105, 152, 118, 105, 182, 144, 12, 27, + 165, 77, 154, 164, 69, 26, 164, 61, 154, 163, 53, 26, 163, 45, 154, 162, 37, 26, 162, 29, 154, 161, 21, 26, 161, 13, + 154, 160, 5, 26, 224, 238, 185, 115, 238, 154, 59, 46, 198, 157, 150, 226, 14, 203, 113, 103, 149, 184, 163, 106, 220, + 69, 45, 206, 190, 30, 103, 221, 136, 179, 109, 198, 89, 166, 103, 150, 158, 91, 162, 243, 244, 167, 15, 14, 161, 226, + 6, 24, 5, 0, 0, ]); export const initialWitnessMap = new Map([ diff --git a/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh b/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh index bec59eb6889..de1f71a4cc0 100755 --- a/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh +++ b/noir/noir-repo/compiler/integration-tests/scripts/codegen-verifiers.sh @@ -17,8 +17,8 @@ KEYS=$(mktemp -d) # Codegen verifier contract for 1_mul mul_dir=$repo_root/test_programs/execution_success/1_mul nargo --program-dir $mul_dir compile -$NARGO_BACKEND_PATH write_vk -b $mul_dir/target/1_mul.json -o $KEYS/1_mul -$NARGO_BACKEND_PATH contract -k $KEYS/1_mul -o $contracts_dir/1_mul.sol +$NARGO_BACKEND_PATH write_vk -b $mul_dir/target/1_mul.json -o $KEYS/1_mul +$NARGO_BACKEND_PATH contract -k $KEYS/1_mul -o $contracts_dir/1_mul.sol # Codegen verifier contract for assert_statement assert_statement_dir=$repo_root/test_programs/execution_success/assert_statement diff --git a/noir/noir-repo/compiler/integration-tests/test/browser/recursion.test.ts b/noir/noir-repo/compiler/integration-tests/test/browser/recursion.test.ts index 4ee92d5b795..71d6697f843 100644 --- a/noir/noir-repo/compiler/integration-tests/test/browser/recursion.test.ts +++ b/noir/noir-repo/compiler/integration-tests/test/browser/recursion.test.ts @@ -19,7 +19,7 @@ await newABICoder(); await initACVM(); const base_relative_path = '../../../../..'; -const circuit_main = 'test_programs/execution_success/assert_statement_recursive'; +const circuit_main = 'test_programs/execution_success/assert_statement'; const circuit_recursion = 'compiler/integration-tests/circuits/recursion'; async function getCircuit(projectPath: string) { @@ -45,7 +45,7 @@ describe('It compiles noir program code, receiving circuit bytes and abi object. const main_program = await getCircuit(`${base_relative_path}/${circuit_main}`); const main_inputs: InputMap = TOML.parse(circuit_main_toml) as InputMap; - const main_backend = new UltraPlonkBackend(main_program.bytecode); + const main_backend = new UltraPlonkBackend(main_program.bytecode, {}, { recursive: true }); const { witness: main_witnessUint8Array } = await new Noir(main_program).execute(main_inputs); @@ -73,7 +73,7 @@ describe('It compiles noir program code, receiving circuit bytes and abi object. const recursion_program = await getCircuit(`${base_relative_path}/${circuit_recursion}`); - const recursion_backend = new UltraPlonkBackend(recursion_program.bytecode); + const recursion_backend = new UltraPlonkBackend(recursion_program.bytecode, {}, { recursive: false }); const { witness: recursion_witnessUint8Array } = await new Noir(recursion_program).execute(recursion_inputs); diff --git a/noir/noir-repo/compiler/integration-tests/test/node/onchain_recursive_verification.test.ts b/noir/noir-repo/compiler/integration-tests/test/node/onchain_recursive_verification.test.ts index b08d52e1604..1694da28805 100644 --- a/noir/noir-repo/compiler/integration-tests/test/node/onchain_recursive_verification.test.ts +++ b/noir/noir-repo/compiler/integration-tests/test/node/onchain_recursive_verification.test.ts @@ -17,7 +17,7 @@ it.skip(`smart contract can verify a recursive proof`, async () => { const fm = createFileManager(basePath); const innerCompilationResult = await compile( fm, - join(basePath, './test_programs/execution_success/assert_statement_recursive'), + join(basePath, './test_programs/execution_success/assert_statement'), ); if (!('program' in innerCompilationResult)) { throw new Error('Compilation failed'); @@ -35,11 +35,11 @@ it.skip(`smart contract can verify a recursive proof`, async () => { // Intermediate proof - const inner_backend = new UltraPlonkBackend(innerProgram.bytecode); + const inner_backend = new UltraPlonkBackend(innerProgram.bytecode, {}, { recursive: true }); const inner = new Noir(innerProgram); const inner_prover_toml = readFileSync( - join(basePath, `./test_programs/execution_success/assert_statement_recursive/Prover.toml`), + join(basePath, `./test_programs/execution_success/assert_statement/Prover.toml`), ).toString(); const inner_inputs = toml.parse(inner_prover_toml); @@ -67,7 +67,7 @@ it.skip(`smart contract can verify a recursive proof`, async () => { const { witness: recursionWitness } = await recursion.execute(recursion_inputs); - const recursion_backend = new UltraPlonkBackend(recursionProgram.bytecode); + const recursion_backend = new UltraPlonkBackend(recursionProgram.bytecode, {}, { recursive: false }); const recursion_proof = await recursion_backend.generateProof(recursionWitness); expect(await recursion_backend.verifyProof(recursion_proof)).to.be.true; diff --git a/noir/noir-repo/compiler/integration-tests/test/node/smart_contract_verifier.test.ts b/noir/noir-repo/compiler/integration-tests/test/node/smart_contract_verifier.test.ts index c43fba01424..74a36262829 100644 --- a/noir/noir-repo/compiler/integration-tests/test/node/smart_contract_verifier.test.ts +++ b/noir/noir-repo/compiler/integration-tests/test/node/smart_contract_verifier.test.ts @@ -46,7 +46,7 @@ test_cases.forEach((testInfo) => { const inputs = toml.parse(prover_toml); const { witness } = await program.execute(inputs); - const backend = new UltraPlonkBackend(noir_program.bytecode); + const backend = new UltraPlonkBackend(noir_program.bytecode, {}, { recursive: false }); const proofData = await backend.generateProof(witness); // JS verification diff --git a/noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs b/noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs index ea41b0cfb32..282e26dbe06 100644 --- a/noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs +++ b/noir/noir-repo/compiler/noirc_evaluator/src/ssa.rs @@ -222,7 +222,6 @@ pub fn create_program( let func_sigs = program.function_signatures.clone(); - let recursive = program.recursive; let ArtifactsAndWarnings( (generated_acirs, generated_brillig, brillig_function_names, error_types), ssa_level_warnings, @@ -250,7 +249,6 @@ pub fn create_program( let circuit_artifact = convert_generated_acir_into_circuit( acir, func_sig, - recursive, // TODO: get rid of these clones debug_variables.clone(), debug_functions.clone(), @@ -276,7 +274,6 @@ pub struct SsaCircuitArtifact { fn convert_generated_acir_into_circuit( mut generated_acir: GeneratedAcir, func_sig: FunctionSignature, - recursive: bool, debug_variables: DebugVariables, debug_functions: DebugFunctions, debug_types: DebugTypes, @@ -308,7 +305,6 @@ fn convert_generated_acir_into_circuit( public_parameters, return_values, assert_messages: assert_messages.into_iter().collect(), - recursive, }; // This converts each im::Vector in the BTreeMap to a Vec diff --git a/noir/noir-repo/compiler/noirc_frontend/src/ast/function.rs b/noir/noir-repo/compiler/noirc_frontend/src/ast/function.rs index 70d2b3dbb39..beeea3ffac5 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/ast/function.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/ast/function.rs @@ -29,14 +29,13 @@ pub enum FunctionKind { Builtin, Normal, Oracle, - Recursive, } impl FunctionKind { pub fn can_ignore_return_type(self) -> bool { match self { FunctionKind::LowLevel | FunctionKind::Builtin | FunctionKind::Oracle => true, - FunctionKind::Normal | FunctionKind::Recursive => false, + FunctionKind::Normal => false, } } } @@ -114,7 +113,6 @@ impl From for NoirFunction { Some(FunctionAttribute::Foreign(_)) => FunctionKind::LowLevel, Some(FunctionAttribute::Test { .. }) => FunctionKind::Normal, Some(FunctionAttribute::Oracle(_)) => FunctionKind::Oracle, - Some(FunctionAttribute::Recursive) => FunctionKind::Recursive, Some(FunctionAttribute::Fold) => FunctionKind::Normal, Some(FunctionAttribute::NoPredicates) => FunctionKind::Normal, Some(FunctionAttribute::InlineAlways) => FunctionKind::Normal, diff --git a/noir/noir-repo/compiler/noirc_frontend/src/elaborator/lints.rs b/noir/noir-repo/compiler/noirc_frontend/src/elaborator/lints.rs index 57db2359772..249fed90a60 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/elaborator/lints.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/elaborator/lints.rs @@ -1,5 +1,5 @@ use crate::{ - ast::{FunctionKind, Ident, NoirFunction, Signedness, UnaryOp, Visibility}, + ast::{Ident, NoirFunction, Signedness, UnaryOp, Visibility}, graph::CrateId, hir::{ resolution::errors::{PubPosition, ResolverError}, @@ -127,19 +127,6 @@ pub(super) fn missing_pub(func: &FuncMeta, modifiers: &FunctionModifiers) -> Opt } } -/// `#[recursive]` attribute is only allowed for entry point functions -pub(super) fn recursive_non_entrypoint_function( - func: &FuncMeta, - modifiers: &FunctionModifiers, -) -> Option { - if !func.is_entry_point && func.kind == FunctionKind::Recursive { - let ident = func_meta_name_ident(func, modifiers); - Some(ResolverError::MisplacedRecursiveAttribute { ident }) - } else { - None - } -} - /// Check that we are not passing a mutable reference from a constrained runtime to an unconstrained runtime. pub(super) fn unconstrained_function_args( function_args: &[(Type, ExprId, Span)], diff --git a/noir/noir-repo/compiler/noirc_frontend/src/elaborator/mod.rs b/noir/noir-repo/compiler/noirc_frontend/src/elaborator/mod.rs index 2a723286d8b..d932c1b625e 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/elaborator/mod.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/elaborator/mod.rs @@ -439,7 +439,7 @@ impl<'context> Elaborator<'context> { FunctionKind::Builtin | FunctionKind::LowLevel | FunctionKind::Oracle => { (HirFunction::empty(), Type::Error) } - FunctionKind::Normal | FunctionKind::Recursive => { + FunctionKind::Normal => { let (block, body_type) = self.elaborate_block(body); let expr_id = self.intern_expr(block, body_span); self.interner.push_expr_type(expr_id, body_type.clone()); @@ -472,7 +472,7 @@ impl<'context> Elaborator<'context> { } // Check that the body can return without calling the function. - if let FunctionKind::Normal | FunctionKind::Recursive = kind { + if let FunctionKind::Normal = kind { self.run_lint(|elaborator| { lints::unbounded_recursion( elaborator.interner, @@ -928,9 +928,6 @@ impl<'context> Elaborator<'context> { lints::low_level_function_outside_stdlib(func, modifiers, elaborator.crate_id) .map(Into::into) }); - self.run_lint(|_| { - lints::recursive_non_entrypoint_function(func, modifiers).map(Into::into) - }); } /// Only sized types are valid to be used as main's parameters or the parameters to a contract diff --git a/noir/noir-repo/compiler/noirc_frontend/src/hir/resolution/errors.rs b/noir/noir-repo/compiler/noirc_frontend/src/hir/resolution/errors.rs index e1e60daff60..67820bfd1b7 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/hir/resolution/errors.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/hir/resolution/errors.rs @@ -83,8 +83,6 @@ pub enum ResolverError { InvalidClosureEnvironment { typ: Type, span: Span }, #[error("Nested slices, i.e. slices within an array or slice, are not supported")] NestedSlices { span: Span }, - #[error("#[recursive] attribute is only allowed on entry points to a program")] - MisplacedRecursiveAttribute { ident: Ident }, #[error("#[abi(tag)] attribute is only allowed in contracts")] AbiAttributeOutsideContract { span: Span }, #[error("Usage of the `#[foreign]` or `#[builtin]` function attributes are not allowed outside of the Noir standard library")] @@ -216,13 +214,11 @@ impl<'a> From<&'a ResolverError> for Diagnostic { diagnostic } ResolverError::UnconditionalRecursion { name, span} => { - let mut diagnostic = Diagnostic::simple_warning( + Diagnostic::simple_warning( format!("function `{name}` cannot return without recursing"), "function cannot return without recursing".to_string(), *span, - ); - diagnostic.unnecessary = true; - diagnostic + ) } ResolverError::VariableNotDeclared { name, span } => Diagnostic::simple_error( format!("cannot find `{name}` in this scope "), @@ -382,18 +378,6 @@ impl<'a> From<&'a ResolverError> for Diagnostic { "Try to use a constant sized array or BoundedVec instead".into(), *span, ), - ResolverError::MisplacedRecursiveAttribute { ident } => { - let name = &ident.0.contents; - - let mut diag = Diagnostic::simple_error( - format!("misplaced #[recursive] attribute on function {name} rather than the main function"), - "misplaced #[recursive] attribute".to_string(), - ident.0.span(), - ); - - diag.add_note("The `#[recursive]` attribute specifies to the backend whether it should use a prover which generates proofs that are friendly for recursive verification in another circuit".to_owned()); - diag - } ResolverError::AbiAttributeOutsideContract { span } => { Diagnostic::simple_error( "#[abi(tag)] attributes can only be used in contracts".to_string(), diff --git a/noir/noir-repo/compiler/noirc_frontend/src/lexer/token.rs b/noir/noir-repo/compiler/noirc_frontend/src/lexer/token.rs index daf59445982..5262911ea62 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/lexer/token.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/lexer/token.rs @@ -793,7 +793,6 @@ impl Attribute { Attribute::Function(FunctionAttribute::Oracle(name.to_string())) } ["test"] => Attribute::Function(FunctionAttribute::Test(TestScope::None)), - ["recursive"] => Attribute::Function(FunctionAttribute::Recursive), ["fold"] => Attribute::Function(FunctionAttribute::Fold), ["no_predicates"] => Attribute::Function(FunctionAttribute::NoPredicates), ["inline_always"] => Attribute::Function(FunctionAttribute::InlineAlways), @@ -854,7 +853,6 @@ pub enum FunctionAttribute { Builtin(String), Oracle(String), Test(TestScope), - Recursive, Fold, NoPredicates, InlineAlways, @@ -918,7 +916,6 @@ impl FunctionAttribute { FunctionAttribute::Builtin(_) => "builtin", FunctionAttribute::Oracle(_) => "oracle", FunctionAttribute::Test(_) => "test", - FunctionAttribute::Recursive => "recursive", FunctionAttribute::Fold => "fold", FunctionAttribute::NoPredicates => "no_predicates", FunctionAttribute::InlineAlways => "inline_always", @@ -933,7 +930,6 @@ impl fmt::Display for FunctionAttribute { FunctionAttribute::Foreign(ref k) => write!(f, "#[foreign({k})]"), FunctionAttribute::Builtin(ref k) => write!(f, "#[builtin({k})]"), FunctionAttribute::Oracle(ref k) => write!(f, "#[oracle({k})]"), - FunctionAttribute::Recursive => write!(f, "#[recursive]"), FunctionAttribute::Fold => write!(f, "#[fold]"), FunctionAttribute::NoPredicates => write!(f, "#[no_predicates]"), FunctionAttribute::InlineAlways => write!(f, "#[inline_always]"), @@ -1064,7 +1060,6 @@ impl AsRef for FunctionAttribute { FunctionAttribute::Builtin(string) => string, FunctionAttribute::Oracle(string) => string, FunctionAttribute::Test { .. } => "", - FunctionAttribute::Recursive => "", FunctionAttribute::Fold => "", FunctionAttribute::NoPredicates => "", FunctionAttribute::InlineAlways => "", diff --git a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/ast.rs b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/ast.rs index 1b4bafd9d78..7c7f87b7b8b 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/ast.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/ast.rs @@ -325,8 +325,6 @@ pub struct Program { pub main_function_signature: FunctionSignature, pub return_location: Option, pub return_visibility: Visibility, - /// Indicates to a backend whether a SNARK-friendly prover should be used. - pub recursive: bool, pub debug_variables: DebugVariables, pub debug_functions: DebugFunctions, pub debug_types: DebugTypes, @@ -340,7 +338,6 @@ impl Program { main_function_signature: FunctionSignature, return_location: Option, return_visibility: Visibility, - recursive: bool, debug_variables: DebugVariables, debug_functions: DebugFunctions, debug_types: DebugTypes, @@ -351,7 +348,6 @@ impl Program { main_function_signature, return_location, return_visibility, - recursive, debug_variables, debug_functions, debug_types, diff --git a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs index 3ca4c5651ec..21a2d533354 100644 --- a/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs +++ b/noir/noir-repo/compiler/noirc_frontend/src/monomorphization/mod.rs @@ -151,7 +151,7 @@ pub fn monomorphize_debug( .collect(); let functions = vecmap(monomorphizer.finished_functions, |(_, f)| f); - let FuncMeta { return_visibility, kind, .. } = monomorphizer.interner.function_meta(&main); + let FuncMeta { return_visibility, .. } = monomorphizer.interner.function_meta(&main); let (debug_variables, debug_functions, debug_types) = monomorphizer.debug_type_tracker.extract_vars_and_types(); @@ -161,7 +161,6 @@ pub fn monomorphize_debug( function_sig, monomorphizer.return_location, *return_visibility, - *kind == FunctionKind::Recursive, debug_variables, debug_functions, debug_types, @@ -247,11 +246,6 @@ impl<'interner> Monomorphizer<'interner> { ); Definition::Oracle(opcode.to_string()) } - FunctionKind::Recursive => { - let id = - self.queue_function(id, expr_id, typ, turbofish_generics, trait_method); - Definition::Function(id) - } } } } diff --git a/noir/noir-repo/docs/docs/how_to/how-to-recursion.md b/noir/noir-repo/docs/docs/how_to/how-to-recursion.md index fac79a9cf49..399e4d4b38a 100644 --- a/noir/noir-repo/docs/docs/how_to/how-to-recursion.md +++ b/noir/noir-repo/docs/docs/how_to/how-to-recursion.md @@ -36,7 +36,7 @@ As you've read in the [explainer](../explainers/explainer-recursion.md), a recur In a standard recursive app, you're also dealing with at least two circuits. For the purpose of this guide, we will assume the following: -- `main`: a circuit of type `assert(x != y)`, where `main` is marked with a `#[recursive]` attribute. This attribute states that the backend should generate proofs that are friendly for verification within another circuit. +- `main`: a circuit of type `assert(x != y)`, which we want to embed in another circuit recursively. For example when proving with the `bb` tool, we can use the `--recursive` CLI option to tell the backend that it should generate proofs that are friendly for verification within another circuit. - `recursive`: a circuit that verifies `main` For a full example of how recursive proofs work, please refer to the [noir-examples](https://github.com/noir-lang/noir-examples) repository. We will *not* be using it as a reference for this guide. @@ -50,7 +50,7 @@ For recursion, this doesn't happen, and the only need for `noir_js` is only to ` It is also recommended that you instantiate the backend with as many threads as possible, to allow for maximum concurrency: ```js -const backend = new Backend(circuit, { threads: 8 }) +const backend = new UltraPlonkBackend(circuit, { threads: 8 }, { recursive: true }) ``` :::tip diff --git a/noir/noir-repo/docs/docs/noir/standard_library/recursion.mdx b/noir/noir-repo/docs/docs/noir/standard_library/recursion.mdx index 60414a2fa51..fcb36278060 100644 --- a/noir/noir-repo/docs/docs/noir/standard_library/recursion.mdx +++ b/noir/noir-repo/docs/docs/noir/standard_library/recursion.mdx @@ -10,24 +10,6 @@ Noir supports recursively verifying proofs, meaning you verify the proof of a No Read [the explainer on recursion](../../explainers/explainer-recursion.md) to know more about this function and the [guide on how to use it.](../../how_to/how-to-recursion.md) -## The `#[recursive]` Attribute - -In Noir, the `#[recursive]` attribute is used to indicate that a circuit is designed for recursive proof generation. When applied, it informs the compiler and the tooling that the circuit should be compiled in a way that makes its proofs suitable for recursive verification. This attribute eliminates the need for manual flagging of recursion at the tooling level, streamlining the proof generation process for recursive circuits. - -### Example usage with `#[recursive]` - -```rust -#[recursive] -fn main(x: Field, y: pub Field) { - assert(x == y, "x and y are not equal"); -} - -// This marks the circuit as recursion-friendly and indicates that proofs generated from this circuit -// are intended for recursive verification. -``` - -By incorporating this attribute directly in the circuit's definition, tooling like Nargo and NoirJS can automatically execute recursive-specific duties for Noir programs (e.g. recursive-friendly proof artifact generation) without additional flags or configurations. - ## Verifying Recursive Proofs ```rust diff --git a/noir/noir-repo/examples/recursion/generate_recursive_proof.sh b/noir/noir-repo/examples/recursion/generate_recursive_proof.sh index 362512529d4..09b01d547b6 100755 --- a/noir/noir-repo/examples/recursion/generate_recursive_proof.sh +++ b/noir/noir-repo/examples/recursion/generate_recursive_proof.sh @@ -4,14 +4,14 @@ set -eu BACKEND=${BACKEND:-bb} nargo execute sum_witness --package sum -$BACKEND prove -b ./target/sum.json -w ./target/sum_witness.gz -o ./target/sum_proof +$BACKEND prove -b ./target/sum.json -w ./target/sum_witness.gz -o ./target/sum_proof --recursive # Once we have generated our inner proof, we must use this to generate inputs to `recurse_leaf`` -$BACKEND write_vk -b ./target/sum.json -o ./target/sum_key +$BACKEND write_vk -b ./target/sum.json -o ./target/sum_key --recursive $BACKEND vk_as_fields -k ./target/sum_key -o ./target/sum_vk_as_fields VK_HASH=$(jq -r '.[0]' ./target/sum_vk_as_fields) -VK_AS_FIELDS=$(jq -r '.[1:]' ./target/sum_vk_as_fields) +VK_AS_FIELDS=$(jq -r '.[1:]' ./target/sum_vk_as_fields) FULL_PROOF_AS_FIELDS="$($BACKEND proof_as_fields -p ./target/sum_proof -k ./target/sum_key -o -)" # sum has 3 public inputs @@ -28,17 +28,17 @@ echo "public_inputs = $PUBLIC_INPUTS" >> $RECURSE_LEAF_PROVER_TOML # We can now execute and prove `recurse_leaf` nargo execute recurse_leaf_witness --package recurse_leaf -$BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz -o ./target/recurse_leaf_proof +$BACKEND prove -b ./target/recurse_leaf.json -w ./target/recurse_leaf_witness.gz -o ./target/recurse_leaf_proof --recursive # Let's do a sanity check that the proof we've generated so far is valid. -$BACKEND write_vk -b ./target/recurse_leaf.json -o ./target/recurse_leaf_key +$BACKEND write_vk -b ./target/recurse_leaf.json -o ./target/recurse_leaf_key --recursive $BACKEND verify -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key # Now we generate the final `recurse_node` proof similarly to how we did for `recurse_leaf`. $BACKEND vk_as_fields -k ./target/recurse_leaf_key -o ./target/recurse_leaf_vk_as_fields VK_HASH=$(jq -r '.[0]' ./target/recurse_leaf_vk_as_fields) -VK_AS_FIELDS=$(jq -r '.[1:]' ./target/recurse_leaf_vk_as_fields) +VK_AS_FIELDS=$(jq -r '.[1:]' ./target/recurse_leaf_vk_as_fields) FULL_PROOF_AS_FIELDS="$($BACKEND proof_as_fields -p ./target/recurse_leaf_proof -k ./target/recurse_leaf_key -o -)" # recurse_leaf has 4 public inputs (excluding aggregation object) diff --git a/noir/noir-repo/examples/recursion/recurse_leaf/src/main.nr b/noir/noir-repo/examples/recursion/recurse_leaf/src/main.nr index 1f111a1b5b0..0031997160d 100644 --- a/noir/noir-repo/examples/recursion/recurse_leaf/src/main.nr +++ b/noir/noir-repo/examples/recursion/recurse_leaf/src/main.nr @@ -1,10 +1,9 @@ -#[recursive] fn main( verification_key: [Field; 114], public_inputs: pub [Field; 3], key_hash: Field, proof: [Field; 93], - num: u64 + num: u64, ) -> pub u64 { // verify sum so far was computed correctly std::verify_proof(verification_key, proof, public_inputs, key_hash); diff --git a/noir/noir-repo/examples/recursion/sum/src/main.nr b/noir/noir-repo/examples/recursion/sum/src/main.nr index 722d941d57d..e8cd9f2aff9 100644 --- a/noir/noir-repo/examples/recursion/sum/src/main.nr +++ b/noir/noir-repo/examples/recursion/sum/src/main.nr @@ -1,4 +1,3 @@ -#[recursive] fn main(a: pub u64, b: pub u64) -> pub u64 { a + b -} \ No newline at end of file +} diff --git a/noir/noir-repo/test_programs/compile_success_contract/recursive_method/Nargo.toml b/noir/noir-repo/test_programs/compile_success_contract/recursive_method/Nargo.toml deleted file mode 100644 index 8142e5b3278..00000000000 --- a/noir/noir-repo/test_programs/compile_success_contract/recursive_method/Nargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "recursive_method" -type = "contract" -authors = [""] - -[dependencies] diff --git a/noir/noir-repo/test_programs/compile_success_contract/recursive_method/src/main.nr b/noir/noir-repo/test_programs/compile_success_contract/recursive_method/src/main.nr deleted file mode 100644 index 6fd4bf3338d..00000000000 --- a/noir/noir-repo/test_programs/compile_success_contract/recursive_method/src/main.nr +++ /dev/null @@ -1,6 +0,0 @@ -contract Foo { - #[recursive] - fn contract_entrypoint() -> pub Field { - 1 - } -} diff --git a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Nargo.toml b/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Nargo.toml deleted file mode 100644 index 2a5b02cad00..00000000000 --- a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Nargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "assert_statement_recursive" -type = "bin" -authors = [""] -compiler_version = ">=0.23.0" - -[dependencies] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Prover.toml b/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Prover.toml deleted file mode 100644 index 5d1dc99124f..00000000000 --- a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/Prover.toml +++ /dev/null @@ -1,2 +0,0 @@ -x = "3" -y = "3" diff --git a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/src/main.nr b/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/src/main.nr deleted file mode 100644 index 7f28fe3821d..00000000000 --- a/noir/noir-repo/test_programs/execution_success/assert_statement_recursive/src/main.nr +++ /dev/null @@ -1,11 +0,0 @@ -// Tests a very simple program. -// -// The features being tested is assertion -// This is the same as the `assert_statement` test except we specify -// that the backend should use a prover which will construct proofs -// friendly to recursive verification in another SNARK. -#[recursive] -fn main(x: Field, y: pub Field) { - assert(x == y, "x and y are not equal"); - assert_eq(x, y, "x and y are not equal"); -} diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof/src/main.nr index aecaa931d43..82090bb8602 100644 --- a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof/src/main.nr +++ b/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof/src/main.nr @@ -1,4 +1,4 @@ -// This circuit aggregates two Honk proof from `assert_statement_recursive`. +// This circuit aggregates two Honk proof from `assert_statement`. global SIZE_OF_PROOF_IF_LOGN_IS_28: u32 = 463; global HONK_IDENTIFIER: u32 = 1; fn main( diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Nargo.toml b/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Nargo.toml deleted file mode 100644 index 618ba8a87b7..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Nargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "double_verify_honk_proof_recursive" -type = "bin" -authors = [""] - -[dependencies] diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Prover.toml b/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Prover.toml deleted file mode 100644 index f8e7ba41a18..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/Prover.toml +++ /dev/null @@ -1,5 +0,0 @@ -key_hash = "0x0000000000000000000000000000000000000000000000000000000000000000" -proof = ["0x0000000000000000000000000000000000000000000000000000000000000040", "0x0000000000000000000000000000000000000000000000000000000000000011", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000042ab5d6d1986846cf", "0x00000000000000000000000000000000000000000000000b75c020998797da78", "0x0000000000000000000000000000000000000000000000005a107acb64952eca", "0x000000000000000000000000000000000000000000000000000031e97a575e9d", "0x00000000000000000000000000000000000000000000000b5666547acf8bd5a4", "0x00000000000000000000000000000000000000000000000c410db10a01750aeb", "0x00000000000000000000000000000000000000000000000d722669117f9758a4", "0x000000000000000000000000000000000000000000000000000178cbf4206471", "0x000000000000000000000000000000000000000000000000e91b8a11e7842c38", "0x000000000000000000000000000000000000000000000007fd51009034b3357f", "0x000000000000000000000000000000000000000000000009889939f81e9c7402", "0x0000000000000000000000000000000000000000000000000000f94656a2ca48", "0x000000000000000000000000000000000000000000000006fb128b46c1ddb67f", "0x0000000000000000000000000000000000000000000000093fe27776f50224bd", "0x000000000000000000000000000000000000000000000004a0c80c0da527a081", "0x0000000000000000000000000000000000000000000000000001b52c2020d746", "0x0000000000000000000000000000005a9bae947e1e91af9e4033d8d6aa6ed632", "0x000000000000000000000000000000000025e485e013446d4ac7981c88ba6ecc", "0x000000000000000000000000000000ff1e0496e30ab24a63b32b2d1120b76e62", "0x00000000000000000000000000000000001afe0a8a685d7cd85d1010e55d9d7c", "0x000000000000000000000000000000b0804efd6573805f991458295f510a2004", "0x00000000000000000000000000000000000c81a178016e2fe18605022d5a8b0e", "0x000000000000000000000000000000eba51e76eb1cfff60a53a0092a3c3dea47", "0x000000000000000000000000000000000022e7466247b533282f5936ac4e6c15", "0x00000000000000000000000000000071b1d76edf770edff98f00ff4deec264cd", "0x00000000000000000000000000000000001e48128e68794d8861fcbb2986a383", "0x000000000000000000000000000000d3a2af4915ae6d86b097adc377fafda2d4", "0x000000000000000000000000000000000006359de9ca452dab3a4f1f8d9c9d98", "0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491", "0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6", "0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1", "0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7", "0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491", "0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6", "0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1", "0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7", "0x000000000000000000000000000000f968b227a358a305607f3efc933823d288", "0x00000000000000000000000000000000000eaf8adb390375a76d95e918b65e08", "0x000000000000000000000000000000bb34b4b447aae56f5e24f81c3acd6d547f", "0x00000000000000000000000000000000002175d012746260ebcfe339a91a81e1", "0x00000000000000000000000000000052eebbd1f6f7554e837f60c44000ed14b6", "0x00000000000000000000000000000000001c1c045a3ec94b8801f2272cc0b3f4", "0x0000000000000000000000000000004d2ef74134578f6b431a9df071ffca4292", "0x0000000000000000000000000000000000291326ade7aa6f0dfc8900eab5580b", "0x0000000000000000000000000000002433eec6418a6dba820c9527e2581fc8bc", "0x00000000000000000000000000000000000e88b7daad19af2ac2f9bdf9e50ee2", "0x000000000000000000000000000000dcfce2c427155cc3e4d035735d3dd5ece8", "0x00000000000000000000000000000000002d7d473cac1a15d0fee8b22c1a7b3e", "0x1a4249b90be4602c8ff40c7c276160ee41b2a0f8a238ce7706e9face2db03d48", "0x162204b9d54d3ffd285c393a5a1ff76ee681474fd780a21a3cf7fac5c24fc2b9", "0x30279eb953d8ee79b2155c69c04e6443c5de6bf7e02886256dd7b3cd3c9502a4", "0x0d32c1bd21baf43e72d5d82d461ef54833807ff81a877adc822f27a6db88d754", "0x0fe15e055c0803d5ebe6dd77689b70cfd82138f008810ce24535c992daaff27d", "0x1fba82c012671212ce2fc13fd09bf8fba4f7d5875ab8d37495d1ccfcff287331", "0x090738a5842fa4d2699b3726aa0dd97cb59569b4be2c6825335ec4969f859dc2", "0x0c6cb72dabbc28abcf4a50c203534e066c29f48c24ca64d672092f263df3f9d7", "0x0f27fbea0d9145f815c288b50fe7e8c10b8185d325b5264624fd57102855d05d", "0x2a815cd3fd1c43c72ee0130465250ff771d1e7be2347e4ada331b83265a03450", "0x148b4ecf2ad7ed17409417086867ee27bc1b0906dbc9cbb3714c285071e2db70", "0x08e700a42b1d6d36ee65f8ebedf47d3a44463ff9fa579dce13b7492e20142c3a", "0x2e23c69521d572ff2152c50f8c9a9191535f4cf37f95f1e0428692e78842b642", "0x14519e0354365923fb41400c19866135b45e975d56a0980260bc99f0390b1d5f", "0x04caded1f05738f736cb5bcf08d785e395e58eb7738523a20638aa16bc51593e", "0x28787eaccd38383215ea21ec02895c32d979f68ca155f534a2e2d377bff6698b", "0x20a1b81fa96c58cf11c5762c5ceb731efdcb081fca2d34d5c463d2cf40e6da18", "0x11789a06fe3bf53833741d180f068d29534d5bb58a5c64b8119542e62b189fb4", "0x23d00fcd032ace719ffcbc513bfa177a55b04377d76455c2788d999d05d011e2", "0x01f0e81b57b4a73cc118e51ede18f8724debf25c2d109db6ef45280f99f1a3fa", "0x156d1c9b61749810de728f259c2c1c1fd4dbff97101426e26087ca461c93307c", "0x1c5d619ac3a478cfd06d5eebfd879960bb321236be173813f5e78d1366d32c69", "0x250cfae4e1dfc551406f1f3d10b649a637dcb7bcb0f6f697994cf96afd35d0c1", "0x242b999f58cf5f53c874d1092bd38725aa9ea076f5bc8f176efa9ea23393874b", "0x2e15748255c4a5e0e9fe38047341b692a967257de27a85a3a38681bc9f1602ea", "0x01ef83886ea7017253699cb6371988eb8e21b4f7023d7479ece4907fe6d4a6fd", "0x08db2dbc271e375b9312f695c59c48f313235b3432cad50921c8d9ad6dd7ad7a", "0x199309f2c2cd45c15a4abb0e6554a1615ff5a6e9488a8d900bbf835fc8f664ef", "0x074be7a3d88e31ab1b59c9208c012bcfb1f85f351c709e68134996891db52b57", "0x301b1011354d2ebf46134fc4d6d734bb6ed8542d719f38f5e09a376a580cad7f", "0x12968f3eccaa27e44f14d5aaac6ecb70c00d040e07536292e685d7cab03fc563", "0x2110a023c8c22fd2ed70270a2d0a265b92a32ce2217ffe1be9a5d7d5c25f512f", "0x1e8cf4c60c53900f0430d5b44de5804fe8b38299bc803beeb4216e1a289cf624", "0x12301cb908ccb28a2616e29b831ec7105b5d3ebf45ff5fe91d50a9dd53a50b52", "0x0f1029ed107d84ff2d6d4a416cbd01da3f3d7bf5b2209ce93ba424f4b85616fc", "0x1b431d016611b8abd684afd9e92331c3325967b1116bfa91d4f44e2f8e2c9fc2", "0x281e335a0fd117064c8ace3f01e02b134a19e9b9220571ebfaaaa0e3a12d34db", "0x22559c106f77e2ae95677d5e38e288343e3b7168371aec7d3aaab9ef8150af70", "0x13f113b1d9b590149cf08c3f6e90589cda5c7b98528866b891256cb9d5d814e7", "0x10252ef388e4c80246962e98b9e976fab2cd25e1e6f1e3fd2a7d4786c5218a97", "0x16b890723dfdebd9912a9207255f95cb800222165b6fae97ec46e461f23e83f3", "0x25caf77c7d2e8e069341ec90f3c8f6d64319cfd2d77cab0625cf0377285ba11c", "0x016c84288b0bc3c50eebbe250cdd5a4ee50b2c65a24ac64d0c930cbdecb95141", "0x20a537c045b069d47dc6315f45b391f60681222381e5059ec7c8b17bf677d911", "0x2594c0edfcd4064d215a3d797bc8e3b2f401c61f3961ae96ccbec8f8fd29e81f", "0x1c831d7047483ca00ed59bdb84c47ffb8bbebbae92aa164c7b35fcffbb8a35d3", "0x2ea7f60de52b8cd6b0bd06f861fc1f2c5ed1d1fbfa53caccdb836400a03df434", "0x275c6c8bd115f7d2ce196439e2330fad305c6745bab0bf1ce3f2fa32dadc3c43", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x2b3f4e210619347288731e7f0eea1ae60dd8696fe87319044864d099a03a9536", "0x0fecd3d2aebedeb8be2b0b7e3a74de9ec8bd2cb72851541463729e0715aef48b", "0x10bee385ad0c2cd3ff88ef4d630840749e4367f9add4a300fc4f545a7778e92c", "0x1fe792730eeafbd22c4eb80e86e2b40108b1e55b2a08db786289eea5745b9e3b", "0x04d411679da432816b213cd5580dda1fd6c2f258684c036be19b5b26baca583c", "0x159f17b655d2b8a803e0cfb564918628be52d3baa950ca1b127854491624f8f4", "0x225340463867d9252a1269013536e2e1dd219aa18eadef13c324b63d44679334", "0x1885e231554e02abb40ed54b72ebf09b883d0298a6bc06fc645a30365f370ef2", "0x233344517f25170972b8ba35d01f2df2e073d322993abce7df26796126e93498", "0x08990e8faa13b18b4433ec417c5cc596885e11ffd372d5f612c08cc79a5d5c80", "0x1e960a0c892b755c28e21dcbed816c1b182d7da43bae07f8ee622bd4485f79e7", "0x27b58e2ee290a179d349ace82752528b2ff946d60c092b99ef42f53c25d0c99f", "0x2a5cf8a3193107d982edd253002c7a52ab876b445dde8307ab78fbdca022d93c", "0x2b1ab4d5277f8c82750c1c7bd043889b71465ec64a9afc1bfa37d06b1ebd0725", "0x2a0dbf5c4373a58a83d5f2a031ea0615bf12800e33b70c3191a7cbb15966ced8", "0x1f272bb4a19d14a0abdfebc9fc83125e10623b9aef730f8d25f2bf5bead38ea9", "0x2c2339cf0ae7aff56091a568c1e2c3f01f52d8ed13400737fd31eaabcaffb9bd", "0x21f5fefe6b5fa0b5da71089befb74a1a39e52b4f830cb330c3c284e154614dfd", "0x1e6f6ba4b2444586b380dc4e2b3fad111ff1f4754420a846f53ea0789ebfb0ad", "0x1193d170b0b2dd0c4a04331a4b4aa3f12920f182ec3ab547837e30f1116ca584", "0x00000000000000000000000000000025704a15c9e2ce8a69558e7bbcdcbc7784", "0x2e5d36112770fb6c985681cafe40a8c99ad13f702309e7969801dd0ed080e727", "0x0eefc2585f591bb457183134e19ad643966272234d645514bf7868d6dd8ae2cb", "0x300803e4e2339ad39b9c31f228949bbeaf9c74b7101e7be1930b088126247eaa", "0x2bb562a50ed944b438b83b01f200101a34faef7f296a75c84c731755ebddbc1a", "0x1288e0b9c742af39cbcac21357c1b29511b0bbdd3d0e3cf5e14b2eef68a28ab3", "0x20f089131cc96d86ff1cfb67fa3f51670f4bad30158751b2587354bbec76cdf9", "0x1a26c6d3e633f9bf8434cf755b5f1217dad0d455071a97a7bcf85b824f5cf07a", "0x0d7e9b8a51fccf910ec25bdbd13e70b34bd6ea6f4d629fa744f9cdf5f2beb1cf", "0x0b40f28ce428e64df9cf5a024133fc420f39decf5f6af020cc3211ab298d4631", "0x0ca4f189dde7a55fe829f46681232904f6670249a22e0deb47222bd309523a8a", "0x2c544f2e31143783977645edb2a6bdb39b875053963bfa1a5b3ae9de204a7ebe", "0x00aae4454eb48fb18ff60db6b9d015abea2e770a2f7d86d121522b834c791ba5", "0x07d74e351fd4cccf4e18475d25211efa8a359066fc693a5c8505ddb507e4b74b", "0x07d74e351fd4cccf4e18475d25211efa8a359066fc693a5c8505ddb507e4b74b", "0x2d9e5bff47207d82533e2445959941181cc890c5779bc7f24d6e8a7b9e425b5c", "0x0aea3c0c317c441a5775a9849108d7a6889b39128235f717b09b184aa08e4eb7", "0x1ca5bc6fb37c55a562f4991901c39902f42d14db71284116df74cb4e7d55e493", "0x220fed26d64cd69f40e6d145a423e4a3c8cd0dce747e7d51647441270ad4d774", "0x15be574c9358889257aa2a30ff7b5fcc31a57da7032296e2c1201c49a44bbdb6", "0x2de539925525bedd3b7f43a9c6bf0f713151a17f79ac7ff4a9cd27b15ffe892a", "0x083086693dbf465211741e2cbff70ff38eb08383faf22d397eb2742c8ad7396a", "0x1fdfa258a890598816e807c50058d7a1462edd5ff196a2eae0f862e454b49aa1", "0x10c434c6daaa8226fa8e3e302123dfdc4455cf68063df518949df5a65a945213", "0x0000000000000000000000000000006472a7874de2c454a4591ed7784df1c104", "0x000000000000000000000000000000000008c46ac53d2c4ad0c26a5d6c790082", "0x0000000000000000000000000000005e422f9cfb8725800de60dfe0a8d4104c0", "0x000000000000000000000000000000000000f10fd4e4de81a0c00073ec91c274", "0x000000000000000000000000000000b20813090eca76bc6aa4a699b1ec8d5d6d", "0x0000000000000000000000000000000000292cc9f8a744eb00e0903c29ce87a7", "0x000000000000000000000000000000350a368b415fbb99fa90a26a42b1a3affd", "0x0000000000000000000000000000000000280eb9275cb05a3435f464d1dc369d", "0x000000000000000000000000000000280df6505e20c7725fe6d29439f96ee05d", "0x000000000000000000000000000000000017ef5033a08535451e2747827aa94b", "0x0000000000000000000000000000002f9ba89ae91b4e4a4ff8ccbd0526faad2f", "0x00000000000000000000000000000000001c2013561dafcc02cb03220bdf23c4", "0x000000000000000000000000000000aac102c400f9e5da0321ded4510994434b", "0x00000000000000000000000000000000001ec8ab9cc834b492fde124962f04a1", "0x0000000000000000000000000000000673dbd698da8b8cce450d2a083aba9987", "0x00000000000000000000000000000000000a49e55bb040249cb41c63cea901cd", "0x000000000000000000000000000000133d92af8d76ee0c74a12081ee7b2ef8c4", "0x0000000000000000000000000000000000240f552d1c6cbb007650e4b142e0a5", "0x000000000000000000000000000000e29c6e7d982ec08d51c79d6261c28d742d", "0x000000000000000000000000000000000021baeec04d9be419c923626034e7b3", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x1e940a528b42d8230e7d4dff76262a80986c0d00b2c02a9bc0559e36212d1547", "0x1ceccf21ac39f70d76ad6f7fe0dcb33b6af04555a0b1959e4714d65925e4e253", "0x096139d757046cdbdb7ee89a95f112f70882a43a46c2f739d9be115dda013420", "0x2f9c8ac67c7825b08eff0e7f7656a671f4c64e5601f2efab35b1b795801eec04", "0x2077e648e1704851cdffd7e6e56311634a7b741bab77ca34d9dff12a6a2bfe99", "0x115d48c4a97aeb3c447a060f9e0d675b0dc7f4a05a3f5776e2f279f3a165d7dc", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000fd38c45c3ec5b841482a80e3a56ce82555", "0x00000000000000000000000000000000000ad70b03f092f60af3e0ce1bb29d2c", "0x0000000000000000000000000000007a184d5342c90c634c0b1a050f0b97c9fb", "0x0000000000000000000000000000000000271f42abcb3bc1f0332e4b3ca85e1d", "0x0000000000000000000000000000008256322bbe2c1b8cd9d84e5ff6123477f2", "0x000000000000000000000000000000000025cab962761681dd9547f4c78814df", "0x0000000000000000000000000000008c4234510e5825c02b9ac427bcbf8e279a", "0x000000000000000000000000000000000013a14e0d7fc073c44643af38cc5396"] -public_inputs = ["0x0000000000000000000000000000000000000000000000000000000000000003"] -verification_key = ["0x0000000000000000000000000000000000000000000000000000000000000040", "0x0000000000000000000000000000000000000000000000000000000000000011", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000003", "0x0000000000000000000000000000000000000000000000000000000000000004", "0x0000000000000000000000000000000000000000000000000000000000000005", "0x0000000000000000000000000000000000000000000000000000000000000006", "0x0000000000000000000000000000000000000000000000000000000000000007", "0x0000000000000000000000000000000000000000000000000000000000000008", "0x0000000000000000000000000000000000000000000000000000000000000009", "0x000000000000000000000000000000000000000000000000000000000000000a", "0x000000000000000000000000000000000000000000000000000000000000000b", "0x000000000000000000000000000000000000000000000000000000000000000c", "0x000000000000000000000000000000000000000000000000000000000000000d", "0x000000000000000000000000000000000000000000000000000000000000000e", "0x000000000000000000000000000000000000000000000000000000000000000f", "0x0000000000000000000000000000000000000000000000000000000000000010", "0x00000000000000000000000000000060e430ad1c23bfcf3514323aae3f206e84", "0x00000000000000000000000000000000001b5c3ff4c2458d8f481b1c068f27ae", "0x000000000000000000000000000000bb510ab2112def34980e4fc6998ad9dd16", "0x00000000000000000000000000000000000576e7c105b43e061e13cb877fefe1", "0x000000000000000000000000000000ced074785d11857b065d8199e6669a601c", "0x00000000000000000000000000000000000053b48a4098c1c0ae268f273952f7", "0x000000000000000000000000000000d1d4b26e941db8168cee8f6de548ae0fd8", "0x00000000000000000000000000000000001a9adf5a6dadc3d948bb61dfd63f4c", "0x0000000000000000000000000000009ce1faac6f8de6ebb18f1db17372c82ad5", "0x00000000000000000000000000000000002002681bb417184b2df070a16a3858", "0x000000000000000000000000000000161baa651a8092e0e84725594de5aba511", "0x00000000000000000000000000000000000be0064399c2a1efff9eb0cdcb2223", "0x0000000000000000000000000000008673be6fd1bdbe980a29d8c1ded54381e7", "0x000000000000000000000000000000000008a5158a7d9648cf1d234524c9fa0c", "0x0000000000000000000000000000002b4fce6e4b1c72062b296d49bca2aa4130", "0x00000000000000000000000000000000002e45a9eff4b6769e55fb710cded44f", "0x00000000000000000000000000000072b85bf733758b76bcf97333efb85a23e3", "0x000000000000000000000000000000000017da0ea508994fc82862715e4b5592", "0x00000000000000000000000000000094fa74695cf058dba8ff35aec95456c6c3", "0x0000000000000000000000000000000000211acddb851061c24b8f159e832bd1", "0x000000000000000000000000000000303b5e5c531384b9a792e11702ad3bcab0", "0x00000000000000000000000000000000000d336dff51a60b8833d5d7f6d4314c", "0x0000000000000000000000000000009f825dde88092070747180d581c342444a", "0x0000000000000000000000000000000000237fbd6511a03cca8cac01b555fe01", "0x0000000000000000000000000000007c313205159495df6d8de292079a4844ff", "0x000000000000000000000000000000000018facdfc468530dd45e8f7a1d38ce9", "0x0000000000000000000000000000000d1ce33446fc3dc4ab40ca38d92dac74e1", "0x00000000000000000000000000000000000852d8e3e0e8f4435af3e94222688b", "0x0000000000000000000000000000006c04ee19ec1dfec87ed47d6d04aa158de2", "0x000000000000000000000000000000000013240f97a584b45184c8ec31319b5f", "0x000000000000000000000000000000cefb5d240b07ceb4be26ea429b6dc9d9e0", "0x00000000000000000000000000000000002dad22022121d689f57fb38ca21349", "0x000000000000000000000000000000c9f189f2a91aeb664ce376d8b157ba98f8", "0x00000000000000000000000000000000002531a51ad54f124d58094b219818d2", "0x000000000000000000000000000000ef1e6db71809307f677677e62b4163f556", "0x0000000000000000000000000000000000272da4396fb2a7ee0638b9140e523d", "0x0000000000000000000000000000002e54c0244a7732c87bc4712a76dd8c83fb", "0x000000000000000000000000000000000007db77b3e04b7eba9643da57cbbe4d", "0x000000000000000000000000000000e0dfe1ddd7f74ae0d636c910c3e85830d8", "0x00000000000000000000000000000000000466fa9b57ec4664abd1505b490862", "0x0000000000000000000000000000009ee55ae8a32fe5384c79907067cc27192e", "0x00000000000000000000000000000000000799d0e465cec07ecb5238c854e830", "0x0000000000000000000000000000001d5910ad361e76e1c241247a823733c39f", "0x00000000000000000000000000000000002b03f2ccf7507564da2e6678bef8fe", "0x000000000000000000000000000000ee40d90bea71fba7a412dd61fcf34e8ceb", "0x0000000000000000000000000000000000140b0936c323fd2471155617b6af56", "0x0000000000000000000000000000002b90071823185c5ff8e440fd3d73b6fefc", "0x00000000000000000000000000000000002b6c10790a5f6631c87d652e059df4", "0x00000000000000000000000000000029a17181c7934fc3fdbd352eac5cb521b9", "0x00000000000000000000000000000000001f497cbf5284ff29a2d336e5991999", "0x000000000000000000000000000000072bd9c0c6beda1fdee6d4ff0432ba9e1b", "0x000000000000000000000000000000000013ea38a0bd2aa751a490a724fac818", "0x000000000000000000000000000000c599f63dcd3edd49f08ae5c3141c1e3493", "0x00000000000000000000000000000000002bdb36be0bea09950dd32a8ccf6fbc", "0x00000000000000000000000000000047f27f29724e7f19eba0340256a0bd4b7d", "0x00000000000000000000000000000000001c1c5ccf87a962129ca785f8f35120", "0x000000000000000000000000000000c5c71efdae00679bbe4a95096e012b1817", "0x000000000000000000000000000000000017a365de041e317817d0135f2b48e0", "0x0000000000000000000000000000008ae711ac402f7848d719c93a89ba8d39f1", "0x00000000000000000000000000000000002b6fb40ed8a1935226f4f9786a0499", "0x0000000000000000000000000000002f03a71501d83de1da5715a4e9462d6198", "0x00000000000000000000000000000000001644064443b8546f48eae693af47b8", "0x00000000000000000000000000000083763ab1b6e8fe269b2fe4c7b9c448c08d", "0x000000000000000000000000000000000021d7cc18c59676a8eeb47c0111c251", "0x000000000000000000000000000000b5f937153073e03ea7d51a996e0ebc2e6b", "0x000000000000000000000000000000000011ddd0e26457373eb06e0493177672", "0x000000000000000000000000000000c5f6eb9f6fc8fa99811a4a88c74a6d018b", "0x000000000000000000000000000000000025bcd07a0732c123567834f5109558", "0x000000000000000000000000000000aeb08a0b1a4442189448b4e97490568146", "0x000000000000000000000000000000000002a1744e4771705536a88f07e0f90f", "0x000000000000000000000000000000b938568293bd0724b0ea76c2ec34c4a829", "0x0000000000000000000000000000000000053296e8f3b9ad3af877dfa9c7c2a7", "0x000000000000000000000000000000f0ca1db6323996eba26bdc86dafef9d10b", "0x00000000000000000000000000000000001441a46c58af03d5645d52721d956a", "0x0000000000000000000000000000008bbf8f884013c66c28ba09c2fbd573b656", "0x0000000000000000000000000000000000206c391ca06fac27d1908e94570243", "0x0000000000000000000000000000002d4f5aaed88ba4f79612d53b804ca8f194", "0x00000000000000000000000000000000001674011c96392df08970fa6b7b4cb8", "0x0000000000000000000000000000009f88297c1729d76c4d9306853598c91325", "0x0000000000000000000000000000000000256f51adfcacc3c1e340be4d32d3e9", "0x0000000000000000000000000000000ab9955eec0d74eb799afed2a802b24d75", "0x00000000000000000000000000000000001fcbe43ea105b30d36ed0b21b03411", "0x000000000000000000000000000000d66b1d5433f1aa5305cd1edce7c22de466", "0x00000000000000000000000000000000002331546a256b8a3b751956806680d4", "0x000000000000000000000000000000e97954ad6cd6f45fb15c91434121db4304", "0x00000000000000000000000000000000002e20a97e09d50f227ced47e7a98250", "0x0000000000000000000000000000001ebbc27eb9ebededefba79522eb58ae89b", "0x0000000000000000000000000000000000090efa4974e566e81d1177b85a30be", "0x0000000000000000000000000000005eafa070b9c9632404052642e3bc14f9fd", "0x00000000000000000000000000000000001489068864102daca6a6b8bc4d448b", "0x0000000000000000000000000000009ebc91aaaac036a6477cadbe54e8556dfd", "0x00000000000000000000000000000000000ef6d835e2ed3343b95c82c8c54037", "0x00000000000000000000000000000033b28b529dff46e93af4e7422530478e4a", "0x000000000000000000000000000000000020a86c2f8591bf190bcddcc03c42fb", "0x000000000000000000000000000000a9679d0acc088f7dc27bf6d866bcd2dda2", "0x00000000000000000000000000000000002fb9d0d2d4099402bed74f738f64cc", "0x00000000000000000000000000000023b09f876a29a061582848a8b9a5870c12", "0x00000000000000000000000000000000001d5bb906f03f0d49e9c4791bc43af9", "0x00000000000000000000000000000017aac9854ea240d8ec97bf760c4d4ba870", "0x00000000000000000000000000000000000b227a556c414ada0dc75bb303e30e", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000009b624fa65d1a24b7f14a8f25f3789622af", "0x000000000000000000000000000000000013d47bff8c630e847b70e2732fd3f0", "0x00000000000000000000000000000061d21663e93132f32921075f4c936a84df", "0x00000000000000000000000000000000001a74ca4e118fb480b9b999902989a3"] -proof_b = ["0x0000000000000000000000000000000000000000000000000000000000000040", "0x0000000000000000000000000000000000000000000000000000000000000011", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000042ab5d6d1986846cf", "0x00000000000000000000000000000000000000000000000b75c020998797da78", "0x0000000000000000000000000000000000000000000000005a107acb64952eca", "0x000000000000000000000000000000000000000000000000000031e97a575e9d", "0x00000000000000000000000000000000000000000000000b5666547acf8bd5a4", "0x00000000000000000000000000000000000000000000000c410db10a01750aeb", "0x00000000000000000000000000000000000000000000000d722669117f9758a4", "0x000000000000000000000000000000000000000000000000000178cbf4206471", "0x000000000000000000000000000000000000000000000000e91b8a11e7842c38", "0x000000000000000000000000000000000000000000000007fd51009034b3357f", "0x000000000000000000000000000000000000000000000009889939f81e9c7402", "0x0000000000000000000000000000000000000000000000000000f94656a2ca48", "0x000000000000000000000000000000000000000000000006fb128b46c1ddb67f", "0x0000000000000000000000000000000000000000000000093fe27776f50224bd", "0x000000000000000000000000000000000000000000000004a0c80c0da527a081", "0x0000000000000000000000000000000000000000000000000001b52c2020d746", "0x0000000000000000000000000000005a9bae947e1e91af9e4033d8d6aa6ed632", "0x000000000000000000000000000000000025e485e013446d4ac7981c88ba6ecc", "0x000000000000000000000000000000ff1e0496e30ab24a63b32b2d1120b76e62", "0x00000000000000000000000000000000001afe0a8a685d7cd85d1010e55d9d7c", "0x000000000000000000000000000000b0804efd6573805f991458295f510a2004", "0x00000000000000000000000000000000000c81a178016e2fe18605022d5a8b0e", "0x000000000000000000000000000000eba51e76eb1cfff60a53a0092a3c3dea47", "0x000000000000000000000000000000000022e7466247b533282f5936ac4e6c15", "0x00000000000000000000000000000071b1d76edf770edff98f00ff4deec264cd", "0x00000000000000000000000000000000001e48128e68794d8861fcbb2986a383", "0x000000000000000000000000000000d3a2af4915ae6d86b097adc377fafda2d4", "0x000000000000000000000000000000000006359de9ca452dab3a4f1f8d9c9d98", "0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491", "0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6", "0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1", "0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7", "0x0000000000000000000000000000006cf7dd96d7636fda5953191b1ad776d491", "0x00000000000000000000000000000000001633d881a08d136e834cb13a28fcc6", "0x00000000000000000000000000000001254956cff6908b069fca0e6cf1c47eb1", "0x000000000000000000000000000000000006f4d4dd3890e997e75e75886bf8f7", "0x000000000000000000000000000000f968b227a358a305607f3efc933823d288", "0x00000000000000000000000000000000000eaf8adb390375a76d95e918b65e08", "0x000000000000000000000000000000bb34b4b447aae56f5e24f81c3acd6d547f", "0x00000000000000000000000000000000002175d012746260ebcfe339a91a81e1", "0x00000000000000000000000000000052eebbd1f6f7554e837f60c44000ed14b6", "0x00000000000000000000000000000000001c1c045a3ec94b8801f2272cc0b3f4", "0x0000000000000000000000000000004d2ef74134578f6b431a9df071ffca4292", "0x0000000000000000000000000000000000291326ade7aa6f0dfc8900eab5580b", "0x0000000000000000000000000000002433eec6418a6dba820c9527e2581fc8bc", "0x00000000000000000000000000000000000e88b7daad19af2ac2f9bdf9e50ee2", "0x000000000000000000000000000000dcfce2c427155cc3e4d035735d3dd5ece8", "0x00000000000000000000000000000000002d7d473cac1a15d0fee8b22c1a7b3e", "0x1a4249b90be4602c8ff40c7c276160ee41b2a0f8a238ce7706e9face2db03d48", "0x162204b9d54d3ffd285c393a5a1ff76ee681474fd780a21a3cf7fac5c24fc2b9", "0x30279eb953d8ee79b2155c69c04e6443c5de6bf7e02886256dd7b3cd3c9502a4", "0x0d32c1bd21baf43e72d5d82d461ef54833807ff81a877adc822f27a6db88d754", "0x0fe15e055c0803d5ebe6dd77689b70cfd82138f008810ce24535c992daaff27d", "0x1fba82c012671212ce2fc13fd09bf8fba4f7d5875ab8d37495d1ccfcff287331", "0x090738a5842fa4d2699b3726aa0dd97cb59569b4be2c6825335ec4969f859dc2", "0x0c6cb72dabbc28abcf4a50c203534e066c29f48c24ca64d672092f263df3f9d7", "0x0f27fbea0d9145f815c288b50fe7e8c10b8185d325b5264624fd57102855d05d", "0x2a815cd3fd1c43c72ee0130465250ff771d1e7be2347e4ada331b83265a03450", "0x148b4ecf2ad7ed17409417086867ee27bc1b0906dbc9cbb3714c285071e2db70", "0x08e700a42b1d6d36ee65f8ebedf47d3a44463ff9fa579dce13b7492e20142c3a", "0x2e23c69521d572ff2152c50f8c9a9191535f4cf37f95f1e0428692e78842b642", "0x14519e0354365923fb41400c19866135b45e975d56a0980260bc99f0390b1d5f", "0x04caded1f05738f736cb5bcf08d785e395e58eb7738523a20638aa16bc51593e", "0x28787eaccd38383215ea21ec02895c32d979f68ca155f534a2e2d377bff6698b", "0x20a1b81fa96c58cf11c5762c5ceb731efdcb081fca2d34d5c463d2cf40e6da18", "0x11789a06fe3bf53833741d180f068d29534d5bb58a5c64b8119542e62b189fb4", "0x23d00fcd032ace719ffcbc513bfa177a55b04377d76455c2788d999d05d011e2", "0x01f0e81b57b4a73cc118e51ede18f8724debf25c2d109db6ef45280f99f1a3fa", "0x156d1c9b61749810de728f259c2c1c1fd4dbff97101426e26087ca461c93307c", "0x1c5d619ac3a478cfd06d5eebfd879960bb321236be173813f5e78d1366d32c69", "0x250cfae4e1dfc551406f1f3d10b649a637dcb7bcb0f6f697994cf96afd35d0c1", "0x242b999f58cf5f53c874d1092bd38725aa9ea076f5bc8f176efa9ea23393874b", "0x2e15748255c4a5e0e9fe38047341b692a967257de27a85a3a38681bc9f1602ea", "0x01ef83886ea7017253699cb6371988eb8e21b4f7023d7479ece4907fe6d4a6fd", "0x08db2dbc271e375b9312f695c59c48f313235b3432cad50921c8d9ad6dd7ad7a", "0x199309f2c2cd45c15a4abb0e6554a1615ff5a6e9488a8d900bbf835fc8f664ef", "0x074be7a3d88e31ab1b59c9208c012bcfb1f85f351c709e68134996891db52b57", "0x301b1011354d2ebf46134fc4d6d734bb6ed8542d719f38f5e09a376a580cad7f", "0x12968f3eccaa27e44f14d5aaac6ecb70c00d040e07536292e685d7cab03fc563", "0x2110a023c8c22fd2ed70270a2d0a265b92a32ce2217ffe1be9a5d7d5c25f512f", "0x1e8cf4c60c53900f0430d5b44de5804fe8b38299bc803beeb4216e1a289cf624", "0x12301cb908ccb28a2616e29b831ec7105b5d3ebf45ff5fe91d50a9dd53a50b52", "0x0f1029ed107d84ff2d6d4a416cbd01da3f3d7bf5b2209ce93ba424f4b85616fc", "0x1b431d016611b8abd684afd9e92331c3325967b1116bfa91d4f44e2f8e2c9fc2", "0x281e335a0fd117064c8ace3f01e02b134a19e9b9220571ebfaaaa0e3a12d34db", "0x22559c106f77e2ae95677d5e38e288343e3b7168371aec7d3aaab9ef8150af70", "0x13f113b1d9b590149cf08c3f6e90589cda5c7b98528866b891256cb9d5d814e7", "0x10252ef388e4c80246962e98b9e976fab2cd25e1e6f1e3fd2a7d4786c5218a97", "0x16b890723dfdebd9912a9207255f95cb800222165b6fae97ec46e461f23e83f3", "0x25caf77c7d2e8e069341ec90f3c8f6d64319cfd2d77cab0625cf0377285ba11c", "0x016c84288b0bc3c50eebbe250cdd5a4ee50b2c65a24ac64d0c930cbdecb95141", "0x20a537c045b069d47dc6315f45b391f60681222381e5059ec7c8b17bf677d911", "0x2594c0edfcd4064d215a3d797bc8e3b2f401c61f3961ae96ccbec8f8fd29e81f", "0x1c831d7047483ca00ed59bdb84c47ffb8bbebbae92aa164c7b35fcffbb8a35d3", "0x2ea7f60de52b8cd6b0bd06f861fc1f2c5ed1d1fbfa53caccdb836400a03df434", "0x275c6c8bd115f7d2ce196439e2330fad305c6745bab0bf1ce3f2fa32dadc3c43", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x2b3f4e210619347288731e7f0eea1ae60dd8696fe87319044864d099a03a9536", "0x0fecd3d2aebedeb8be2b0b7e3a74de9ec8bd2cb72851541463729e0715aef48b", "0x10bee385ad0c2cd3ff88ef4d630840749e4367f9add4a300fc4f545a7778e92c", "0x1fe792730eeafbd22c4eb80e86e2b40108b1e55b2a08db786289eea5745b9e3b", "0x04d411679da432816b213cd5580dda1fd6c2f258684c036be19b5b26baca583c", "0x159f17b655d2b8a803e0cfb564918628be52d3baa950ca1b127854491624f8f4", "0x225340463867d9252a1269013536e2e1dd219aa18eadef13c324b63d44679334", "0x1885e231554e02abb40ed54b72ebf09b883d0298a6bc06fc645a30365f370ef2", "0x233344517f25170972b8ba35d01f2df2e073d322993abce7df26796126e93498", "0x08990e8faa13b18b4433ec417c5cc596885e11ffd372d5f612c08cc79a5d5c80", "0x1e960a0c892b755c28e21dcbed816c1b182d7da43bae07f8ee622bd4485f79e7", "0x27b58e2ee290a179d349ace82752528b2ff946d60c092b99ef42f53c25d0c99f", "0x2a5cf8a3193107d982edd253002c7a52ab876b445dde8307ab78fbdca022d93c", "0x2b1ab4d5277f8c82750c1c7bd043889b71465ec64a9afc1bfa37d06b1ebd0725", "0x2a0dbf5c4373a58a83d5f2a031ea0615bf12800e33b70c3191a7cbb15966ced8", "0x1f272bb4a19d14a0abdfebc9fc83125e10623b9aef730f8d25f2bf5bead38ea9", "0x2c2339cf0ae7aff56091a568c1e2c3f01f52d8ed13400737fd31eaabcaffb9bd", "0x21f5fefe6b5fa0b5da71089befb74a1a39e52b4f830cb330c3c284e154614dfd", "0x1e6f6ba4b2444586b380dc4e2b3fad111ff1f4754420a846f53ea0789ebfb0ad", "0x1193d170b0b2dd0c4a04331a4b4aa3f12920f182ec3ab547837e30f1116ca584", "0x00000000000000000000000000000025704a15c9e2ce8a69558e7bbcdcbc7784", "0x2e5d36112770fb6c985681cafe40a8c99ad13f702309e7969801dd0ed080e727", "0x0eefc2585f591bb457183134e19ad643966272234d645514bf7868d6dd8ae2cb", "0x300803e4e2339ad39b9c31f228949bbeaf9c74b7101e7be1930b088126247eaa", "0x2bb562a50ed944b438b83b01f200101a34faef7f296a75c84c731755ebddbc1a", "0x1288e0b9c742af39cbcac21357c1b29511b0bbdd3d0e3cf5e14b2eef68a28ab3", "0x20f089131cc96d86ff1cfb67fa3f51670f4bad30158751b2587354bbec76cdf9", "0x1a26c6d3e633f9bf8434cf755b5f1217dad0d455071a97a7bcf85b824f5cf07a", "0x0d7e9b8a51fccf910ec25bdbd13e70b34bd6ea6f4d629fa744f9cdf5f2beb1cf", "0x0b40f28ce428e64df9cf5a024133fc420f39decf5f6af020cc3211ab298d4631", "0x0ca4f189dde7a55fe829f46681232904f6670249a22e0deb47222bd309523a8a", "0x2c544f2e31143783977645edb2a6bdb39b875053963bfa1a5b3ae9de204a7ebe", "0x00aae4454eb48fb18ff60db6b9d015abea2e770a2f7d86d121522b834c791ba5", "0x07d74e351fd4cccf4e18475d25211efa8a359066fc693a5c8505ddb507e4b74b", "0x07d74e351fd4cccf4e18475d25211efa8a359066fc693a5c8505ddb507e4b74b", "0x2d9e5bff47207d82533e2445959941181cc890c5779bc7f24d6e8a7b9e425b5c", "0x0aea3c0c317c441a5775a9849108d7a6889b39128235f717b09b184aa08e4eb7", "0x1ca5bc6fb37c55a562f4991901c39902f42d14db71284116df74cb4e7d55e493", "0x220fed26d64cd69f40e6d145a423e4a3c8cd0dce747e7d51647441270ad4d774", "0x15be574c9358889257aa2a30ff7b5fcc31a57da7032296e2c1201c49a44bbdb6", "0x2de539925525bedd3b7f43a9c6bf0f713151a17f79ac7ff4a9cd27b15ffe892a", "0x083086693dbf465211741e2cbff70ff38eb08383faf22d397eb2742c8ad7396a", "0x1fdfa258a890598816e807c50058d7a1462edd5ff196a2eae0f862e454b49aa1", "0x10c434c6daaa8226fa8e3e302123dfdc4455cf68063df518949df5a65a945213", "0x0000000000000000000000000000006472a7874de2c454a4591ed7784df1c104", "0x000000000000000000000000000000000008c46ac53d2c4ad0c26a5d6c790082", "0x0000000000000000000000000000005e422f9cfb8725800de60dfe0a8d4104c0", "0x000000000000000000000000000000000000f10fd4e4de81a0c00073ec91c274", "0x000000000000000000000000000000b20813090eca76bc6aa4a699b1ec8d5d6d", "0x0000000000000000000000000000000000292cc9f8a744eb00e0903c29ce87a7", "0x000000000000000000000000000000350a368b415fbb99fa90a26a42b1a3affd", "0x0000000000000000000000000000000000280eb9275cb05a3435f464d1dc369d", "0x000000000000000000000000000000280df6505e20c7725fe6d29439f96ee05d", "0x000000000000000000000000000000000017ef5033a08535451e2747827aa94b", "0x0000000000000000000000000000002f9ba89ae91b4e4a4ff8ccbd0526faad2f", "0x00000000000000000000000000000000001c2013561dafcc02cb03220bdf23c4", "0x000000000000000000000000000000aac102c400f9e5da0321ded4510994434b", "0x00000000000000000000000000000000001ec8ab9cc834b492fde124962f04a1", "0x0000000000000000000000000000000673dbd698da8b8cce450d2a083aba9987", "0x00000000000000000000000000000000000a49e55bb040249cb41c63cea901cd", "0x000000000000000000000000000000133d92af8d76ee0c74a12081ee7b2ef8c4", "0x0000000000000000000000000000000000240f552d1c6cbb007650e4b142e0a5", "0x000000000000000000000000000000e29c6e7d982ec08d51c79d6261c28d742d", "0x000000000000000000000000000000000021baeec04d9be419c923626034e7b3", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000001", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000002", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x1e940a528b42d8230e7d4dff76262a80986c0d00b2c02a9bc0559e36212d1547", "0x1ceccf21ac39f70d76ad6f7fe0dcb33b6af04555a0b1959e4714d65925e4e253", "0x096139d757046cdbdb7ee89a95f112f70882a43a46c2f739d9be115dda013420", "0x2f9c8ac67c7825b08eff0e7f7656a671f4c64e5601f2efab35b1b795801eec04", "0x2077e648e1704851cdffd7e6e56311634a7b741bab77ca34d9dff12a6a2bfe99", "0x115d48c4a97aeb3c447a060f9e0d675b0dc7f4a05a3f5776e2f279f3a165d7dc", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000fd38c45c3ec5b841482a80e3a56ce82555", "0x00000000000000000000000000000000000ad70b03f092f60af3e0ce1bb29d2c", "0x0000000000000000000000000000007a184d5342c90c634c0b1a050f0b97c9fb", "0x0000000000000000000000000000000000271f42abcb3bc1f0332e4b3ca85e1d", "0x0000000000000000000000000000008256322bbe2c1b8cd9d84e5ff6123477f2", "0x000000000000000000000000000000000025cab962761681dd9547f4c78814df", "0x0000000000000000000000000000008c4234510e5825c02b9ac427bcbf8e279a", "0x000000000000000000000000000000000013a14e0d7fc073c44643af38cc5396"] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/src/main.nr b/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/src/main.nr deleted file mode 100644 index 63902824da1..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_honk_proof_recursive/src/main.nr +++ /dev/null @@ -1,29 +0,0 @@ -// This circuit aggregates two Honk proofs from `assert_statement_recursive`. -global SIZE_OF_PROOF_IF_LOGN_IS_28: u32 = 463; -global HONK_IDENTIFIER: u32 = 1; -#[recursive] -fn main( - verification_key: [Field; 128], - // This is the proof without public inputs attached. - // This means: the size of this does not change with the number of public inputs. - proof: [Field; SIZE_OF_PROOF_IF_LOGN_IS_28], - public_inputs: pub [Field; 1], - key_hash: Field, - // The second proof, currently set to be identical to the first proof - proof_b: [Field; SIZE_OF_PROOF_IF_LOGN_IS_28], -) { - std::verify_proof_with_type( - verification_key, - proof, - public_inputs, - key_hash, - HONK_IDENTIFIER, - ); - std::verify_proof_with_type( - verification_key, - proof_b, - public_inputs, - key_hash, - HONK_IDENTIFIER, - ); -} diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/double_verify_proof/src/main.nr index ac79e8ecf34..8f9fbf7bec5 100644 --- a/noir/noir-repo/test_programs/execution_success/double_verify_proof/src/main.nr +++ b/noir/noir-repo/test_programs/execution_success/double_verify_proof/src/main.nr @@ -1,4 +1,4 @@ -// This circuit aggregates two proofs from `assert_statement_recursive`. +// This circuit aggregates two proofs from `assert_statement`. fn main( verification_key: [Field; 114], // This is the proof without public inputs attached. diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Nargo.toml b/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Nargo.toml deleted file mode 100644 index b7688b33bfd..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Nargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -[package] -name = "double_verify_proof_recursive" -type = "bin" -authors = [""] -[dependencies] diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Prover.toml b/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Prover.toml deleted file mode 100644 index dff48212e50..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/Prover.toml +++ /dev/null @@ -1,5 +0,0 @@ -key_hash = "0x096129b1c6e108252fc5c829c4cc9b7e8f0d1fd9f29c2532b563d6396645e08f" -proof = ["0x000000000000000000000000000000d62b795bec274279129a71195796825fcc","0x00000000000000000000000000000000000793ab763140f20a68a6bd2721fd74","0x00000000000000000000000000000053141d06d3307b36153f321511199e579c","0x00000000000000000000000000000000000a4b55d6c21f98a9c434911dcb5c67","0x0000000000000000000000000000005f9d324c0abd22cec92d99dbec438e9491","0x0000000000000000000000000000000000240dfafe1b53dc27147cbab14ea893","0x000000000000000000000000000000044a61d3aac32c6931247cf334a19d9611","0x000000000000000000000000000000000003f0f8cf4207bfa85c23ec9f8d0c88","0x00000000000000000000000000000002168a470e39ba2ac266f6b474de12045f","0x000000000000000000000000000000000025791e7d3feab542345c00ec5a30df","0x000000000000000000000000000000dcafd76d4c3640969c80e017b951ef6397","0x00000000000000000000000000000000001d27f75a1256771e88e0c86fc42dbc","0x0000000000000000000000000000007347ae7d2d9d7fc2b8f0baa014ee1fed9f","0x000000000000000000000000000000000018bd927f42bf7caf9555f56f09000d","0x000000000000000000000000000000041f765f83cbe5904c8f453f70a4531d10","0x00000000000000000000000000000000001858aabeeb5331a221419f4fed1c19","0x000000000000000000000000000000d254a54caaedf8287b9af951b2f2611121","0x000000000000000000000000000000000005ab493623c9563cf2e55ba5f18200","0x00000000000000000000000000000014f24cddc1a02440dc63637df8032c8074","0x000000000000000000000000000000000011950c16cef98471b1d78b935195a4","0x000000000000000000000000000000b0340b459e6bd5cc8f031c8654a502897f","0x00000000000000000000000000000000000e1cf3968dac4545a76a2ae58e512c","0x0000000000000000000000000000002adf7218aa06ca0d2c2e600dcc39193a2d","0x00000000000000000000000000000000001302e7e4b0f14749bd885ca25588b6","0x00000000000000000000000000000092009ce4056e79ab815d8cdfd4491138ae","0x000000000000000000000000000000000018af11e853c6cf2f0f6274b0da8133","0x000000000000000000000000000000dd3dc6f49232141718527b3a0e4b26e21d","0x00000000000000000000000000000000001a877853348a8b695c4f9a9aa4ce68","0x000000000000000000000000000000aecfc56ba07155450b368140d6324023b5","0x000000000000000000000000000000000029c11052798c57ece614617d33fcc2","0x000000000000000000000000000000eb106ffc816d16fb84e84b0b61157b2603","0x000000000000000000000000000000000026c3cac16206899a21cb5126841446","0x000000000000000000000000000000a782ed54805fe845068b362b58e2fa34ec","0x00000000000000000000000000000000000cf046a1bfcc666b7f28b572676073","0x000000000000000000000000000000b931c8dda60bb4aca4cc817f5540f1209f","0x000000000000000000000000000000000024ad50c3936fafc3d190e6a4874223","0x000000000000000000000000000000cce90cfbaf5671c8c8652db28a3a9566f7","0x000000000000000000000000000000000003574db9d0f84380c9635660f86354","0x0000000000000000000000000000003eb3e1dc31846a90f721e7a08c6d6dc4f7","0x000000000000000000000000000000000028999a700cd1abae1a288eebb9a91c","0x000000000000000000000000000000c1be4d385b11387e14eb9817050d772f78","0x000000000000000000000000000000000003c56b5bad8b4484c66ac921f1f102","0x000000000000000000000000000000ace245cabf0f00dc7fd253dd8af0377a14","0x0000000000000000000000000000000000107f1731fcf34b364c813599fa1df7","0x035b937d404932b542b706eb810ef4a7dca4566d4dde1ad6a8717f46167ead7e","0x17608cef3dc7960f41cb1295706df663727d45ee598a61e05e989d111449fb65","0x054712a950ad67da3aa860e49e6891f99b586b7f37caff94eb013fdb374b61ee","0x04b755083086c769b7f593e0e48d68dc54be808203351380ca5566a48149d8bb","0x17d7670b0915235f626fdc1d7e1134d2be906ef138d7843384b3ebc23b1d630f","0x064cf544ab5f4e3dab47960502cccc83321fb275068dfbdd3a2fcbc6dddcaa65","0x083338262712e2b66769ea40d9f412b18caa1bc81a51ff5a50b6c41f8c4b3d23","0x0cdd38958cab97defde00f4a5961b6fd676e29d9f2c352f6bb2c68b91f83f8af","0x02c8bdd005c2f43a0a8cbb2744916ce5c322dfa5b23367a829c12699f4036d32","0x25bac73c7e7b659fbea3135b7a0decf9db8dc3045bd2837dae337c64cc722546","0x19eb361aa419d37bce3d2e8b2b7692a02a9559e83d7f3d8fe9169970fbbc2cba","0x2494bd5106d00e05c7ea60e632e9fe03773b7f2c5b662aa37ec512a01f4a0775","0x18c52c2f2c6e7be1d7847c15e452a3a9c64316103d12e4b5b9a82fac4e940ee9","0x0e0342810456ef78f498c1bfa085a5f3cbc06db1f32fabd0ea9ad27dccac1680","0x024c13d6ef56af33ed7164ea8e47ddecc8a487b000d8b1b45edcd3895a503ba2","0x26e0d127f626bd39b55bc5d0c131dbf03fe006dc5c3edc57dda1e629799a4317","0x1b1140061bc52b15c4f5e100729a81968ee79dc03deb966a18850335a8e44a8b","0x1bb76f945199e71d531a89288912087a02dd0e83020e65d671485bf2e5e86e1a","0x29269900859c6d86e404185b415bf3b279cd100f38cfdb0077e8d6a299c4fd35","0x22b5e94bae2f6f0cdb424a3b12c4bf82cec3fb228e012c1974ed457827bbe012","0x18d3543a93249778e7a57936170dae85ffc47c2567f2d0076a32c0bb86fcf10a","0x03721dc2670206cde42a175fd56bcce32cf6cb8801450a8e8e4b3d4e07785973","0x2806db136dd214d3ac1478460855cae6a4324ab45cab35320d104fee26c260e8","0x1c3749f1937082afbbae9375b9be708cf339e1983e57ef4447f36cfa560c685c","0x1067b8cfb90ef08bcb48aea56b2716334241787c2004a95682d68a0685566fd0","0x0f41aee4416398f1d48ffc302403273cddef34a41f98507c53682041d82e51ff","0x10d854c9f0bfbdff7ca91a68f4978e9a79e7b14243d92f465f17bdf88d9f64f8","0x00000000000000000000000000000000018938b11099e0cdc05ddab84a153a97","0x0000000000000000000000000000000001d7dda1471f0dc3b3a3d3438c197982","0x00000000000000000000000000000000022682917da43ab9a6e9cbcece1db86d","0x2453913e6b0f36eab883ac4b0e0604d56aaeb9c55e641135173e63c342f1a660","0x05216c1b58dc43a49d01aaba3113b0e86be450fc17d28016e648e7162a1b67fb","0x152b34845a0222a2b41354c0d395a250d8363dc18748647d85acd89d6934ec56","0x1dfc6e971ce82b7dcda1f7f282713c6e22a8c79258a61209bda69719806da544","0x2968dd8b3af8e3953f1fbbd72f4c49b8270597bb27d4037adc157ac6083bee60","0x1b9425b88a4c7d39b3d75afe66917a9aa1d2055724392bc01fb918d84ff1410e","0x04ab571f236d8e750904dc307dd274003d9130f1a7110e4c1521cfb408877c73","0x2ad84f26fdc5831545272d02b806bb0e6dae44e71f73552c4eb9ff06030748c7","0x020e632b99d325db774b8630fb50b9a4e74d35b7f27d9fc02c65087ee747e42c","0x09a8c5a3171268cb61c02515c01c109889200ed13f415ae54df2078bbb887f92","0x1143281a9451abbb4c34c3fa84e7678c2af2e7ea8c05160a6f7f06988fc91af8","0x000000000000000000000000000000cbda736ca5cf6bc75413c2cc9e28ab0a68","0x00000000000000000000000000000000001ee78c9cc56aa5991062ae2e338587","0x000000000000000000000000000000bc9bfcdebb486f4cb314e681d2cc5f8df6","0x00000000000000000000000000000000000ad538431d04771bca7f633cb659ff","0x000000000000000000000000000000d45b317afcefa466a59bba9e171f1af70c","0x0000000000000000000000000000000000133c50180ea17932e4881124e7a7c6","0x000000000000000000000000000000fc9ed37f543775849f3e84eaa06f77f992","0x00000000000000000000000000000000001372873c9c051d1baff99248b8f70e"] -public_inputs = ["0x0000000000000000000000000000000000000000000000000000000000000003"] -verification_key = ["0x2b337de1c8c14f22ec9b9e2f96afef3652627366f8170a0a948dad4ac1bd5e80","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000005","0x0000000000000000000000000000000000000000000000000000000000000008","0x0000000000000000000000000000000000000000000000000000000000000001","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000000000092139c61bae1a44f0fc7689507414be688","0x00000000000000000000000000000000000160ce4e279582f91bde4f03f5e9a2","0x0000000000000000000000000000005dc2d37f658c3b2d60f24740eb13b65d79","0x000000000000000000000000000000000007e3e8a5d98a1177ec85bf88f163a5","0x000000000000000000000000000000dc3035fbd7ff16412a8fd7da587a935298","0x000000000000000000000000000000000023d08e2817ac16990004ed11d8fc66","0x000000000000000000000000000000356a5ad59c646c746a8d09f5d154e47c4f","0x00000000000000000000000000000000000708529196af3c8e16ffa580c26182","0x0000000000000000000000000000002ddfe70eb7a1280596e8e4a804f118a6dd","0x000000000000000000000000000000000013757e15a0905f298303784a161b21","0x000000000000000000000000000000a23a729df796935c7824e3a26be794829b","0x000000000000000000000000000000000005775b6c146c4a59856e869fe5a70e","0x000000000000000000000000000000eef0c9e088fd2d45aa40311082d1f2809b","0x00000000000000000000000000000000001d539ccbfc556d0ad59307a218de65","0x000000000000000000000000000000a2c848beceb6ab7806fd3b88037b8410fc","0x0000000000000000000000000000000000177004deeb1f9d401fd7b1af1a5ac8","0x0000000000000000000000000000002508eb63672a733f20de1a97644be4f540","0x00000000000000000000000000000000000d82d51f2f75d806285fd248c819b8","0x000000000000000000000000000000d002f9100cbba8a29f13b11513c53c59d0","0x000000000000000000000000000000000006cd3b0e3460533b9e5ea2cdc0fcbb","0x000000000000000000000000000000f45ea38a93b2f810c5633ddb54927c1c96","0x000000000000000000000000000000000021791de65f9a28ec7024b1a87ab4f3","0x000000000000000000000000000000926511a0439502c86885a8c6f0327aa7ad","0x000000000000000000000000000000000029fa14a969c5d81ed3abbbfb11220a","0x000000000000000000000000000000b84c3258e8206f560e5b5b18cbeafef87e","0x00000000000000000000000000000000002a910445cd8fc895e5d235cd8ea185","0x000000000000000000000000000000887e67f15e84bcb8507a5064a363f6043b","0x000000000000000000000000000000000014dc6643d801c3ef27c2066b6e2bb4","0x000000000000000000000000000000e38e900b42c314ba803088e8fbf125203f","0x000000000000000000000000000000000020690fd4869db418306046b38161dc","0x0000000000000000000000000000001e2fa856bf7951b8292b1e88185993629c","0x0000000000000000000000000000000000048a85e0bbac7c60ad3d78f601f63c","0x0000000000000000000000000000006f457719495073d3666d77a625aeab0c51","0x00000000000000000000000000000000002623ad892dc62b1fa7d0a650f0d470","0x000000000000000000000000000000dbfcc8a467e021c03b13f74a9f79c3a10c","0x0000000000000000000000000000000000295f6f10976c37bd9c6f96bb7187d5","0x000000000000000000000000000000c13ef9a937cc12420fb38d9ab8e848e85e","0x000000000000000000000000000000000003560a3b334e887532f605c9cb7628","0x0000000000000000000000000000009bcebf08a4599cdda0fb96312d4dc0c7a9","0x000000000000000000000000000000000015adc8bb1e01c835f48959d1237bd6","0x00000000000000000000000000000047762ab839e4ff63c77605a9f383da37c2","0x000000000000000000000000000000000016a8c3c53d89660cf271522cd301fb","0x000000000000000000000000000000f0c8539a0b5f94420a513f9c305b932bfe","0x00000000000000000000000000000000002957ba01d9de5638f808f88a692533","0x000000000000000000000000000000ab17c6189d67d3bf5dd2f3885de0151b6f","0x0000000000000000000000000000000000060d8aa43fdc434d1942263f364d95","0x0000000000000000000000000000005d292333b3adb497f00b4bc32d45229060","0x00000000000000000000000000000000001a1018a66221883639f2898a66f345","0x00000000000000000000000000000006555a806b1993291deba0dc44e2abf431","0x00000000000000000000000000000000000cacff7099a9d5e35a21f4a00b2dc3","0x000000000000000000000000000000f50c11ba95d349c36d143eefd12e494950","0x00000000000000000000000000000000001022e8c5f02d639bc9dd8bc4407f99","0x000000000000000000000000000000c76828795098eda73d50b4b585c60afc60","0x00000000000000000000000000000000002bf09c0ec7011e93888962f2406630","0x00000000000000000000000000000049e5c83a8978d832fb8e144548e3ca1adb","0x00000000000000000000000000000000000e0ec242c2e160a984f61ca5adf5f5","0x0000000000000000000000000000009c5d6e08a6605ab4513748ac0fa017dd1c","0x00000000000000000000000000000000001f54baa07558e5fb055bd9ba49c067","0x0000000000000000000000000000001e1ee7ee29bbb5e4b080c6091c1433ce62","0x000000000000000000000000000000000024aec62a9d9763499267dc98c33428","0x0000000000000000000000000000001a96755946ff16f0d6632365f0eb0ab4d4","0x000000000000000000000000000000000028cf3e22bcd53782ebc3e0490e27e5","0x00000000000000000000000000000043148d7d8c9ba43f2133fab4201435a364","0x0000000000000000000000000000000000234ce541f1f5117dd404cfaf01a229","0x000000000000000000000000000000a7fb95ffb461d9514a1070e2d2403982ef","0x00000000000000000000000000000000003016955028b6390f446c3fd0c5b424","0x00000000000000000000000000000008863c3b7cd7cddc20ba79ce915051c56e","0x000000000000000000000000000000000013ef666111b0be56a235983d397d2a","0x000000000000000000000000000000e3993f465fc9f56e93ac769e597b752c1c","0x0000000000000000000000000000000000217f7c4235161e9a3c16c45b6ca499","0x0000000000000000000000000000008ffa4cd96bc67b0b7df5678271e1114075","0x0000000000000000000000000000000000256467bfcb63d9fdcb5dde397757ad","0x00000000000000000000000000000054e5eb270bb64bde6e6ececadfd8c3236c","0x00000000000000000000000000000000000e52d1bd75812c33c6f3d79ee4b94c","0x000000000000000000000000000000484a2c641dce55bc2dd64ef0cd790a7fea","0x00000000000000000000000000000000000ff417d256be43e73c8b1aa85bdda3","0x0000000000000000000000000000000b72e7b7713ab5da44e0f864182e748a23","0x00000000000000000000000000000000001a221055f1625ad833a44705f5f74e","0x00000000000000000000000000000067a99a34e9b81a17ad001db02e29bcb82a","0x000000000000000000000000000000000018a6c02e398389827568fa960e86e2","0x000000000000000000000000000000bb29f26f9890d6cc6401f4921d5884edca","0x00000000000000000000000000000000000868357b28039385c5a5058b6d358e","0x00000000000000000000000000000036fb6e229dde8edf7ec858b12d7e8be485","0x00000000000000000000000000000000001060afe929554ca473103f5e68193c","0x00000000000000000000000000000015226e07e207744c0857074dcab883af4a","0x00000000000000000000000000000000000b1c02619282755533457230b19b4a","0x0000000000000000000000000000001f2a0277e4807e6e1cbabca21dde5eb5e1","0x00000000000000000000000000000000000d928deafed363659688ed4ccdef52","0x000000000000000000000000000000363f0c994e91cecad25835338edee2294f","0x00000000000000000000000000000000002eea648c8732596b1314fe2a4d2f05","0x000000000000000000000000000000b2671d2ae51d31c1210433c3972bb64578","0x00000000000000000000000000000000000ab49886c2b94bd0bd3f6ed1dbbe2c"] -proof_b = ["0x000000000000000000000000000000f05c69448ca29bdf52076f9b073bb30fed","0x000000000000000000000000000000000028c86bb3e27b4aaaaef126f7df5349","0x00000000000000000000000000000026ae031fc93594375dfc7f3bbe027f97d5","0x000000000000000000000000000000000000dd12c7290fe7f775796a233b8590","0x000000000000000000000000000000c1ee6631704de424d010c5c4ac8293ac49","0x00000000000000000000000000000000002f41818c9aa83f5c8d9bdd128015b9","0x000000000000000000000000000000b50a5801482f7e3a5de8ab3cce0f10b0d3","0x000000000000000000000000000000000022a0bc69c293dbf293b25bc9eef7f8","0x0000000000000000000000000000003b02abf1967ef394154dc15d763135e903","0x00000000000000000000000000000000000d8a2ee46acc6d1ed8d517b56d47c8","0x00000000000000000000000000000039bf0d1b3d8cf9de898f101c626e978d78","0x0000000000000000000000000000000000008faa7df2451a24d291a9b584f1a5","0x000000000000000000000000000000c1dae329ed7adf63a2d89a5f16fb98b6d8","0x00000000000000000000000000000000001ff0bc16fc0bd4aa2d6255690453c2","0x000000000000000000000000000000d12d7589f853a9b472613efa56689beaf1","0x00000000000000000000000000000000002d6fbc798f4403751df6aeee8bedd3","0x0000000000000000000000000000007c1fa069cb17194fecf88db9dd54a4ee36","0x0000000000000000000000000000000000268e026f9814822a42b2d59eec5d24","0x000000000000000000000000000000c3fb56beab774218cd63498fc050a5fd9b","0x00000000000000000000000000000000000071c014d7b5063f005a0bc2ee1af4","0x000000000000000000000000000000ae12b25371c6af42bbe0a85cddd2eaebc7","0x000000000000000000000000000000000026d270e1ffc9c7c344c694dfadda83","0x00000000000000000000000000000080280858c6be461716921caa3c26f3f6f3","0x000000000000000000000000000000000001dcdd3f39e27d0ce6aa5d14dff4c1","0x000000000000000000000000000000080e1d2c913c834ebcf7e0600c076c08fd","0x00000000000000000000000000000000002df3d142217694e65fb7c355d62764","0x000000000000000000000000000000e5e336f3f59d77e500f49771bfbeb12e83","0x000000000000000000000000000000000028fffe08bdc4c0690643d2e1a1275f","0x000000000000000000000000000000db5618b32afc13e18f21b39f3fbede9d11","0x00000000000000000000000000000000001d244818370d43fb7e8bc67e03787b","0x0000000000000000000000000000006bcc1fd3f9f78449ad1df1bc11bc379edd","0x000000000000000000000000000000000009ac9cbb285edbf5b3a973f3f5f1cb","0x000000000000000000000000000000fd885905b6c0fc95bb4dd0b11f6797d4b3","0x000000000000000000000000000000000021f07995cdd835145e19c38127c562","0x000000000000000000000000000000bbbf2b975c2c97ae4b45c4a52059e53ee3","0x000000000000000000000000000000000024158163788841cf4590bbc1e89a90","0x0000000000000000000000000000009aca93d2b1386ea412d4b36ea5bb9894a8","0x00000000000000000000000000000000002532d1d210e8ed4c2f5c00cbaaa475","0x000000000000000000000000000000634a88caa1d77cb6b5fe77cac31458fc31","0x00000000000000000000000000000000000bdf18bae92fce7cfddab5520cac6e","0x000000000000000000000000000000622e9626255170ccec77602c755aa193e1","0x000000000000000000000000000000000001d4edba370e04436a988bad05dada","0x000000000000000000000000000000b52934323a0aec8f803cdaafee2ab7bfb2","0x0000000000000000000000000000000000155312af5e0e25ca9fd61aef9e58ed","0x06270b517855f6f6a608e432883d1d1030a12a1e33022dc142b7728691421da2","0x2af7c794d7b720b25eb1df0afd8c8e3c15b6e518194c3caea7966a5f8210ff04","0x073fe573aeb27d81a5713be93e1365390dcbc3c8e7439ff1d36a84cc014f5642","0x11351b961147431e54535248b58b35cf5cddb9b13827899167617d7a96794d64","0x297c9421c9c3db286770787c35b86bc41583386491b4ae55e5fa81aefa21efc4","0x0f4eeca3ff4a3495f859898937688652d33f9b4dd3e003e12adf15278e0997c3","0x133e3d8b82721d40d919f2326810ba6f07eff3f7d20d86b2bde692a811522019","0x2c502f53c9698b73bb8c8f9b9cf2d705d16a64a7040348b4b39c637a2064316c","0x0cbc1971e1c566cde9d9125c91cdc88e817db182692f836c1a5170a6246eaf73","0x12c47793e7db706c637cd4b4d96d227f569850176b852b1fe8ad522ddb38ef0e","0x0cd7b300e9309a135285be1aeb02b152f97931a7357ab6d609a2cb1970aab877","0x2a7789dfe286c9d0a7592f1c9316e730cb14c9d843aefc4764d76e7f8571c96a","0x248ac54ce3dbf37796621882a4ac76046df5ab680da487fd85cce76b1ae392d3","0x149d1d07cebe320f77b03533e34912545cedeae62bd9778d37724728762b5710","0x00fe29daebdaed61309790e70e2dcefa3f3af4c6c965ce424b8dbcf09b8e4b49","0x2b75b3bace61b731d7f0c003a144b62b0a4fbe9f0d14ca89b0652b70210014b3","0x2588ef27cfb6e0d8c6f9a969b2da44fead30a02ed70a563fd15aa45bb671de1c","0x2b74d7674b55642697b4a1e226eddb0e4918b2d57aa5b99093dc46cadcdea000","0x244c626845d3a5040f08f01e9611f968ad675ca857789149b13a0cfa83a2e064","0x2cb8d02f90cae33fd7bcfb80af4aff067c4f5fc4b3f9228d5b8f768bc8f6c971","0x1372f3d1f04e0c39a50e823d5da03d70bebe19a1b8e28f8c2ff601cc0bfc0095","0x19af6601d2613426a50b7c35d60562a5f2f2634e6af56dac13459632e15570ee","0x13c2a16ed3b65dcd9414659be79af17995d344de34eaf962343b0f1e76c73a57","0x0dd5dcdbd50b8774831d4f01f930804d38b4266dfee085185530880a0c3903c0","0x07e91848d660b11b722638680ac60f20db9507fdc8d610ce762600f5a1aacd29","0x1f9c2a94d10c0a7fb60292cfc46fd3d2501181bea0ffe1f5f2501d474be3a785","0x14edb9c5bd389eae08a5ea2a7a1662894e1e878c142084d966a625bef68cf7c3","0x00000000000000000000000000000000cecd01810814d175f0a533f0067618c4","0x00000000000000000000000000000000f82935013ce5c82720c63e533af41db8","0x000000000000000000000000000000012185688171b6bed850e748b66f7222ac","0x2dd7f5ff2150155c2ac86ebe28d9ecbca2eea812b0021ab2bceae111cfea8325","0x04ea6c2daf2b9e827d2213c3d03953410dcf1ed67ba34a3c00e772be92606a8b","0x163f2bd18dcde52f99b9867c944780fd718d1612927053b139b280fc55013d1b","0x05e388fd160ccac30a8f7b18a4bd042f705e92b5937e8c0e9478e2ff623907c6","0x00ba3f6f527d6ed3ff17a63b1d5be3c42bdfae88fdf63311fc7b871157939309","0x16187d9daa8c2e5a1a9ab15be7ca6a8feebfb31bea76f9a3ca69381881c70561","0x0f64522e4904edb7377b14a7b9dad848829167324ef5c016346b3ad8251191ee","0x273bbe6000a4001dce369e5a36cc0b0ca3fd351665b688238aa8c556a6ca6b8e","0x022d2232efb2faa8307846c9a4c697aabad1b7f1336b35ad72fa8922975b49d9","0x0d82d478bff3955c4b0a34ef94427ca5f9da23147ad953c89f2e428277ec2825","0x18d886be90343010659c231583be61a138e28e37c24771e3cb61fbe2587d0671","0x000000000000000000000000000000196ba6a58dbeb7c34cb1d6287e23d434de","0x00000000000000000000000000000000001df8ae8a1589590f8863c1fefd8dfd","0x000000000000000000000000000000f30e11b2c5fbefa166cbb9f58c5f8e1a4c","0x000000000000000000000000000000000026420ade7666bc0ab1cf1fd9d0c534","0x0000000000000000000000000000000feb5b7d8260d25a1ee1ce76ff461673fc","0x00000000000000000000000000000000002bd2ac6223a80671b777bf5dca70a4","0x000000000000000000000000000000690f757006d2fa1ddb0114c9f268783537","0x000000000000000000000000000000000023ad36feadd91e50118f32e97a0204"] \ No newline at end of file diff --git a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/src/main.nr b/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/src/main.nr deleted file mode 100644 index 47ca84792a0..00000000000 --- a/noir/noir-repo/test_programs/execution_success/double_verify_proof_recursive/src/main.nr +++ /dev/null @@ -1,18 +0,0 @@ -// This circuit aggregates two proofs from `assert_statement_recursive`. -#[recursive] -fn main( - verification_key: [Field; 114], - // This is the proof without public inputs attached. - // - // This means: the size of this does not change with the number of public inputs. - proof: [Field; 93], - public_inputs: pub [Field; 1], - // This is currently not public. It is fine given that the vk is a part of the circuit definition. - // I believe we want to eventually make it public too though. - key_hash: Field, - proof_b: [Field; 93], -) { - std::verify_proof(verification_key, proof, public_inputs, key_hash); - - std::verify_proof(verification_key, proof_b, public_inputs, key_hash); -} diff --git a/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr index 6f880f085e8..6073087d644 100644 --- a/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr +++ b/noir/noir-repo/test_programs/execution_success/single_verify_proof/src/main.nr @@ -1,4 +1,4 @@ -// This circuit aggregates one proof from `assert_statement_recursive`. +// This circuit aggregates one proof from `assert_statement`. fn main( verification_key: [Field; 114], // This is the proof without public inputs attached. diff --git a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr index 6e96b459b0b..25f140a9688 100644 --- a/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr +++ b/noir/noir-repo/test_programs/execution_success/verify_honk_proof/src/main.nr @@ -1,4 +1,4 @@ -// This circuit aggregates a single Honk proof from `assert_statement_recursive`. +// This circuit aggregates a single Honk proof from `assert_statement`. global SIZE_OF_PROOF_IF_LOGN_IS_28: u32 = 463; global HONK_IDENTIFIER: u32 = 1; fn main( diff --git a/yarn-project/bb-prover/src/bb/cli.ts b/yarn-project/bb-prover/src/bb/cli.ts index 3ea6f2ba222..a0122082c96 100644 --- a/yarn-project/bb-prover/src/bb/cli.ts +++ b/yarn-project/bb-prover/src/bb/cli.ts @@ -36,6 +36,7 @@ export function getProgram(log: LogFn): Command { .requiredOption('-b, --bb-path ', 'The path to the BB binary', BB_BINARY_PATH) .requiredOption('-c, --circuit ', 'The name of a protocol circuit') .requiredOption('-f, --flavor ', 'The name of the verification key flavor', 'ultra_honk') + .option('-r, --recursive', 'Whether a SNARK friendly key should be generated', false) .action(async options => { const compiledCircuit = ProtocolCircuitArtifacts[options.circuit as ProtocolArtifact]; if (!compiledCircuit) { @@ -53,6 +54,7 @@ export function getProgram(log: LogFn): Command { options.workingDirectory, options.circuit, compiledCircuit, + options.recursive, options.flavor, // (options.circuit as ServerProtocolArtifact) === 'RootRollupArtifact' ? 'ultra_keccak_honk' : 'ultra_honk', log, diff --git a/yarn-project/bb-prover/src/bb/execute.ts b/yarn-project/bb-prover/src/bb/execute.ts index e704ab65cd5..6e922d4659d 100644 --- a/yarn-project/bb-prover/src/bb/execute.ts +++ b/yarn-project/bb-prover/src/bb/execute.ts @@ -115,6 +115,7 @@ export async function generateKeyForNoirCircuit( workingDirectory: string, circuitName: string, compiledCircuit: NoirCompiledCircuit, + recursive: boolean, flavor: UltraHonkFlavor, log: LogFn, force = false, @@ -148,7 +149,7 @@ export async function generateKeyForNoirCircuit( await fs.writeFile(bytecodePath, bytecode); // args are the output path and the input bytecode path - const args = ['-o', `${outputPath}/${VK_FILENAME}`, '-b', bytecodePath]; + const args = ['-o', `${outputPath}/${VK_FILENAME}`, '-b', bytecodePath, recursive ? '--recursive' : '']; const timer = new Timer(); let result = await executeBB(pathToBB, `write_vk_${flavor}`, args, log); @@ -264,6 +265,7 @@ export async function computeVerificationKey( workingDirectory: string, circuitName: string, bytecode: Buffer, + recursive: boolean, flavor: UltraHonkFlavor | 'mega_honk', log: LogFn, ): Promise { @@ -295,12 +297,8 @@ export async function computeVerificationKey( const logFunction = (message: string) => { log(`computeVerificationKey(${circuitName}) BB out - ${message}`); }; - let result = await executeBB( - pathToBB, - `write_vk_${flavor}`, - ['-o', outputPath, '-b', bytecodePath, '-v'], - logFunction, - ); + const args = ['-o', outputPath, '-b', bytecodePath, '-v', recursive ? '--recursive' : '']; + let result = await executeBB(pathToBB, `write_vk_${flavor}`, args, logFunction); if (result.status == BB_RESULT.FAILURE) { return { status: BB_RESULT.FAILURE, reason: 'Failed writing VK.' }; } @@ -346,6 +344,7 @@ export async function generateProof( workingDirectory: string, circuitName: string, bytecode: Buffer, + recursive: boolean, inputWitnessFile: string, flavor: UltraHonkFlavor, log: LogFn, @@ -374,7 +373,7 @@ export async function generateProof( try { // Write the bytecode to the working directory await fs.writeFile(bytecodePath, bytecode); - const args = ['-o', outputPath, '-b', bytecodePath, '-w', inputWitnessFile, '-v']; + const args = ['-o', outputPath, '-b', bytecodePath, '-w', inputWitnessFile, '-v', recursive ? '--recursive' : '']; const timer = new Timer(); const logFunction = (message: string) => { log(`${circuitName} BB out - ${message}`); @@ -557,7 +556,7 @@ export async function generateAvmProof( avmHintsPath, '-o', outputPath, - currentLogLevel == 'debug' ? '-d' : 'verbose' ? '-v' : '', + currentLogLevel == 'debug' ? '-d' : currentLogLevel == 'verbose' ? '-v' : '', ]; const timer = new Timer(); const logFunction = (message: string) => { @@ -845,11 +844,18 @@ export async function generateContractForCircuit( log: LogFn, force = false, ) { + // Verifier contracts are never recursion friendly, because non-recursive proofs are generated using the keccak256 hash function. + // We need to use the same hash function during verification so proofs generated using keccak256 are cheap to verify on ethereum + // (where the verifier contract would be deployed) whereas if we want to verify the proof within a snark (for recursion) we want + // to use a snark-friendly hash function. + const recursive = false; + const vkResult = await generateKeyForNoirCircuit( pathToBB, workingDirectory, circuitName, compiledCircuit, + recursive, 'ultra_keccak_honk', log, force, diff --git a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts index 7049d372153..753f4b8050f 100644 --- a/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_private_kernel_prover.ts @@ -189,7 +189,11 @@ export class BBNativePrivateKernelProver implements PrivateKernelProver { ): Promise { const operation = async (directory: string) => { this.log.debug(`Proving app circuit`); - return await this.computeVerificationKey(directory, bytecode, 'App', appCircuitName); + // App circuits are always recursive; the #[recursive] attribute used to be applied automatically + // by the `private` comptime macro in noir-projects/aztec-nr/aztec/src/macros/functions/mod.nr + // Yet, inside `computeVerificationKey` the `mega_honk` flavor is used, which doesn't use the recursive flag. + const recursive = true; + return await this.computeVerificationKey(directory, bytecode, recursive, 'App', appCircuitName); }; return await this.runInDirectory(operation); @@ -293,6 +297,7 @@ export class BBNativePrivateKernelProver implements PrivateKernelProver { private async computeVerificationKey( directory: string, bytecode: Buffer, + recursive: boolean, circuitType: ClientProtocolArtifact | 'App', appCircuitName?: string, ): Promise<{ @@ -308,6 +313,7 @@ export class BBNativePrivateKernelProver implements PrivateKernelProver { directory, circuitType, bytecode, + recursive, circuitType === 'App' ? 'mega_honk' : getUltraHonkFlavorForCircuit(circuitType), this.log.debug, ); diff --git a/yarn-project/bb-prover/src/prover/bb_prover.ts b/yarn-project/bb-prover/src/prover/bb_prover.ts index 490a037f64a..5e6031df2bb 100644 --- a/yarn-project/bb-prover/src/prover/bb_prover.ts +++ b/yarn-project/bb-prover/src/prover/bb_prover.ts @@ -103,6 +103,9 @@ import { extractAvmVkData, extractVkData } from '../verification_key/verificatio const logger = createDebugLogger('aztec:bb-prover'); +// All `ServerCircuitArtifact` are recursive. +const SERVER_CIRCUIT_RECURSIVE = true; + export interface BBProverConfig extends BBConfig, ACVMConfig { // list of circuits supported by this prover. defaults to all circuits if empty circuitFilter?: ServerProtocolArtifact[]; @@ -509,6 +512,7 @@ export class BBNativeRollupProver implements ServerCircuitProver { workingDirectory, circuitType, Buffer.from(artifact.bytecode, 'base64'), + SERVER_CIRCUIT_RECURSIVE, outputWitnessFile, getUltraHonkFlavorForCircuit(circuitType), logger.debug, @@ -861,6 +865,7 @@ export class BBNativeRollupProver implements ServerCircuitProver { this.config.bbWorkingDirectory, circuitType, ServerCircuitArtifacts[circuitType], + SERVER_CIRCUIT_RECURSIVE, flavor, logger.debug, ).then(result => { diff --git a/yarn-project/bb-prover/src/stats.ts b/yarn-project/bb-prover/src/stats.ts index b517acdb1ca..8cb7c0c0ab4 100644 --- a/yarn-project/bb-prover/src/stats.ts +++ b/yarn-project/bb-prover/src/stats.ts @@ -43,3 +43,27 @@ export function mapProtocolArtifactNameToCircuitName( } } } + +export function isProtocolArtifactRecursive(artifact: ServerProtocolArtifact | ClientProtocolArtifact): boolean { + switch (artifact) { + case 'EmptyNestedArtifact': + case 'PrivateKernelEmptyArtifact': + case 'BaseParityArtifact': + case 'RootParityArtifact': + case 'PrivateBaseRollupArtifact': + case 'PublicBaseRollupArtifact': + case 'MergeRollupArtifact': + case 'BlockRootRollupArtifact': + case 'EmptyBlockRootRollupArtifact': + case 'BlockMergeRollupArtifact': + case 'RootRollupArtifact': + return true; + default: { + if (artifact.startsWith('PrivateKernel')) { + // The kernel prover, where these are used, eventually calls `createClientIvcProof`, which is recursive. + return true; + } + throw new Error(`Unknown circuit type: ${artifact}`); + } + } +} diff --git a/yarn-project/bb-prover/src/verifier/bb_verifier.ts b/yarn-project/bb-prover/src/verifier/bb_verifier.ts index 394b582c17f..af05a695ae0 100644 --- a/yarn-project/bb-prover/src/verifier/bb_verifier.ts +++ b/yarn-project/bb-prover/src/verifier/bb_verifier.ts @@ -23,7 +23,7 @@ import { } from '../bb/execute.js'; import { type BBConfig } from '../config.js'; import { type UltraKeccakHonkProtocolArtifact, getUltraHonkFlavorForCircuit } from '../honk.js'; -import { mapProtocolArtifactNameToCircuitName } from '../stats.js'; +import { isProtocolArtifactRecursive, mapProtocolArtifactNameToCircuitName } from '../stats.js'; import { extractVkData } from '../verification_key/verification_key_data.js'; export class BBCircuitVerifier implements ClientProtocolCircuitVerifier { @@ -63,6 +63,7 @@ export class BBCircuitVerifier implements ClientProtocolCircuitVerifier { workingDirectory, circuit, ProtocolCircuitArtifacts[circuit], + isProtocolArtifactRecursive(circuit), getUltraHonkFlavorForCircuit(circuit), logFn, ).then(result => { diff --git a/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts b/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts index d1fb7cd6b21..f2416d0dc3d 100644 --- a/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts +++ b/yarn-project/circuit-types/src/interfaces/private_kernel_prover.ts @@ -92,7 +92,6 @@ export interface PrivateKernelProver { /** * Creates a proof for an app circuit. * - * @param partialWitness - The witness produced via circuit simulation * @param bytecode - The circuit bytecode in gzipped bincode format * @param appCircuitName - Optionally specify the name of the app circuit * @returns A Promise resolving to a Proof object diff --git a/yarn-project/ivc-integration/src/avm_integration.test.ts b/yarn-project/ivc-integration/src/avm_integration.test.ts index e3404915972..0a5ff58015e 100644 --- a/yarn-project/ivc-integration/src/avm_integration.test.ts +++ b/yarn-project/ivc-integration/src/avm_integration.test.ts @@ -66,12 +66,13 @@ describe('AVM Integration', () => { async function createHonkProof(witness: Uint8Array, bytecode: string): Promise { const witnessFileName = path.join(bbWorkingDirectory, 'witnesses.gz'); await fs.writeFile(witnessFileName, witness); - + const recursive = false; const provingResult = await generateProof( bbBinaryPath, bbWorkingDirectory, 'mock-public-kernel', Buffer.from(bytecode, 'base64'), + recursive, witnessFileName, 'ultra_honk', logger.info, diff --git a/yarn-project/noir-protocol-circuits-types/src/artifacts.ts b/yarn-project/noir-protocol-circuits-types/src/artifacts.ts index a31c70e51b8..425ea18205c 100644 --- a/yarn-project/noir-protocol-circuits-types/src/artifacts.ts +++ b/yarn-project/noir-protocol-circuits-types/src/artifacts.ts @@ -37,6 +37,7 @@ export const SimulatedPublicKernelInnerArtifact = PublicKernelInnerSimulatedJson export const SimulatedPublicKernelMergeArtifact = PublicKernelMergeSimulatedJson as NoirCompiledCircuit; export const SimulatedPublicKernelTailArtifact = PublicKernelTailSimulatedJson as NoirCompiledCircuit; +// These are all circuits that should generate proofs with the `recursive` flag. export type ServerProtocolArtifact = | 'EmptyNestedArtifact' | 'PrivateKernelEmptyArtifact' diff --git a/yarn-project/prover-client/package.json b/yarn-project/prover-client/package.json index 737d0c0ce25..07a91d15bd8 100644 --- a/yarn-project/prover-client/package.json +++ b/yarn-project/prover-client/package.json @@ -26,7 +26,8 @@ "formatting": "run -T prettier --check ./src && run -T eslint ./src", "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src", "bb": "node --no-warnings ./dest/bb/index.js", - "test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit" + "test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit", + "test:debug": "LOG_LEVEL=debug DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit --testNamePattern prover/bb_prover/parity" }, "jest": { "moduleNameMapper": { diff --git a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts index 4c0026ca986..ab85596f5c6 100644 --- a/yarn-project/prover-client/src/test/bb_prover_parity.test.ts +++ b/yarn-project/prover-client/src/test/bb_prover_parity.test.ts @@ -15,7 +15,12 @@ import { makeTuple } from '@aztec/foundation/array'; import { randomBytes } from '@aztec/foundation/crypto'; import { createDebugLogger } from '@aztec/foundation/log'; import { type Tuple } from '@aztec/foundation/serialize'; -import { ProtocolCircuitVkIndexes, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types'; +import { + ProtocolCircuitVkIndexes, + ServerCircuitVks, + getVKSiblingPath, + getVKTreeRoot, +} from '@aztec/noir-protocol-circuits-types'; import { NoopTelemetryClient } from '@aztec/telemetry-client/noop'; import { TestContext } from '../mocks/test_context.js'; @@ -53,6 +58,10 @@ describe('prover/bb_prover/parity', () => { baseParityInputs.map(baseInputs => context.prover.getBaseParityProof(baseInputs)), ); + // These could differ if artifacts generated by `generate_vk_json.js` are not consistent with what we do, + // which would cause the root parity proof to fail, because the proof of VK root inclusion would not match the key in the proof. + expect(ServerCircuitVks.BaseParityArtifact.keyAsFields.hash).toEqual(rootInputs[0].verificationKey.hash); + // Verify the base parity proofs await expect( Promise.all(rootInputs.map(input => bbProver.verifyProof('BaseParityArtifact', input.proof.binaryProof))),