diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_flavor.hpp b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_flavor.hpp index 1ff254c14082..10cd689867a9 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_flavor.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_flavor.hpp @@ -1,9 +1,3 @@ -// Notes: -// We want the recursive verifier for this proof to be an ultra honk type proof -// that will be aggregated in the rolup circuits -// -// We also want noir to be able to absorb these proofs - #pragma once #include "barretenberg/flavor/flavor.hpp" #include "barretenberg/stdlib/transcript/transcript.hpp" diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.cpp index da3417e0a2f7..19ce9f7750b1 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.cpp @@ -45,15 +45,6 @@ std::array AvmRecursiveVerifier_::veri comm = transcript->template receive_from_prover(label); } - // // Note(md): inherited from eccvm recursion - // // TODO(https://github.com/AztecProtocol/barretenberg/issues/1017): This is a hack to ensure zero commitments - // // are still on curve as the transcript doesn't currently support a point at infinity representation for - // // cycle_group - // if (!comm.get_value().on_curve()) { - // comm.set_point_at_infinity(true); - // } - // } - auto [beta, gamma] = transcript->template get_challenges("beta", "gamma"); relation_parameters.beta = beta; relation_parameters.gamma = gamma; @@ -63,8 +54,6 @@ std::array AvmRecursiveVerifier_::veri commitment = transcript->template receive_from_prover(label); } - // TODO(md): do we not need to hash the counts columns until the sumcheck rounds? - // unconstrained const size_t log_circuit_size = numeric::get_msb(static_cast(circuit_size.get_value())); auto sumcheck = SumcheckVerifier(log_circuit_size, transcript); @@ -79,10 +68,11 @@ std::array AvmRecursiveVerifier_::veri auto [multivariate_challenge, claimed_evaluations, sumcheck_verified] = sumcheck.verify(relation_parameters, alpha, gate_challenges); - info("verified sumcheck: ", (sumcheck_verified.has_value() && sumcheck_verified.value())); - - // TODO(md): when calling `get_commitments` do the values get constrained in their origin? check that the zip_view - // does in fact use the verifier type to get it? + // TODO(md): call assert true on the builder type to lay down the positive boolean constraint? + // using bool_ct = stdlib::bool_t; + // bool_ct is_true = bool_ct(1); + // sumcheck_verified.must_imply(is_true, "sumcheck verification failed"); + vinfo("verified sumcheck: ", (sumcheck_verified.has_value() && sumcheck_verified.value())); auto multivariate_to_univariate_opening_claim = Zeromorph::verify(circuit_size, commitments.get_unshifted(), @@ -96,7 +86,9 @@ std::array AvmRecursiveVerifier_::veri auto pairing_points = PCS::reduce_verify(multivariate_to_univariate_opening_claim, transcript); return pairing_points; - // TODO(md): call assert true on the builder type to lay down the positive boolean constraint? + + // Probably we will have to return an aggregation object (see ultra_recursive_verifier.cpp) once we interface + // with noir for public_kernel integration. Follow, the same recipe as in ultra_recursive_verifier.cpp in this case. } template class AvmRecursiveVerifier_>; diff --git a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp index 05b4c3b4ebeb..8185ac2b2ad8 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm/recursion/avm_recursive_verifier.test.cpp @@ -1,10 +1,6 @@ -// As this adds the honk_stdlib_recursion module to the cmake lists, we probably -// want to make vm recursion its own module - +#include "barretenberg/vm/avm/recursion/avm_recursive_verifier.hpp" #include "barretenberg/circuit_checker/circuit_checker.hpp" - #include "barretenberg/numeric/random/engine.hpp" -#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp" #include "barretenberg/stdlib_circuit_builders/ultra_flavor.hpp" #include "barretenberg/sumcheck/instance/prover_instance.hpp" #include "barretenberg/ultra_honk/ultra_prover.hpp" @@ -12,7 +8,6 @@ #include "barretenberg/vm/avm/generated/circuit_builder.hpp" #include "barretenberg/vm/avm/generated/composer.hpp" #include "barretenberg/vm/avm/recursion/avm_recursive_flavor.hpp" -#include "barretenberg/vm/avm/recursion/avm_recursive_verifier.hpp" #include "barretenberg/vm/avm/tests/helpers.test.hpp" #include "barretenberg/vm/avm/trace/common.hpp" #include "barretenberg/vm/avm/trace/helper.hpp" @@ -61,11 +56,11 @@ class AvmRecursiveTests : public ::testing::Test { trace_builder.op_set(0, 1, 2, AvmMemoryTag::U8); trace_builder.op_add(0, 1, 2, 3, AvmMemoryTag::U8); trace_builder.op_return(0, 0, 0); - auto trace = trace_builder.finalize(true); + auto trace = trace_builder.finalize(); // Passing true enables a longer trace with lookups builder.set_trace(std::move(trace)); builder.check_circuit(); - info("inner builder - num gates: ", builder.get_num_gates()); + vinfo("inner builder - num gates: ", builder.get_num_gates()); return builder; } @@ -80,7 +75,6 @@ TEST_F(AvmRecursiveTests, recursion) HonkProof proof = prover.construct_proof(); - // NOTE(md): got to do something about these public inputs auto public_inputs = generate_base_public_inputs(); std::vector> public_inputs_vec = bb::avm_trace::copy_public_inputs_columns(public_inputs, {}, {}); @@ -93,9 +87,6 @@ TEST_F(AvmRecursiveTests, recursion) OuterBuilder outer_circuit; RecursiveVerifier recursive_verifier{ &outer_circuit, verification_key }; - // Note(md): no inputs are provided here - so the verifier is under-constrained in respect to public inputs - // If we return the pairing points then potentially they can be recursively verified nicely?? - but it is not clear - // how aggregation will work unless we make sure the avm has the same circuit size as other things auto pairing_points = recursive_verifier.verify_proof(proof); bool pairing_points_valid = verification_key->pcs_verification_key->pairing_check(pairing_points[0].get_value(), @@ -103,7 +94,7 @@ TEST_F(AvmRecursiveTests, recursion) ASSERT_TRUE(pairing_points_valid) << "Pairing points are not valid."; - info("Recursive verifier: num gates = ", outer_circuit.num_gates); + vinfo("Recursive verifier: num gates = ", outer_circuit.num_gates); ASSERT_FALSE(outer_circuit.failed()) << "Outer circuit has failed."; bool outer_circuit_checked = CircuitChecker::check(outer_circuit);