From ef2830a7522be7a9888908eee71c0d447a4940b6 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Fri, 16 Aug 2024 20:57:44 +0000 Subject: [PATCH 01/12] rec folding test passes with new stdlib based constructors --- .../protogalaxy_recursive_verifier.hpp | 7 ++ .../protogalaxy_recursive_verifier.test.cpp | 78 +++++++++++++++++++ .../verifier/recursive_instances.hpp | 19 +++++ .../verifier/recursive_verifier_instance.hpp | 8 +- 4 files changed, 111 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index 60d8e7adf43e..4d51ab518c6b 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -46,6 +46,13 @@ template class ProtoGalaxyRecursiveVerifier_ { : builder(builder) , instances(VerifierInstances(builder, input_data.accumulator, input_data.instance_vks)){}; + // Constructor from stdlib verifier input + ProtoGalaxyRecursiveVerifier_(Builder* builder, + std::shared_ptr accumulator, + std::vector> instance_vks) + : builder(builder) + , instances(VerifierInstances(builder, accumulator, instance_vks)){}; + /** * @brief Given a new round challenge δ for each iteration of the full ProtoGalaxy protocol, compute the vector * [δ, δ^2,..., δ^t] where t = logn and n is the size of the instance. diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index 1c5a5697ec7a..cc4de1ca3833 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -37,6 +37,8 @@ template class ProtoGalaxyRecursiveTests : public tes using OuterProverInstance = ProverInstance_; using RecursiveVerifierInstances = ::bb::stdlib::recursion::honk::RecursiveVerifierInstances_; + using RecursiveVerifierInstance = RecursiveVerifierInstances::Instance; + using RecursiveVerificationKey = RecursiveVerifierInstances::VerificationKey; using FoldingRecursiveVerifier = ProtoGalaxyRecursiveVerifier_; using DeciderRecursiveVerifier = DeciderRecursiveVerifier_; using InnerDeciderProver = DeciderProver_; @@ -228,6 +230,77 @@ template class ProtoGalaxyRecursiveTests : public tes } }; + /** + * @brief Tests that a valid recursive fold works as expected. + * + */ + static void test_recursive_folding_new_constructor() + { + // Create two arbitrary circuits for the first round of folding + InnerBuilder builder1; + create_function_circuit(builder1); + InnerBuilder builder2; + builder2.add_public_variable(FF(1)); + create_function_circuit(builder2); + + auto prover_instance_1 = std::make_shared(builder1); + auto verification_key_1 = std::make_shared(prover_instance_1->proving_key); + auto verifier_instance_1 = std::make_shared(verification_key_1); + auto prover_instance_2 = std::make_shared(builder2); + auto verification_key_2 = std::make_shared(prover_instance_2->proving_key); + auto verifier_instance_2 = std::make_shared(verification_key_2); + // Generate a folding proof + InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); + auto folding_proof = folding_prover.fold_instances(); + + // Create a recursive folding verifier circuit for the folding proof of the two instances + OuterBuilder folding_circuit; + + // WORKTODO: this is kind of brittle because I need to pass in the instance->vk here instead of just the + // instance because the construcrtor otherwise will think the instance is an accumulatior and the constructor + // will break + auto recursive_verifier_instance_1 = + std::make_shared(&folding_circuit, verifier_instance_1->verification_key); + + auto recursive_verification_key_2 = + std::make_shared(&folding_circuit, verifier_instance_2->verification_key); + + auto verifier = FoldingRecursiveVerifier{ &folding_circuit, + recursive_verifier_instance_1, + { recursive_verification_key_2 } }; + verifier.verify_folding_proof(folding_proof.proof); + info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); + EXPECT_EQ(folding_circuit.failed(), false) << folding_circuit.err(); + + // Perform native folding verification and ensure it returns the same result (either true or false) as + // calling check_circuit on the recursive folding verifier + InnerFoldingVerifier native_folding_verifier({ verifier_instance_1, verifier_instance_2 }); + native_folding_verifier.verify_folding_proof(folding_proof.proof); + + // Ensure that the underlying native and recursive folding verification algorithms agree by ensuring the + // manifestsproduced by each agree. + auto recursive_folding_manifest = verifier.transcript->get_manifest(); + auto native_folding_manifest = native_folding_verifier.transcript->get_manifest(); + + for (size_t i = 0; i < recursive_folding_manifest.size(); ++i) { + EXPECT_EQ(recursive_folding_manifest[i], native_folding_manifest[i]) + << "Recursive Verifier/Verifier manifest discrepency in round " << i; + } + + // Check for a failure flag in the recursive verifier circuit + + if constexpr (!IsSimulator) { + auto instance = std::make_shared(folding_circuit); + OuterProver prover(instance); + auto verification_key = std::make_shared(instance->proving_key); + OuterVerifier verifier(verification_key); + auto proof = prover.construct_proof(); + bool verified = verifier.verify_proof(proof); + + ASSERT(verified); + } + }; + /** * @brief Perform two rounds of folding valid circuits and then recursive verify the final decider proof, * make sure the verifer circuits pass check_circuit(). Ensure that the algorithm of the recursive and native @@ -387,6 +460,11 @@ TYPED_TEST(ProtoGalaxyRecursiveTests, RecursiveFoldingTest) TestFixture::test_recursive_folding(); } +TYPED_TEST(ProtoGalaxyRecursiveTests, RecursiveFoldingNewConstructor) +{ + TestFixture::test_recursive_folding_new_constructor(); +} + TYPED_TEST(ProtoGalaxyRecursiveTests, FullProtogalaxyRecursiveTest) { diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp index dd85c77c2983..39b65e8b9297 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp @@ -39,5 +39,24 @@ template struct RecursiveVerifierInstan idx++; } } + + // Constructor from stdlib types + RecursiveVerifierInstances_(Builder* builder, + const std::shared_ptr& accumulator, + const std::vector>& vks) + : builder(builder) + { + ASSERT(vks.size() == NUM - 1); + if (accumulator->is_accumulator) { + _data[0] = accumulator; + } else { + _data[0] = std::make_shared(builder, accumulator->verification_key); + } + size_t idx = 1; + for (auto& vk : vks) { + _data[idx] = std::make_shared(builder, vk); + idx++; + } + } }; } // namespace bb::stdlib::recursion::honk diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp index bc5a7721cae2..c49f98afc9fa 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_verifier_instance.hpp @@ -40,9 +40,15 @@ template class RecursiveVerifierInstance_ { RecursiveVerifierInstance_(Builder* builder) : builder(builder){}; + RecursiveVerifierInstance_(Builder* builder, std::shared_ptr vk) : builder(builder) - , verification_key(std::make_shared(builder, vk)) + , verification_key(std::make_shared(builder, vk)){}; + + // Constructor from stdlib vkey + RecursiveVerifierInstance_(Builder* builder, std::shared_ptr vk) + : builder(builder) + , verification_key(vk) {} RecursiveVerifierInstance_(Builder* builder, const std::shared_ptr& instance) From b405ba7b3c31107ea780f6921c05d499434083ec Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 16:43:27 +0000 Subject: [PATCH 02/12] use new constructor from precursor branch --- .../verifier/protogalaxy_recursive_verifier.test.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index cc4de1ca3833..d70d09072fb9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -256,11 +256,8 @@ template class ProtoGalaxyRecursiveTests : public tes // Create a recursive folding verifier circuit for the folding proof of the two instances OuterBuilder folding_circuit; - // WORKTODO: this is kind of brittle because I need to pass in the instance->vk here instead of just the - // instance because the construcrtor otherwise will think the instance is an accumulatior and the constructor - // will break auto recursive_verifier_instance_1 = - std::make_shared(&folding_circuit, verifier_instance_1->verification_key); + std::make_shared(&folding_circuit, verifier_instance_1); auto recursive_verification_key_2 = std::make_shared(&folding_circuit, verifier_instance_2->verification_key); From 51c9ad15f68ce9b6817050e2d444cc05a85ba808 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 16:57:31 +0000 Subject: [PATCH 03/12] pg verify method that takes a stdlib proof --- .../verifier/protogalaxy_recursive_verifier.cpp | 12 ++++++++++-- .../verifier/protogalaxy_recursive_verifier.hpp | 1 + .../verifier/protogalaxy_recursive_verifier.test.cpp | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp index 0d1bd6c1952d..7789078f5d97 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp @@ -118,10 +118,18 @@ template std::shared_ptr ProtoGalaxyRecursiveVerifier_< VerifierInstances>::verify_folding_proof(const HonkProof& proof) { - using Transcript = typename Flavor::Transcript; StdlibProof stdlib_proof = bb::convert_proof_to_witness(builder, proof); - transcript = std::make_shared(stdlib_proof); + return verify_folding_proof_(stdlib_proof); +} + +template +std::shared_ptr ProtoGalaxyRecursiveVerifier_< + VerifierInstances>::verify_folding_proof_(const StdlibProof& proof) +{ + using Transcript = typename Flavor::Transcript; + + transcript = std::make_shared(proof); prepare_for_folding(); auto delta = transcript->template get_challenge("delta"); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index 4d51ab518c6b..e85ea3fdef62 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -111,6 +111,7 @@ template class ProtoGalaxyRecursiveVerifier_ { */ std::shared_ptr verify_folding_proof(const HonkProof&); + std::shared_ptr verify_folding_proof_(const StdlibProof&); // WORKTODO: becomes only version? /** * @brief Evaluates the perturbator at a given scalar, in a sequential manner for the recursive setting. diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index d70d09072fb9..df9d8728ba71 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -262,10 +262,12 @@ template class ProtoGalaxyRecursiveTests : public tes auto recursive_verification_key_2 = std::make_shared(&folding_circuit, verifier_instance_2->verification_key); + StdlibProof stdlib_proof = bb::convert_proof_to_witness(&folding_circuit, folding_proof.proof); + auto verifier = FoldingRecursiveVerifier{ &folding_circuit, recursive_verifier_instance_1, { recursive_verification_key_2 } }; - verifier.verify_folding_proof(folding_proof.proof); + verifier.verify_folding_proof_(stdlib_proof); info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); EXPECT_EQ(folding_circuit.failed(), false) << folding_circuit.err(); From 0460b98cd972ca99784fc8001e3f4d3fcf65b424 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 17:48:27 +0000 Subject: [PATCH 04/12] use new interface in aztec ivc --- .../cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp | 10 ++++++++-- .../cpp/src/barretenberg/aztec_ivc/aztec_ivc.hpp | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp index ea6a76294768..146abe567fd0 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp @@ -17,9 +17,15 @@ void AztecIVC::complete_kernel_circuit_logic(ClientCircuit& circuit) ASSERT(verification_queue.empty() || verification_queue.size() == 2); for (auto& [proof, vkey] : verification_queue) { + + // Construct stdlib accumulator, vkey and proof + auto stdlib_verifier_accum = std::make_shared(&circuit, verifier_accumulator); + auto stdlib_vkey = std::make_shared(&circuit, vkey); + auto stdlib_proof = bb::convert_proof_to_witness(&circuit, proof); + // Perform folding recursive verification - FoldingRecursiveVerifier verifier{ &circuit, { verifier_accumulator, { vkey } } }; - auto verifier_accum = verifier.verify_folding_proof(proof); + FoldingRecursiveVerifier verifier{ &circuit, stdlib_verifier_accum, { stdlib_vkey } }; + auto verifier_accum = verifier.verify_folding_proof_(stdlib_proof); verifier_accumulator = std::make_shared(verifier_accum->get_value()); // Perform databus commitment consistency checks and propagate return data commitments via public inputs diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.hpp b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.hpp index eafb711549d3..89f299762786 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.hpp +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.hpp @@ -44,6 +44,8 @@ class AztecIVC { using GURecursiveFlavor = MegaRecursiveFlavor_; using RecursiveVerifierInstances = bb::stdlib::recursion::honk::RecursiveVerifierInstances_; + using RecursiveVerifierInstance = RecursiveVerifierInstances::Instance; + using RecursiveVerificationKey = RecursiveVerifierInstances::VerificationKey; using FoldingRecursiveVerifier = bb::stdlib::recursion::honk::ProtoGalaxyRecursiveVerifier_; From 5f0c10f302103a8b52d298d2969200f820e1451f Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 17:55:36 +0000 Subject: [PATCH 05/12] use new interface in client ivc --- .../cpp/src/barretenberg/client_ivc/client_ivc.cpp | 8 +++++++- .../cpp/src/barretenberg/client_ivc/client_ivc.hpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index 209cbdee0e3c..3e3085217de3 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -18,8 +18,14 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr(&circuit, verifier_accumulator); + auto stdlib_instance_vk = std::make_shared(&circuit, instance_vk); + auto stdlib_proof = bb::convert_proof_to_witness(&circuit, fold_output.proof); + FoldingRecursiveVerifier verifier{ &circuit, { verifier_accumulator, { instance_vk } } }; - auto verifier_accum = verifier.verify_folding_proof(fold_output.proof); + auto verifier_accum = verifier.verify_folding_proof_(stdlib_proof); verifier_accumulator = std::make_shared(verifier_accum->get_value()); } diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp index 3f5d27f92bbe..dfa059586efd 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.hpp @@ -39,6 +39,8 @@ class ClientIVC { using GURecursiveFlavor = MegaRecursiveFlavor_; using RecursiveVerifierInstances = bb::stdlib::recursion::honk::RecursiveVerifierInstances_; + using RecursiveVerifierInstance = RecursiveVerifierInstances::Instance; + using RecursiveVerificationKey = RecursiveVerifierInstances::VerificationKey; using FoldingRecursiveVerifier = bb::stdlib::recursion::honk::ProtoGalaxyRecursiveVerifier_; From 6f2010c39c1433990aec88df78ec85e29fe12010 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 18:20:31 +0000 Subject: [PATCH 06/12] there is only the new interface --- .../client_ivc_recursive_verifier.cpp | 11 ++- .../client_ivc_recursive_verifier.hpp | 2 + .../protogalaxy_recursive_verifier.cpp | 9 -- .../protogalaxy_recursive_verifier.hpp | 1 - .../protogalaxy_recursive_verifier.test.cpp | 94 +++++-------------- 5 files changed, 32 insertions(+), 85 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp index 055fa5ca299f..c041d94d937c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp @@ -10,9 +10,16 @@ namespace bb::stdlib::recursion::honk { */ void ClientIVCRecursiveVerifier::verify(const ClientIVC::Proof& proof) { + // Construct stdlib accumulator, vkey and proof + auto stdlib_verifier_accum = + std::make_shared(builder.get(), verifier_input.fold_input.accumulator); + auto stdlib_instance_vk = + std::make_shared(builder.get(), verifier_input.fold_input.instance_vks[0]); + auto stdlib_proof = bb::convert_proof_to_witness(builder.get(), proof.folding_proof); + // Perform recursive folding verification - FoldingVerifier folding_verifier{ builder.get(), verifier_input.fold_input }; - auto recursive_verifier_accumulator = folding_verifier.verify_folding_proof(proof.folding_proof); + FoldingVerifier folding_verifier{ builder.get(), stdlib_verifier_accum, { stdlib_instance_vk } }; + auto recursive_verifier_accumulator = folding_verifier.verify_folding_proof_(stdlib_proof); auto native_verifier_acc = std::make_shared(recursive_verifier_accumulator->get_value()); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp index 2a489ec6d14c..df16c45f2cba 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.hpp @@ -8,6 +8,8 @@ class ClientIVCRecursiveVerifier { using Builder = UltraCircuitBuilder; // The circuit will be an Ultra circuit using RecursiveFlavor = MegaRecursiveFlavor_; // The verifier algorithms are Mega using RecursiveVerifierInstances = RecursiveVerifierInstances_; + using RecursiveVerifierInstance = RecursiveVerifierInstances::Instance; + using RecursiveVerificationKey = RecursiveVerifierInstances::VerificationKey; using DeciderVerifier = DeciderRecursiveVerifier_; using FoldingVerifier = ProtoGalaxyRecursiveVerifier_; using GoblinVerifier = GoblinRecursiveVerifier; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp index 7789078f5d97..763faa7947bf 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp @@ -114,15 +114,6 @@ template void ProtoGalaxyRecursiveVerifier_ -std::shared_ptr ProtoGalaxyRecursiveVerifier_< - VerifierInstances>::verify_folding_proof(const HonkProof& proof) -{ - - StdlibProof stdlib_proof = bb::convert_proof_to_witness(builder, proof); - return verify_folding_proof_(stdlib_proof); -} - template std::shared_ptr ProtoGalaxyRecursiveVerifier_< VerifierInstances>::verify_folding_proof_(const StdlibProof& proof) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index e85ea3fdef62..4a71f7847b3f 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -110,7 +110,6 @@ template class ProtoGalaxyRecursiveVerifier_ { * by the prover, are expressed as constraints. */ - std::shared_ptr verify_folding_proof(const HonkProof&); std::shared_ptr verify_folding_proof_(const StdlibProof&); // WORKTODO: becomes only version? /** diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index df9d8728ba71..36ec69103a46 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -193,75 +193,13 @@ template class ProtoGalaxyRecursiveTests : public tes InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); auto folding_proof = folding_prover.fold_instances(); - // Create a recursive folding verifier circuit for the folding proof of the two instances - OuterBuilder folding_circuit; - auto verifier = FoldingRecursiveVerifier(&folding_circuit, - { verifier_instance_1, { verifier_instance_2->verification_key } }); - verifier.verify_folding_proof(folding_proof.proof); - info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); - EXPECT_EQ(folding_circuit.failed(), false) << folding_circuit.err(); - - // Perform native folding verification and ensure it returns the same result (either true or false) as - // calling check_circuit on the recursive folding verifier - InnerFoldingVerifier native_folding_verifier({ verifier_instance_1, verifier_instance_2 }); - native_folding_verifier.verify_folding_proof(folding_proof.proof); - - // Ensure that the underlying native and recursive folding verification algorithms agree by ensuring the - // manifestsproduced by each agree. - auto recursive_folding_manifest = verifier.transcript->get_manifest(); - auto native_folding_manifest = native_folding_verifier.transcript->get_manifest(); - - for (size_t i = 0; i < recursive_folding_manifest.size(); ++i) { - EXPECT_EQ(recursive_folding_manifest[i], native_folding_manifest[i]) - << "Recursive Verifier/Verifier manifest discrepency in round " << i; - } - - // Check for a failure flag in the recursive verifier circuit - - if constexpr (!IsSimulator) { - auto instance = std::make_shared(folding_circuit); - OuterProver prover(instance); - auto verification_key = std::make_shared(instance->proving_key); - OuterVerifier verifier(verification_key); - auto proof = prover.construct_proof(); - bool verified = verifier.verify_proof(proof); - - ASSERT(verified); - } - }; - - /** - * @brief Tests that a valid recursive fold works as expected. - * - */ - static void test_recursive_folding_new_constructor() - { - // Create two arbitrary circuits for the first round of folding - InnerBuilder builder1; - create_function_circuit(builder1); - InnerBuilder builder2; - builder2.add_public_variable(FF(1)); - create_function_circuit(builder2); - - auto prover_instance_1 = std::make_shared(builder1); - auto verification_key_1 = std::make_shared(prover_instance_1->proving_key); - auto verifier_instance_1 = std::make_shared(verification_key_1); - auto prover_instance_2 = std::make_shared(builder2); - auto verification_key_2 = std::make_shared(prover_instance_2->proving_key); - auto verifier_instance_2 = std::make_shared(verification_key_2); - // Generate a folding proof - InnerFoldingProver folding_prover({ prover_instance_1, prover_instance_2 }); - auto folding_proof = folding_prover.fold_instances(); - // Create a recursive folding verifier circuit for the folding proof of the two instances OuterBuilder folding_circuit; auto recursive_verifier_instance_1 = std::make_shared(&folding_circuit, verifier_instance_1); - auto recursive_verification_key_2 = std::make_shared(&folding_circuit, verifier_instance_2->verification_key); - StdlibProof stdlib_proof = bb::convert_proof_to_witness(&folding_circuit, folding_proof.proof); auto verifier = FoldingRecursiveVerifier{ &folding_circuit, @@ -329,9 +267,16 @@ template class ProtoGalaxyRecursiveTests : public tes // Create a recursive folding verifier circuit for the folding proof of the two instances OuterBuilder folding_circuit; - auto verifier = FoldingRecursiveVerifier(&folding_circuit, - { verifier_instance_1, { verifier_instance_2->verification_key } }); - auto recursive_verifier_accumulator = verifier.verify_folding_proof(folding_proof.proof); + auto recursive_verifier_instance_1 = + std::make_shared(&folding_circuit, verifier_instance_1); + auto recursive_verification_key_2 = + std::make_shared(&folding_circuit, verifier_instance_2->verification_key); + StdlibProof stdlib_proof = bb::convert_proof_to_witness(&folding_circuit, folding_proof.proof); + + auto verifier = FoldingRecursiveVerifier{ &folding_circuit, + recursive_verifier_instance_1, + { recursive_verification_key_2 } }; + auto recursive_verifier_accumulator = verifier.verify_folding_proof_(stdlib_proof); auto native_verifier_acc = std::make_shared(recursive_verifier_accumulator->get_value()); info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); @@ -428,9 +373,17 @@ template class ProtoGalaxyRecursiveTests : public tes // Create a recursive folding verifier circuit for the folding proof of the two instances with the untampered // commitments OuterBuilder folding_circuit; - FoldingRecursiveVerifier verifier{ &folding_circuit, - { verifier_accumulator, { verifier_inst->verification_key } } }; - auto recursive_verifier_acc = verifier.verify_folding_proof(folding_proof.proof); + auto recursive_verifier_instance_1 = + std::make_shared(&folding_circuit, verifier_accumulator); + auto recursive_verification_key_2 = + std::make_shared(&folding_circuit, verifier_inst->verification_key); + StdlibProof stdlib_proof = bb::convert_proof_to_witness(&folding_circuit, folding_proof.proof); + + auto verifier = FoldingRecursiveVerifier{ &folding_circuit, + recursive_verifier_instance_1, + { recursive_verification_key_2 } }; + auto recursive_verifier_acc = verifier.verify_folding_proof_(stdlib_proof); + // Validate that the target sum between prover and verifier is now different EXPECT_FALSE(folding_proof.accumulator->target_sum == recursive_verifier_acc->target_sum.get_value()); }; @@ -459,11 +412,6 @@ TYPED_TEST(ProtoGalaxyRecursiveTests, RecursiveFoldingTest) TestFixture::test_recursive_folding(); } -TYPED_TEST(ProtoGalaxyRecursiveTests, RecursiveFoldingNewConstructor) -{ - TestFixture::test_recursive_folding_new_constructor(); -} - TYPED_TEST(ProtoGalaxyRecursiveTests, FullProtogalaxyRecursiveTest) { From f55c7fe1dda3f5e9e2cb788e5a3056ef2fcf29a1 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 18:26:20 +0000 Subject: [PATCH 07/12] update ci yml to run e2e when client ivc is changed --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8485b19cba14..2b67c574ae92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,7 @@ jobs: - barretenberg/cpp/pil/** - barretenberg/cpp/src/barretenberg/vm/** - barretenberg/cpp/src/barretenberg/**/generated/* + - barretenberg/cpp/src/barretenberg/client_ivc.{hpp,cpp} non-docs: - '!(docs/**)' non-misc-ci: From ae65fb2fd89a0c382c435848b21c6be06a385c32 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 18:51:27 +0000 Subject: [PATCH 08/12] fix: use new verifier constructor in client ivc --- barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index 3e3085217de3..f0821eaeea76 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -24,7 +24,7 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr(&circuit, instance_vk); auto stdlib_proof = bb::convert_proof_to_witness(&circuit, fold_output.proof); - FoldingRecursiveVerifier verifier{ &circuit, { verifier_accumulator, { instance_vk } } }; + FoldingRecursiveVerifier verifier{ &circuit, stdlib_verifier_accum, { stdlib_instance_vk } }; auto verifier_accum = verifier.verify_folding_proof_(stdlib_proof); verifier_accumulator = std::make_shared(verifier_accum->get_value()); } From 051a4d921b41e408088ba177862226cc20a88999 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 19:15:11 +0000 Subject: [PATCH 09/12] try to force CI to run e2e --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b67c574ae92..00ad2ba875a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ env: GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} # kludge until we move away from runners WAIT_FOR_RUNNERS: false + FULL_CI: true jobs: setup: @@ -106,7 +107,7 @@ jobs: build: needs: [build-images, changes] - if: ${{ needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true' }} + if: ${{ (needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true') || 'true' }} runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 outputs: e2e_list: ${{ steps.e2e_list.outputs.list }} @@ -134,7 +135,7 @@ jobs: # all the non-bench end-to-end integration tests for aztec e2e: needs: [build, changes] - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true' }} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -164,7 +165,7 @@ jobs: # all the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: needs: [build, changes] - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true'}} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -197,7 +198,7 @@ jobs: runs-on: ubuntu-20.04 needs: [build-images, changes] # Note: not fully accurate, but to work with bench-summary needs to be the same as bench-e2e - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true' }} steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" } From 1021e383a2dcba1608cbdae13bbef228ce033494 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 20:42:50 +0000 Subject: [PATCH 10/12] remove some no longer needed native input constructors --- .../src/barretenberg/aztec_ivc/aztec_ivc.cpp | 2 +- .../barretenberg/client_ivc/client_ivc.cpp | 2 +- .../client_ivc_recursive_verifier.cpp | 2 +- .../protogalaxy_recursive_verifier.cpp | 2 +- .../protogalaxy_recursive_verifier.hpp | 8 ++------ .../protogalaxy_recursive_verifier.test.cpp | 6 +++--- .../verifier/recursive_instances.hpp | 20 ++----------------- 7 files changed, 11 insertions(+), 31 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp index 146abe567fd0..ecbcf0480890 100644 --- a/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/aztec_ivc/aztec_ivc.cpp @@ -25,7 +25,7 @@ void AztecIVC::complete_kernel_circuit_logic(ClientCircuit& circuit) // Perform folding recursive verification FoldingRecursiveVerifier verifier{ &circuit, stdlib_verifier_accum, { stdlib_vkey } }; - auto verifier_accum = verifier.verify_folding_proof_(stdlib_proof); + auto verifier_accum = verifier.verify_folding_proof(stdlib_proof); verifier_accumulator = std::make_shared(verifier_accum->get_value()); // Perform databus commitment consistency checks and propagate return data commitments via public inputs diff --git a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp index f0821eaeea76..d9c89b49a74b 100644 --- a/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/client_ivc/client_ivc.cpp @@ -25,7 +25,7 @@ void ClientIVC::accumulate(ClientCircuit& circuit, const std::shared_ptr(verifier_accum->get_value()); } diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp index c041d94d937c..3ad6689aa12e 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/client_ivc_recursive_verifier.cpp @@ -19,7 +19,7 @@ void ClientIVCRecursiveVerifier::verify(const ClientIVC::Proof& proof) // Perform recursive folding verification FoldingVerifier folding_verifier{ builder.get(), stdlib_verifier_accum, { stdlib_instance_vk } }; - auto recursive_verifier_accumulator = folding_verifier.verify_folding_proof_(stdlib_proof); + auto recursive_verifier_accumulator = folding_verifier.verify_folding_proof(stdlib_proof); auto native_verifier_acc = std::make_shared(recursive_verifier_accumulator->get_value()); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp index 763faa7947bf..8c9d44637e47 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.cpp @@ -116,7 +116,7 @@ template void ProtoGalaxyRecursiveVerifier_ std::shared_ptr ProtoGalaxyRecursiveVerifier_< - VerifierInstances>::verify_folding_proof_(const StdlibProof& proof) + VerifierInstances>::verify_folding_proof(const StdlibProof& proof) { using Transcript = typename Flavor::Transcript; diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index 4a71f7847b3f..40fbbb4a966c 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -42,10 +42,6 @@ template class ProtoGalaxyRecursiveVerifier_ { std::shared_ptr transcript; VerifierInstances instances; - ProtoGalaxyRecursiveVerifier_(Builder* builder, const VerifierInput& input_data) - : builder(builder) - , instances(VerifierInstances(builder, input_data.accumulator, input_data.instance_vks)){}; - // Constructor from stdlib verifier input ProtoGalaxyRecursiveVerifier_(Builder* builder, std::shared_ptr accumulator, @@ -108,9 +104,9 @@ template class ProtoGalaxyRecursiveVerifier_ { * @details In the recursive setting this function doesn't return anything because the equality checks performed by * the recursive verifier, ensuring the folded ϕ*, e* and β* on the verifier side correspond to what has been sent * by the prover, are expressed as constraints. - + * */ - std::shared_ptr verify_folding_proof_(const StdlibProof&); // WORKTODO: becomes only version? + std::shared_ptr verify_folding_proof(const StdlibProof&); // WORKTODO: becomes only version? /** * @brief Evaluates the perturbator at a given scalar, in a sequential manner for the recursive setting. diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp index 36ec69103a46..2866ee563813 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.test.cpp @@ -205,7 +205,7 @@ template class ProtoGalaxyRecursiveTests : public tes auto verifier = FoldingRecursiveVerifier{ &folding_circuit, recursive_verifier_instance_1, { recursive_verification_key_2 } }; - verifier.verify_folding_proof_(stdlib_proof); + verifier.verify_folding_proof(stdlib_proof); info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); EXPECT_EQ(folding_circuit.failed(), false) << folding_circuit.err(); @@ -276,7 +276,7 @@ template class ProtoGalaxyRecursiveTests : public tes auto verifier = FoldingRecursiveVerifier{ &folding_circuit, recursive_verifier_instance_1, { recursive_verification_key_2 } }; - auto recursive_verifier_accumulator = verifier.verify_folding_proof_(stdlib_proof); + auto recursive_verifier_accumulator = verifier.verify_folding_proof(stdlib_proof); auto native_verifier_acc = std::make_shared(recursive_verifier_accumulator->get_value()); info("Folding Recursive Verifier: num gates = ", folding_circuit.num_gates); @@ -382,7 +382,7 @@ template class ProtoGalaxyRecursiveTests : public tes auto verifier = FoldingRecursiveVerifier{ &folding_circuit, recursive_verifier_instance_1, { recursive_verification_key_2 } }; - auto recursive_verifier_acc = verifier.verify_folding_proof_(stdlib_proof); + auto recursive_verifier_acc = verifier.verify_folding_proof(stdlib_proof); // Validate that the target sum between prover and verifier is now different EXPECT_FALSE(folding_proof.accumulator->target_sum == recursive_verifier_acc->target_sum.get_value()); diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp index b1cd517eb940..fa6a1009a181 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp @@ -8,9 +8,7 @@ template struct RecursiveVerifierInstan using Flavor = Flavor_; using Builder = typename Flavor::CircuitBuilder; using VerificationKey = typename Flavor::VerificationKey; - using NativeVerificationKey = typename Flavor::NativeVerificationKey; using Instance = RecursiveVerifierInstance_; - using NativeInstance = bb::VerifierInstance_; using ArrayType = std::array, NUM_>; public: @@ -22,22 +20,6 @@ template struct RecursiveVerifierInstan typename ArrayType::iterator end() { return _data.end(); }; Builder* builder; - RecursiveVerifierInstances_(Builder* builder, - const std::shared_ptr& accumulator, - const std::vector>& vks) - : builder(builder) - { - ASSERT(vks.size() == NUM - 1); - - _data[0] = std::make_shared(builder, accumulator); - - size_t idx = 1; - for (auto& vk : vks) { - _data[idx] = std::make_shared(builder, vk); - idx++; - } - } - // Constructor from stdlib types RecursiveVerifierInstances_(Builder* builder, const std::shared_ptr& accumulator, @@ -45,6 +27,8 @@ template struct RecursiveVerifierInstan : builder(builder) { ASSERT(vks.size() == NUM - 1); + // WORKTODO: I think this can just be _data[0] = accumulator; because accumulator should have already been + // constructed correctly.. if (accumulator->is_accumulator) { _data[0] = accumulator; } else { From 1f5aa27bee719b87e7d1d505b3684f7e8fdfab78 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Mon, 19 Aug 2024 22:07:53 +0000 Subject: [PATCH 11/12] cleanup and simplify accumulator constructor --- .../verifier/protogalaxy_recursive_verifier.hpp | 7 +++---- .../honk_recursion/verifier/recursive_instances.hpp | 11 +++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp index 40fbbb4a966c..c518bdfa9aae 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/protogalaxy_recursive_verifier.hpp @@ -42,10 +42,9 @@ template class ProtoGalaxyRecursiveVerifier_ { std::shared_ptr transcript; VerifierInstances instances; - // Constructor from stdlib verifier input ProtoGalaxyRecursiveVerifier_(Builder* builder, - std::shared_ptr accumulator, - std::vector> instance_vks) + const std::shared_ptr& accumulator, + const std::vector>& instance_vks) : builder(builder) , instances(VerifierInstances(builder, accumulator, instance_vks)){}; @@ -106,7 +105,7 @@ template class ProtoGalaxyRecursiveVerifier_ { * by the prover, are expressed as constraints. * */ - std::shared_ptr verify_folding_proof(const StdlibProof&); // WORKTODO: becomes only version? + std::shared_ptr verify_folding_proof(const StdlibProof&); /** * @brief Evaluates the perturbator at a given scalar, in a sequential manner for the recursive setting. diff --git a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp index fa6a1009a181..108ec514e7f9 100644 --- a/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp +++ b/barretenberg/cpp/src/barretenberg/stdlib/honk_recursion/verifier/recursive_instances.hpp @@ -20,20 +20,15 @@ template struct RecursiveVerifierInstan typename ArrayType::iterator end() { return _data.end(); }; Builder* builder; - // Constructor from stdlib types RecursiveVerifierInstances_(Builder* builder, const std::shared_ptr& accumulator, const std::vector>& vks) : builder(builder) { ASSERT(vks.size() == NUM - 1); - // WORKTODO: I think this can just be _data[0] = accumulator; because accumulator should have already been - // constructed correctly.. - if (accumulator->is_accumulator) { - _data[0] = accumulator; - } else { - _data[0] = std::make_shared(builder, accumulator->verification_key); - } + + _data[0] = accumulator; + size_t idx = 1; for (auto& vk : vks) { _data[idx] = std::make_shared(builder, vk); From bf7fe39b90a937f4832c68d70cb0803993498324 Mon Sep 17 00:00:00 2001 From: ledwards2225 Date: Tue, 20 Aug 2024 15:52:18 +0000 Subject: [PATCH 12/12] revert debugging changes in ci yml --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06d78e9bd75c..6588dd5fb2ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,6 @@ env: GIT_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }} # kludge until we move away from runners WAIT_FOR_RUNNERS: false - FULL_CI: true jobs: setup: @@ -107,7 +106,7 @@ jobs: build: needs: [build-images, changes] - if: ${{ (needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true') || 'true' }} + if: ${{ needs.changes.outputs.non-docs == 'true' && needs.changes.outputs.non-misc-ci == 'true' && needs.changes.outputs.non-barretenberg-cpp == 'true' }} runs-on: ${{ github.event.pull_request.user.login || github.actor }}-x86 outputs: e2e_list: ${{ steps.e2e_list.outputs.list }} @@ -135,7 +134,7 @@ jobs: # all the non-bench end-to-end integration tests for aztec e2e: needs: [build, changes] - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true' }} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -165,7 +164,7 @@ jobs: # all the benchmarking end-to-end integration tests for aztec (not required to merge) bench-e2e: needs: [build, changes] - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true'}} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -198,7 +197,7 @@ jobs: runs-on: ubuntu-20.04 needs: [build-images, changes] # Note: not fully accurate, but to work with bench-summary needs to be the same as bench-e2e - if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' || 'true' }} + if: ${{ needs.changes.outputs.non-barretenberg-cpp == 'true' }} steps: - uses: actions/checkout@v4 with: { ref: "${{ env.GIT_COMMIT }}" }