From 830af4b24b11da5152dc98e3e09ebf35a40a5e67 Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 17:09:57 +0000 Subject: [PATCH 01/10] isolate bad test --- barretenberg/Earthfile | 50 ++++++++++++++++----------------- barretenberg/cpp/.clangd | 2 ++ barretenberg/cpp/CMakeLists.txt | 2 +- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index 095cfc97f21..a6fe4129652 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -25,33 +25,33 @@ barretenberg-acir-tests-bb: ENV TEST_SRC /usr/src/acir_artifacts ENV VERBOSE=1 - # 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 - # Construct and separately verify a UltraHonk proof for a single program - RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh sha256 - # Construct and separately verify a MegaHonk proof for all acir programs - RUN FLOW=prove_then_verify_mega_honk ./run_acir_tests.sh - # Construct and verify a UltraHonk proof for a single program - RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash - # Construct and verify a MegaHonk proof for a single arbitrary program - RUN FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array - # Construct and verify a MegaHonk proof on one non-recursive program using the new witness stack workflow - RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh merkle_insert - # Construct and verify a MegaHonk proof for all ACIR programs using the new witness stack workflow - RUN FLOW=prove_and_verify_mega_honk_program ./run_acir_tests.sh - # Fold and verify an ACIR program stack using ClientIvc - RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic + # # 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 + # # Construct and separately verify a UltraHonk proof for a single program + # RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh sha256 + # # Construct and separately verify a MegaHonk proof for all acir programs + # RUN FLOW=prove_then_verify_mega_honk ./run_acir_tests.sh + # # Construct and verify a UltraHonk proof for a single program + # RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash + # # Construct and verify a MegaHonk proof for a single arbitrary program + # RUN FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array + # # Construct and verify a MegaHonk proof on one non-recursive program using the new witness stack workflow + # RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh merkle_insert + # # Construct and verify a MegaHonk proof for all ACIR programs using the new witness stack workflow + # RUN FLOW=prove_and_verify_mega_honk_program ./run_acir_tests.sh + # # Fold and verify an ACIR program stack using ClientIvc + # RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic # Fold and verify an ACIR program stack using ClientIvc, then natively verify the ClientIVC proof. RUN FLOW=prove_then_verify_client_ivc ./run_acir_tests.sh fold_basic - # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof - RUN FLOW=prove_then_verify_tube ./run_acir_tests.sh fold_basic - # Construct and separately verify a UltraHonk proof for a single program that recursively verifies a Honk proof - RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof - # Construct and verify a UltraHonk proof for a single program that recursively verifies a Honk proof - RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof - # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul + # # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof + # RUN FLOW=prove_then_verify_tube ./run_acir_tests.sh fold_basic + # # Construct and separately verify a UltraHonk proof for a single program that recursively verifies a Honk proof + # RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof + # # Construct and verify a UltraHonk proof for a single program that recursively verifies a Honk proof + # RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof + # # Run 1_mul through native bb build, all_cmds flow, to test all cli args. + # RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul barretenberg-acir-tests-sol: FROM ../build-images/+from-registry diff --git a/barretenberg/cpp/.clangd b/barretenberg/cpp/.clangd index b105d417825..5c2a3d2f530 100644 --- a/barretenberg/cpp/.clangd +++ b/barretenberg/cpp/.clangd @@ -67,6 +67,8 @@ Diagnostics: - modernize-use-nodiscard # Misleading; linker error fixed by adding const in declaration - readability-avoid-const-params-in-decls + # const size_t circuit_size = static_cast(...) is not better as const auto; auto is for clarity or cheap local polymorphism + - modernize-use-auto --- # this divider is necessary # Disable some checks for Google Test/Bench diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index 1e4a86a6569..8d47b1f6e1c 100644 --- a/barretenberg/cpp/CMakeLists.txt +++ b/barretenberg/cpp/CMakeLists.txt @@ -27,7 +27,7 @@ endif(DOXYGEN_FOUND) option(DISABLE_ASM "Disable custom assembly" OFF) option(DISABLE_ADX "Disable ADX assembly variant" OFF) -option(DISABLE_AZTEC_VM "Don't build Aztec VM (acceptable if iterating on core proving)" OFF) +option(DISABLE_AZTEC_VM "Don't build Aztec VM (acceptable if iterating on core proving)" ON) option(MULTITHREADING "Enable multi-threading" ON) option(OMP_MULTITHREADING "Enable OMP multi-threading" OFF) option(FUZZING "Build ONLY fuzzing harnesses" OFF) From 16e9409de73c7a6f25106ee27787a6054b7ee6bc Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 17:19:47 +0000 Subject: [PATCH 02/10] Ditch get_accumulator functions --- .../cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp | 4 ---- .../cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp | 2 +- .../cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp index a917c6990ce..3b39a30c419 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.hpp @@ -45,10 +45,6 @@ template class ProtogalaxyProver_ { // TODO(https://github.com/AztecProtocol/barretenberg/issues/878) , commitment_key(keys_to_fold[1]->proving_key.commitment_key){}; - // Returns the accumulator, which is the first element in DeciderProvingKeys. The accumulator is assumed to have the - // FoldingParameters set and be the result of a previous round of folding. - std::shared_ptr get_accumulator() { return keys_to_fold[0]; } - /** * @brief For each key produced by a circuit, prior to folding, we need to complete the computation of its * prover polynomials; commit to witnesses and generate the relation parameters; and send the public data ϕ of diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index cf657498708..461c3a70f40 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -41,7 +41,7 @@ std::shared_ptr ProtogalaxyVerifier prepare_for_folding(fold_data); auto delta = transcript->template get_challenge("delta"); - auto accumulator = get_accumulator(); + const std::shared_ptr& accumulator = keys_to_fold[0]; // WORKTODO: move auto deltas = compute_round_challenge_pows(static_cast(accumulator->verification_key->log_circuit_size), delta); diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp index 41b7e7d0dd4..de2119c9b8a 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp @@ -31,8 +31,6 @@ template class ProtogalaxyVerifier_ { : keys_to_fold(DeciderVerificationKeys(keys)){}; ~ProtogalaxyVerifier_() = default; - std::shared_ptr get_accumulator() { return keys_to_fold[0]; } - /** * @brief Instatiate the vks and the transcript. * From 15d1b1999fdccf580bb8e13d5b182a3799c01a3c Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 17:39:36 +0000 Subject: [PATCH 03/10] Rename --- .../protogalaxy/protogalaxy_verifier.cpp | 17 +++++++++-------- .../protogalaxy/protogalaxy_verifier.hpp | 14 ++++++-------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index 461c3a70f40..e2fcc418203 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -6,22 +6,23 @@ namespace bb { template -void ProtogalaxyVerifier_::receive_and_finalise_key(const std::shared_ptr& keys, - const std::string& domain_separator) +void ProtogalaxyVerifier_::run_oink_verifier_on_one_incomplete_key( + const std::shared_ptr& keys, const std::string& domain_separator) { OinkVerifier oink_verifier{ keys, transcript, domain_separator + '_' }; oink_verifier.verify(); } template -void ProtogalaxyVerifier_::prepare_for_folding(const std::vector& fold_data) +void ProtogalaxyVerifier_::run_oink_verifier_on_each_incomplete_key( + const std::vector& proof) { - transcript = std::make_shared(fold_data); + transcript = std::make_shared(proof); size_t index = 0; auto key = keys_to_fold[0]; auto domain_separator = std::to_string(index); if (!key->is_accumulator) { - receive_and_finalise_key(key, domain_separator); + run_oink_verifier_on_one_incomplete_key(key, domain_separator); key->target_sum = 0; key->gate_challenges = std::vector(static_cast(key->verification_key->log_circuit_size), 0); } @@ -30,15 +31,15 @@ void ProtogalaxyVerifier_::prepare_for_folding(const st for (auto it = keys_to_fold.begin() + 1; it != keys_to_fold.end(); it++, index++) { auto key = *it; auto domain_separator = std::to_string(index); - receive_and_finalise_key(key, domain_separator); + run_oink_verifier_on_one_incomplete_key(key, domain_separator); } } template std::shared_ptr ProtogalaxyVerifier_< - DeciderVerificationKeys>::verify_folding_proof(const std::vector& fold_data) + DeciderVerificationKeys>::verify_folding_proof(const std::vector& proof) { - prepare_for_folding(fold_data); + run_oink_verifier_on_each_incomplete_key(proof); auto delta = transcript->template get_challenge("delta"); const std::shared_ptr& accumulator = keys_to_fold[0]; // WORKTODO: move diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp index de2119c9b8a..7e1ed7c989f 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.hpp @@ -25,23 +25,21 @@ template class ProtogalaxyVerifier_ { std::shared_ptr transcript = std::make_shared(); - CommitmentLabels commitment_labels; - ProtogalaxyVerifier_(const std::vector>& keys) : keys_to_fold(DeciderVerificationKeys(keys)){}; ~ProtogalaxyVerifier_() = default; /** - * @brief Instatiate the vks and the transcript. - * - * @param fold_data The data transmitted via the transcript by the prover. + * @brief Process the public data ϕ for the decider verification keys to be folded. */ - void prepare_for_folding(const std::vector&); + void run_oink_verifier_on_one_incomplete_key(const std::shared_ptr&, const std::string&); /** - * @brief Process the public data ϕ for the decider verification keys to be folded. + * @brief Instatiate the vks and the transcript. + * + * @param fold_data The data transmitted via the transcript by the prover. */ - void receive_and_finalise_key(const std::shared_ptr&, const std::string&); + void run_oink_verifier_on_each_incomplete_key(const std::vector&); /** * @brief Run the folding protocol on the verifier side to establish whether the public data ϕ of the new From ad26d48638ec4257a24e585924dab95a2c251f1f Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 17:51:58 +0000 Subject: [PATCH 04/10] Rename and constify --- .../protogalaxy/protogalaxy_verifier.cpp | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index e2fcc418203..bf022ff52f1 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -41,23 +41,24 @@ std::shared_ptr ProtogalaxyVerifier { run_oink_verifier_on_each_incomplete_key(proof); - auto delta = transcript->template get_challenge("delta"); + const FF delta = transcript->template get_challenge("delta"); const std::shared_ptr& accumulator = keys_to_fold[0]; // WORKTODO: move - auto deltas = - compute_round_challenge_pows(static_cast(accumulator->verification_key->log_circuit_size), delta); - std::vector perturbator_coeffs(static_cast(accumulator->verification_key->log_circuit_size) + 1, 0); + const size_t log_circuit_size = static_cast(accumulator->verification_key->log_circuit_size); + const std::vector deltas = compute_round_challenge_pows(log_circuit_size, delta); + + std::vector perturbator_coeffs(log_circuit_size + 1, 0); if (accumulator->is_accumulator) { - for (size_t idx = 1; idx <= static_cast(accumulator->verification_key->log_circuit_size); idx++) { + for (size_t idx = 1; idx <= log_circuit_size; idx++) { perturbator_coeffs[idx] = transcript->template receive_from_prover("perturbator_" + std::to_string(idx)); } } perturbator_coeffs[0] = accumulator->target_sum; - Polynomial perturbator(perturbator_coeffs); - FF perturbator_challenge = transcript->template get_challenge("perturbator_challenge"); - auto perturbator_at_challenge = perturbator.evaluate(perturbator_challenge); + const Polynomial perturbator(perturbator_coeffs); + const FF perturbator_challenge = transcript->template get_challenge("perturbator_challenge"); + const FF perturbator_evaluation = perturbator.evaluate(perturbator_challenge); // The degree of K(X) is dk - k - 1 = k(d - 1) - 1. Hence we need k(d - 1) evaluations to represent it. std::array @@ -66,10 +67,10 @@ std::shared_ptr ProtogalaxyVerifier combiner_quotient_evals[idx] = transcript->template receive_from_prover( "combiner_quotient_" + std::to_string(idx + DeciderVerificationKeys::NUM)); } - Univariate combiner_quotient( - combiner_quotient_evals); - FF combiner_challenge = transcript->template get_challenge("combiner_quotient_challenge"); - auto combiner_quotient_at_challenge = combiner_quotient.evaluate(combiner_challenge); + const Univariate + combiner_quotient(combiner_quotient_evals); + const FF combiner_challenge = transcript->template get_challenge("combiner_quotient_challenge"); + const FF combiner_quotient_evaluation = combiner_quotient.evaluate(combiner_challenge); constexpr FF inverse_two = FF(2).invert(); FF vanishing_polynomial_at_challenge; @@ -129,7 +130,7 @@ std::shared_ptr ProtogalaxyVerifier // Compute next folding parameters next_accumulator->target_sum = - perturbator_at_challenge * lagranges[0] + vanishing_polynomial_at_challenge * combiner_quotient_at_challenge; + perturbator_evaluation * lagranges[0] + vanishing_polynomial_at_challenge * combiner_quotient_evaluation; next_accumulator->gate_challenges = update_gate_challenges(perturbator_challenge, accumulator->gate_challenges, deltas); From 45259874a0810614a26e56c11e11ec2bcab8da4e Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 19:06:35 +0000 Subject: [PATCH 05/10] Add printing to databus propagation data --- .../barretenberg/stdlib_circuit_builders/databus.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/databus.hpp b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/databus.hpp index dca1e522f5f..d3ffd62479e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/databus.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib_circuit_builders/databus.hpp @@ -80,6 +80,16 @@ struct DatabusPropagationData { // Is this a kernel circuit (used to determine when databus consistency checks can be appended to a circuit in IVC) bool is_kernel = false; + + friend std::ostream& operator<<(std::ostream& os, DatabusPropagationData const& data) + { + os << data.contains_app_return_data_commitment << ",\n" + << data.contains_kernel_return_data_commitment << ",\n" + << data.app_return_data_public_input_idx << ",\n" + << data.kernel_return_data_public_input_idx << ",\n" + << data.is_kernel << "\n"; + return os; + }; }; } // namespace bb From 3150a620389f5aa14ac8a3b47e168c911e073dbe Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 19:11:31 +0000 Subject: [PATCH 06/10] remove print --- barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp index 4d70b0c3110..6affa954598 100644 --- a/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/eccvm/eccvm_flavor.hpp @@ -685,7 +685,6 @@ class ECCVMFlavor { // IPA verification key requires one more point. // TODO(https://github.com/AztecProtocol/barretenberg/issues/1025): make it so that PCSs inform the crs of // how many points they need - info("eccvmvk: ", proving_key->circuit_size + 1); this->pcs_verification_key = std::make_shared(proving_key->circuit_size + 1); this->circuit_size = proving_key->circuit_size; this->log_circuit_size = numeric::get_msb(this->circuit_size); From 565b6e480d199987b4bc0416a69b0bb44910c856 Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 19:34:09 +0000 Subject: [PATCH 07/10] Working to detangle vk ownership --- .../protogalaxy/protogalaxy_verifier.cpp | 16 ++-------------- .../ultra_honk/decider_verification_key.hpp | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index bf022ff52f1..1decd7701b4 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -97,20 +97,8 @@ std::shared_ptr ProtogalaxyVerifier static_assert(DeciderVerificationKeys::NUM < 5); // TODO(https://github.com/AztecProtocol/barretenberg/issues/881): bad pattern - auto next_accumulator = std::make_shared(accumulator->verification_key); - next_accumulator->verification_key = std::make_shared( - accumulator->verification_key->circuit_size, accumulator->verification_key->num_public_inputs); - next_accumulator->verification_key->pcs_verification_key = accumulator->verification_key->pcs_verification_key; - next_accumulator->verification_key->pub_inputs_offset = accumulator->verification_key->pub_inputs_offset; - next_accumulator->verification_key->contains_recursive_proof = - accumulator->verification_key->contains_recursive_proof; - next_accumulator->verification_key->recursive_proof_public_input_indices = - accumulator->verification_key->recursive_proof_public_input_indices; - - if constexpr (IsGoblinFlavor) { // Databus commitment propagation data - next_accumulator->verification_key->databus_propagation_data = - accumulator->verification_key->databus_propagation_data; - } + auto next_accumulator = std::make_shared(); + next_accumulator->verification_key = std::make_shared(*accumulator->verification_key); size_t commitment_idx = 0; for (auto& expected_vk : next_accumulator->verification_key->get_all()) { diff --git a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp index 562b1a59561..289ec546710 100644 --- a/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp +++ b/barretenberg/cpp/src/barretenberg/ultra_honk/decider_verification_key.hpp @@ -35,7 +35,7 @@ template class DeciderVerificationKey_ { DeciderVerificationKey_() = default; DeciderVerificationKey_(std::shared_ptr vk) - : verification_key(std::move(vk)) + : verification_key(vk) {} MSGPACK_FIELDS(verification_key, From cb17897f588188396d84c561dacfb8abc17037a8 Mon Sep 17 00:00:00 2001 From: codygunton Date: Mon, 9 Sep 2024 19:36:12 +0000 Subject: [PATCH 08/10] No vk field manipulation --- .../src/barretenberg/protogalaxy/protogalaxy_verifier.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index 1decd7701b4..868ba89c9c2 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -99,6 +99,7 @@ std::shared_ptr ProtogalaxyVerifier // TODO(https://github.com/AztecProtocol/barretenberg/issues/881): bad pattern auto next_accumulator = std::make_shared(); next_accumulator->verification_key = std::make_shared(*accumulator->verification_key); + next_accumulator->is_accumulator = true; size_t commitment_idx = 0; for (auto& expected_vk : next_accumulator->verification_key->get_all()) { @@ -110,11 +111,6 @@ std::shared_ptr ProtogalaxyVerifier } commitment_idx++; } - next_accumulator->verification_key->num_public_inputs = accumulator->verification_key->num_public_inputs; - next_accumulator->public_inputs = - std::vector(static_cast(next_accumulator->verification_key->num_public_inputs), 0); - - next_accumulator->is_accumulator = true; // Compute next folding parameters next_accumulator->target_sum = From 22bf3c7f4363f540b3f6fb8fd00e9ebdd60e8117 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 10 Sep 2024 19:26:39 +0000 Subject: [PATCH 09/10] Don't disable VM --- barretenberg/cpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barretenberg/cpp/CMakeLists.txt b/barretenberg/cpp/CMakeLists.txt index 8d47b1f6e1c..1e4a86a6569 100644 --- a/barretenberg/cpp/CMakeLists.txt +++ b/barretenberg/cpp/CMakeLists.txt @@ -27,7 +27,7 @@ endif(DOXYGEN_FOUND) option(DISABLE_ASM "Disable custom assembly" OFF) option(DISABLE_ADX "Disable ADX assembly variant" OFF) -option(DISABLE_AZTEC_VM "Don't build Aztec VM (acceptable if iterating on core proving)" ON) +option(DISABLE_AZTEC_VM "Don't build Aztec VM (acceptable if iterating on core proving)" OFF) option(MULTITHREADING "Enable multi-threading" ON) option(OMP_MULTITHREADING "Enable OMP multi-threading" OFF) option(FUZZING "Build ONLY fuzzing harnesses" OFF) From e1f005e80cf2452dca43fbc9d6471fcfe33fe597 Mon Sep 17 00:00:00 2001 From: codygunton Date: Tue, 10 Sep 2024 21:53:28 +0000 Subject: [PATCH 10/10] Revert earthfile change --- barretenberg/Earthfile | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/barretenberg/Earthfile b/barretenberg/Earthfile index a6fe4129652..095cfc97f21 100644 --- a/barretenberg/Earthfile +++ b/barretenberg/Earthfile @@ -25,33 +25,33 @@ barretenberg-acir-tests-bb: ENV TEST_SRC /usr/src/acir_artifacts ENV VERBOSE=1 - # # 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 - # # Construct and separately verify a UltraHonk proof for a single program - # RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh sha256 - # # Construct and separately verify a MegaHonk proof for all acir programs - # RUN FLOW=prove_then_verify_mega_honk ./run_acir_tests.sh - # # Construct and verify a UltraHonk proof for a single program - # RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash - # # Construct and verify a MegaHonk proof for a single arbitrary program - # RUN FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array - # # Construct and verify a MegaHonk proof on one non-recursive program using the new witness stack workflow - # RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh merkle_insert - # # Construct and verify a MegaHonk proof for all ACIR programs using the new witness stack workflow - # RUN FLOW=prove_and_verify_mega_honk_program ./run_acir_tests.sh - # # Fold and verify an ACIR program stack using ClientIvc - # RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic + # 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 + # Construct and separately verify a UltraHonk proof for a single program + RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh sha256 + # Construct and separately verify a MegaHonk proof for all acir programs + RUN FLOW=prove_then_verify_mega_honk ./run_acir_tests.sh + # Construct and verify a UltraHonk proof for a single program + RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh pedersen_hash + # Construct and verify a MegaHonk proof for a single arbitrary program + RUN FLOW=prove_and_verify_mega_honk ./run_acir_tests.sh 6_array + # Construct and verify a MegaHonk proof on one non-recursive program using the new witness stack workflow + RUN FLOW=prove_and_verify_ultra_honk_program ./run_acir_tests.sh merkle_insert + # Construct and verify a MegaHonk proof for all ACIR programs using the new witness stack workflow + RUN FLOW=prove_and_verify_mega_honk_program ./run_acir_tests.sh + # Fold and verify an ACIR program stack using ClientIvc + RUN FLOW=fold_and_verify_program ./run_acir_tests.sh fold_basic # Fold and verify an ACIR program stack using ClientIvc, then natively verify the ClientIVC proof. RUN FLOW=prove_then_verify_client_ivc ./run_acir_tests.sh fold_basic - # # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof - # RUN FLOW=prove_then_verify_tube ./run_acir_tests.sh fold_basic - # # Construct and separately verify a UltraHonk proof for a single program that recursively verifies a Honk proof - # RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof - # # Construct and verify a UltraHonk proof for a single program that recursively verifies a Honk proof - # RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof - # # Run 1_mul through native bb build, all_cmds flow, to test all cli args. - # RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul + # Fold and verify an ACIR program stack using ClientIvc, recursively verify as part of the Tube circuit and produce and verify a Honk proof + RUN FLOW=prove_then_verify_tube ./run_acir_tests.sh fold_basic + # Construct and separately verify a UltraHonk proof for a single program that recursively verifies a Honk proof + RUN FLOW=prove_then_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof + # Construct and verify a UltraHonk proof for a single program that recursively verifies a Honk proof + RUN FLOW=prove_and_verify_ultra_honk ./run_acir_tests.sh verify_honk_proof + # Run 1_mul through native bb build, all_cmds flow, to test all cli args. + RUN FLOW=all_cmds ./run_acir_tests.sh 1_mul barretenberg-acir-tests-sol: FROM ../build-images/+from-registry