From 4af651163f6755ce6a2fbbdef91f3493b4cfb433 Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Fri, 1 Mar 2024 19:10:37 +0000 Subject: [PATCH 1/6] initial fix attempt --- .../cpp/src/barretenberg/protogalaxy/decider_prover.cpp | 2 +- .../cpp/src/barretenberg/protogalaxy/decider_verifier.cpp | 3 ++- .../src/barretenberg/protogalaxy/protogalaxy_prover.cpp | 2 +- .../src/barretenberg/protogalaxy/protogalaxy_verifier.cpp | 2 +- .../barretenberg/sumcheck/instance/prover_instance.hpp | 4 ++-- .../barretenberg/sumcheck/instance/verifier_instance.hpp | 8 ++++---- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.cpp index 3d0b2e4e8ed..4f1fa1eb481 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_prover.cpp @@ -17,7 +17,7 @@ DeciderProver_::DeciderProver_(const std::shared_ptr& inst, const std::shared_ptr& transcript) : accumulator(std::move(inst)) , transcript(transcript) - , commitment_key(inst->commitment_key) + , commitment_key(inst->proving_key->commitment_key) {} /** diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.cpp index d140292bc4b..a2c7e7240af 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/decider_verifier.cpp @@ -54,7 +54,8 @@ template bool DeciderVerifier_::verify_proof(const Hon multivariate_challenge, transcript); - auto verified = accumulator->pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); + auto verified = + accumulator->verification_key->pcs_verification_key->pairing_check(pairing_points[0], pairing_points[1]); return sumcheck_verified.value() && verified; } diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp index e7fe59f6644..8df4050ab48 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp @@ -134,7 +134,7 @@ std::shared_ptr ProtoGalaxyProver_is_accumulator = true; next_accumulator->instance_size = instances[0]->instance_size; next_accumulator->log_instance_size = instances[0]->log_instance_size; - next_accumulator->commitment_key = instances[0]->commitment_key; + next_accumulator->proving_key->commitment_key = instances[0]->proving_key->commitment_key; // Compute the next target sum and send the next folding parameters to the verifier FF next_target_sum = diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index b56f3da6344..b90f204ef23 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -138,7 +138,7 @@ std::shared_ptr ProtoGalaxyVerifier_{ FF(1) - combiner_challenge, combiner_challenge }; - auto next_accumulator = std::make_shared(); + auto next_accumulator = std::make_shared(accumulator->verification_key); next_accumulator->instance_size = accumulator->instance_size; next_accumulator->log_instance_size = accumulator->log_instance_size; next_accumulator->is_accumulator = true; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp index 6c83c5210d8..7ce151e5f96 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp @@ -35,7 +35,7 @@ template class ProverInstance_ { std::shared_ptr proving_key; // currently commitment_key needs to be here, and not accessed through the proving key, since sometimes the proving // key is null during protogalaxy proving (TODO(https://github.com/AztecProtocol/barretenberg/issues/881)?) - std::shared_ptr commitment_key; + // std::shared_ptr commitment_key; std::shared_ptr verification_key; ProverPolynomials prover_polynomials; @@ -93,7 +93,7 @@ template class ProverInstance_ { sorted_polynomials = construct_sorted_list_polynomials(circuit, dyadic_circuit_size); verification_key = std::make_shared(proving_key); - commitment_key = proving_key->commitment_key; + // commitment_key = proving_key->commitment_key; } ProverInstance_() = default; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp index 983dc37dd4e..808122c4282 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp @@ -22,7 +22,7 @@ template class VerifierInstance_ { std::shared_ptr verification_key; // TODO(https://github.com/AztecProtocol/barretenberg/issues/881)?: Access throutgh vk by making sure vk is // initialized in Protogalaxy? - std::shared_ptr pcs_verification_key; + // std::shared_ptr pcs_verification_key; std::vector public_inputs; size_t pub_inputs_offset = 0; size_t public_input_size; @@ -38,11 +38,11 @@ template class VerifierInstance_ { WitnessCommitments witness_commitments; CommitmentLabels commitment_labels; - VerifierInstance_() - : pcs_verification_key(std::make_shared()){}; + // VerifierInstance_() + // : pcs_verification_key(std::make_shared()){}; VerifierInstance_(std::shared_ptr vk) : verification_key(std::move(vk)) - , pcs_verification_key(std::make_shared()) + // , pcs_verification_key(std::make_shared()) {} }; } // namespace bb \ No newline at end of file From a8ca2aeb65bfd76648dc0607fce7b7b12cd13207 Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Fri, 1 Mar 2024 20:35:24 +0000 Subject: [PATCH 2/6] fixed? when folding the proving key, the commitment key is uninitialized --- .../barretenberg/protogalaxy/protogalaxy_prover.cpp | 7 ++++++- .../protogalaxy/protogalaxy_verifier.cpp | 6 ++++++ .../verifier/protogalaxy_recursive_verifier.test.cpp | 5 +++-- .../honk/verifier/recursive_verifier_instance.hpp | 12 ++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp index 8df4050ab48..3a17c610bed 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp @@ -134,7 +134,12 @@ std::shared_ptr ProtoGalaxyProver_is_accumulator = true; next_accumulator->instance_size = instances[0]->instance_size; next_accumulator->log_instance_size = instances[0]->log_instance_size; - next_accumulator->proving_key->commitment_key = instances[0]->proving_key->commitment_key; + next_accumulator->proving_key = instances[0]->proving_key; + // next_accumulator->proving_key->commitment_key = instances[0]->proving_key->commitment_key; + // std::shared_ptr next_accumulator = instances[0]; + // next_accumulator->is_accumulator = true; + // next_accumulator->instance_size = instances[0]->instance_size; + // next_accumulator->log_instance_size = instances[0]->log_instance_size; // Compute the next target sum and send the next folding parameters to the verifier FF next_target_sum = diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index b90f204ef23..a3396c83f92 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -142,6 +142,11 @@ std::shared_ptr ProtoGalaxyVerifier_instance_size = accumulator->instance_size; next_accumulator->log_instance_size = accumulator->log_instance_size; next_accumulator->is_accumulator = true; + // std::shared_ptr next_accumulator = accumulator; + // next_accumulator->instance_size = accumulator->instance_size; + // next_accumulator->log_instance_size = accumulator->log_instance_size; + // next_accumulator->is_accumulator = true; + // Compute next folding parameters next_accumulator->target_sum = perturbator_at_challenge * lagranges[0] + vanishing_polynomial_at_challenge * combiner_quotient_at_challenge; @@ -200,6 +205,7 @@ std::shared_ptr ProtoGalaxyVerifier_verification_key = std::make_shared(instances[0]->instance_size, instances[0]->public_input_size); + next_accumulator->verification_key->pcs_verification_key = accumulator->verification_key->pcs_verification_key; size_t vk_idx = 0; for (auto& expected_vk : next_accumulator->verification_key->get_all()) { size_t inst = 0; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp index 55eb6116770..b1890317fac 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.test.cpp @@ -278,8 +278,9 @@ template class ProtoGalaxyRecursiveTests : public tes // decider verifier and check that the result agrees. DeciderVerifier native_decider_verifier = composer.create_decider_verifier(verifier_accumulator); auto native_result = native_decider_verifier.verify_proof(decider_proof); - auto recursive_result = native_decider_verifier.accumulator->pcs_verification_key->pairing_check( - pairing_points[0].get_value(), pairing_points[1].get_value()); + auto recursive_result = + native_decider_verifier.accumulator->verification_key->pcs_verification_key->pairing_check( + pairing_points[0].get_value(), pairing_points[1].get_value()); EXPECT_EQ(native_result, recursive_result); // Ensure that the underlying native and recursive decider verification algorithms agree by ensuring diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp index d61ee8734fc..5c67e89155e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp @@ -105,7 +105,12 @@ template class RecursiveVerifierInstance_ { */ VerifierInstance get_value() { - VerifierInstance inst; + auto inst_verification_key = std::make_shared(instance_size, public_input_size); + for (auto [vk, inst_vk] : zip_view(verification_key->get_all(), inst_verification_key->get_all())) { + inst_vk = vk.get_value(); + } + + VerifierInstance inst(inst_verification_key); inst.pub_inputs_offset = pub_inputs_offset; inst.public_input_size = public_input_size; inst.log_instance_size = log_instance_size; @@ -117,11 +122,6 @@ template class RecursiveVerifierInstance_ { inst_public_input = public_input.get_value(); } - inst.verification_key = std::make_shared(instance_size, public_input_size); - for (auto [vk, inst_vk] : zip_view(verification_key->get_all(), inst.verification_key->get_all())) { - inst_vk = vk.get_value(); - } - for (auto [alpha, inst_alpha] : zip_view(alphas, inst.alphas)) { inst_alpha = alpha.get_value(); } From db915c006ecfd24c250f06ffc29f5768c025b1c1 Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Fri, 1 Mar 2024 22:26:05 +0000 Subject: [PATCH 3/6] my prayers were answered --- .../cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp | 3 ++- .../cpp/src/barretenberg/flavor/ultra_recursive.hpp | 3 ++- .../honk/verifier/protogalaxy_recursive_verifier.cpp | 1 + .../honk/verifier/recursive_verifier_instance.hpp | 7 ++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp index 8e3a10f4f50..6e4de853187 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp @@ -41,7 +41,7 @@ template class GoblinUltraRecursiveFlavor_ { using NativeVerificationKey = NativeFlavor::VerificationKey; // Note(luke): Eventually this may not be needed at all - using VerifierCommitmentKey = bb::VerifierCommitmentKey; + using VerifierCommitmentKey = bb::VerifierCommitmentKey; static constexpr size_t NUM_WIRES = GoblinUltraFlavor::NUM_WIRES; // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often @@ -114,6 +114,7 @@ template class GoblinUltraRecursiveFlavor_ { */ VerificationKey(CircuitBuilder* builder, const std::shared_ptr& native_key) { + this->pcs_verification_key = native_key->pcs_verification_key; this->circuit_size = native_key->circuit_size; this->log_circuit_size = numeric::get_msb(this->circuit_size); this->num_public_inputs = native_key->num_public_inputs; diff --git a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp index e7ab769eb6d..7e4b0e0e1f6 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp @@ -56,7 +56,7 @@ template class UltraRecursiveFlavor_ { using NativeVerificationKey = NativeFlavor::VerificationKey; // Note(luke): Eventually this may not be needed at all - using VerifierCommitmentKey = bb::VerifierCommitmentKey; + using VerifierCommitmentKey = bb::VerifierCommitmentKey; static constexpr size_t NUM_WIRES = UltraFlavor::NUM_WIRES; // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often @@ -288,6 +288,7 @@ template class UltraRecursiveFlavor_ { this->circuit_size = native_key->circuit_size; this->log_circuit_size = numeric::get_msb(this->circuit_size); this->num_public_inputs = native_key->num_public_inputs; + this->pcs_verification_key = native_key->pcs_verification_key; this->q_m = Commitment::from_witness(builder, native_key->q_m); this->q_l = Commitment::from_witness(builder, native_key->q_l); this->q_r = Commitment::from_witness(builder, native_key->q_r); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.cpp index 8063c369db3..38ed52ba00a 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/protogalaxy_recursive_verifier.cpp @@ -212,6 +212,7 @@ std::shared_ptr ProtoGalaxyRecursiveVerifi next_accumulator->verification_key = std::make_shared(instances[0]->instance_size, instances[0]->public_input_size); + next_accumulator->verification_key->pcs_verification_key = accumulator->verification_key->pcs_verification_key; size_t vk_idx = 0; for (auto& expected_vk : next_accumulator->verification_key->get_all()) { size_t inst = 0; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp index 5c67e89155e..90de73dcc60 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp @@ -1,4 +1,5 @@ #pragma once +#include "barretenberg/commitment_schemes/verification_key.hpp" #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/relations/relation_parameters.hpp" #include "barretenberg/sumcheck/instance/verifier_instance.hpp" @@ -46,7 +47,9 @@ template class RecursiveVerifierInstance_ { RecursiveVerifierInstance_(Builder* builder, std::shared_ptr vk) : builder(builder) , verification_key(std::make_shared(builder, vk)) - {} + { + verification_key->pcs_verification_key = vk->pcs_verification_key; + } RecursiveVerifierInstance_(Builder* builder, const std::shared_ptr& instance) : pub_inputs_offset((instance->pub_inputs_offset)) @@ -63,6 +66,7 @@ template class RecursiveVerifierInstance_ { public_input_idx++; } verification_key = std::make_shared(instance_size, public_input_size); + verification_key->pcs_verification_key = instance->verification_key->pcs_verification_key; auto other_vks = instance->verification_key->get_all(); size_t vk_idx = 0; for (auto& vk : verification_key->get_all()) { @@ -106,6 +110,7 @@ template class RecursiveVerifierInstance_ { VerifierInstance get_value() { auto inst_verification_key = std::make_shared(instance_size, public_input_size); + inst_verification_key->pcs_verification_key = verification_key->pcs_verification_key; for (auto [vk, inst_vk] : zip_view(verification_key->get_all(), inst_verification_key->get_all())) { inst_vk = vk.get_value(); } From 5e212597f0636d5461535f720dbd4166cf5eea03 Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Mon, 4 Mar 2024 19:09:41 +0000 Subject: [PATCH 4/6] cleaned up --- .../src/barretenberg/flavor/goblin_ultra_recursive.hpp | 2 +- .../cpp/src/barretenberg/flavor/ultra_recursive.hpp | 2 +- .../src/barretenberg/protogalaxy/protogalaxy_prover.cpp | 8 +------- .../src/barretenberg/protogalaxy/protogalaxy_verifier.cpp | 6 +----- .../barretenberg/sumcheck/instance/prover_instance.hpp | 3 --- .../barretenberg/sumcheck/instance/verifier_instance.hpp | 6 ------ 6 files changed, 4 insertions(+), 23 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp index 6e4de853187..ec5062277a5 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/goblin_ultra_recursive.hpp @@ -41,7 +41,7 @@ template class GoblinUltraRecursiveFlavor_ { using NativeVerificationKey = NativeFlavor::VerificationKey; // Note(luke): Eventually this may not be needed at all - using VerifierCommitmentKey = bb::VerifierCommitmentKey; + using VerifierCommitmentKey = bb::VerifierCommitmentKey; static constexpr size_t NUM_WIRES = GoblinUltraFlavor::NUM_WIRES; // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often diff --git a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp index 7e4b0e0e1f6..0ac2f297ce6 100644 --- a/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp +++ b/barretenberg/cpp/src/barretenberg/flavor/ultra_recursive.hpp @@ -56,7 +56,7 @@ template class UltraRecursiveFlavor_ { using NativeVerificationKey = NativeFlavor::VerificationKey; // Note(luke): Eventually this may not be needed at all - using VerifierCommitmentKey = bb::VerifierCommitmentKey; + using VerifierCommitmentKey = bb::VerifierCommitmentKey; static constexpr size_t NUM_WIRES = UltraFlavor::NUM_WIRES; // The number of multivariate polynomials on which a sumcheck prover sumcheck operates (including shifts). We often diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp index 3a17c610bed..2dd3b456edc 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp @@ -129,17 +129,11 @@ std::shared_ptr ProtoGalaxyProver_ lagranges{ FF(1) - challenge, challenge }; - // TODO(https://github.com/AztecProtocol/barretenberg/issues/881): bad pattern - auto next_accumulator = std::make_shared(); + std::shared_ptr next_accumulator = instances[0]; next_accumulator->is_accumulator = true; next_accumulator->instance_size = instances[0]->instance_size; next_accumulator->log_instance_size = instances[0]->log_instance_size; next_accumulator->proving_key = instances[0]->proving_key; - // next_accumulator->proving_key->commitment_key = instances[0]->proving_key->commitment_key; - // std::shared_ptr next_accumulator = instances[0]; - // next_accumulator->is_accumulator = true; - // next_accumulator->instance_size = instances[0]->instance_size; - // next_accumulator->log_instance_size = instances[0]->log_instance_size; // Compute the next target sum and send the next folding parameters to the verifier FF next_target_sum = diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index a3396c83f92..c86abd32f28 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -138,14 +138,10 @@ std::shared_ptr ProtoGalaxyVerifier_{ FF(1) - combiner_challenge, combiner_challenge }; - auto next_accumulator = std::make_shared(accumulator->verification_key); + std::shared_ptr next_accumulator = accumulator; next_accumulator->instance_size = accumulator->instance_size; next_accumulator->log_instance_size = accumulator->log_instance_size; next_accumulator->is_accumulator = true; - // std::shared_ptr next_accumulator = accumulator; - // next_accumulator->instance_size = accumulator->instance_size; - // next_accumulator->log_instance_size = accumulator->log_instance_size; - // next_accumulator->is_accumulator = true; // Compute next folding parameters next_accumulator->target_sum = diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp index 55a0886b4fb..544e1d5f9f0 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/instance/prover_instance.hpp @@ -33,9 +33,6 @@ template class ProverInstance_ { public: std::shared_ptr proving_key; - // currently commitment_key needs to be here, and not accessed through the proving key, since sometimes the proving - // key is null during protogalaxy proving (TODO(https://github.com/AztecProtocol/barretenberg/issues/881)?) - ProverPolynomials prover_polynomials; WitnessCommitments witness_commitments; CommitmentLabels commitment_labels; diff --git a/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp index 808122c4282..9c6faf879aa 100644 --- a/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/sumcheck/instance/verifier_instance.hpp @@ -20,9 +20,6 @@ template class VerifierInstance_ { using RelationSeparator = typename Flavor::RelationSeparator; std::shared_ptr verification_key; - // TODO(https://github.com/AztecProtocol/barretenberg/issues/881)?: Access throutgh vk by making sure vk is - // initialized in Protogalaxy? - // std::shared_ptr pcs_verification_key; std::vector public_inputs; size_t pub_inputs_offset = 0; size_t public_input_size; @@ -38,11 +35,8 @@ template class VerifierInstance_ { WitnessCommitments witness_commitments; CommitmentLabels commitment_labels; - // VerifierInstance_() - // : pcs_verification_key(std::make_shared()){}; VerifierInstance_(std::shared_ptr vk) : verification_key(std::move(vk)) - // , pcs_verification_key(std::make_shared()) {} }; } // namespace bb \ No newline at end of file From bc4c1e257707240cb0dba42e0aa0edca4b763c71 Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Mon, 4 Mar 2024 19:57:01 +0000 Subject: [PATCH 5/6] removing resolving issue 881 to reduce scope --- .../cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp | 3 ++- .../cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp index 2dd3b456edc..382dfcddf3f 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_prover.cpp @@ -129,7 +129,8 @@ std::shared_ptr ProtoGalaxyProver_ lagranges{ FF(1) - challenge, challenge }; - std::shared_ptr next_accumulator = instances[0]; + // TODO(https://github.com/AztecProtocol/barretenberg/issues/881): bad pattern + auto next_accumulator = std::make_shared(); next_accumulator->is_accumulator = true; next_accumulator->instance_size = instances[0]->instance_size; next_accumulator->log_instance_size = instances[0]->log_instance_size; diff --git a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp index c86abd32f28..ab406ffcb7e 100644 --- a/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/protogalaxy/protogalaxy_verifier.cpp @@ -138,7 +138,8 @@ std::shared_ptr ProtoGalaxyVerifier_{ FF(1) - combiner_challenge, combiner_challenge }; - std::shared_ptr next_accumulator = accumulator; + // TODO(https://github.com/AztecProtocol/barretenberg/issues/881): bad pattern + auto next_accumulator = std::make_shared(accumulator->verification_key); next_accumulator->instance_size = accumulator->instance_size; next_accumulator->log_instance_size = accumulator->log_instance_size; next_accumulator->is_accumulator = true; From 9c074462acc19c1606caad06890430ac712df13f Mon Sep 17 00:00:00 2001 From: lucasxia01 Date: Mon, 4 Mar 2024 20:04:59 +0000 Subject: [PATCH 6/6] unnecessary change --- .../recursion/honk/verifier/recursive_verifier_instance.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp index 90de73dcc60..cbc2e71ae5e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/recursion/honk/verifier/recursive_verifier_instance.hpp @@ -47,9 +47,7 @@ template class RecursiveVerifierInstance_ { RecursiveVerifierInstance_(Builder* builder, std::shared_ptr vk) : builder(builder) , verification_key(std::make_shared(builder, vk)) - { - verification_key->pcs_verification_key = vk->pcs_verification_key; - } + {} RecursiveVerifierInstance_(Builder* builder, const std::shared_ptr& instance) : pub_inputs_offset((instance->pub_inputs_offset))