29template <
typename Flavor>
32 requires(IsRecursiveFlavor<Flavor> && IsUltraHonk<typename Flavor::NativeFlavor>)
38 using RecursiveVKAndHash = Flavor::VKAndHash;
43 using NativeFlavor = Flavor::NativeFlavor;
44 using NativeVerificationKey = NativeFlavor::VerificationKey;
48 "create_honk_recursion_constraints: Only HONK, HONK_ZK, ROLLUP_HONK, ROOT_ROLLUP_HONK proof types are "
51 HasIPAAccumulator<Flavor>,
52 "create_honk_recursion_constraints: ROLLUP_HONK and ROOT_ROLLUP_HONK must be recursively verified "
53 "using a Flavor with IPA accumulator.");
65 const auto [honk_proof_to_be_set,
67 if (
builder.is_write_vk_mode()) {
69 create_mock_honk_proof<NativeFlavor, IO>(input.public_inputs.size()),
70 create_mock_honk_vk<NativeFlavor, IO>(
71 1 << NativeFlavor::VIRTUAL_LOG_N,
72 NativeFlavor::has_zero_row ? 1 : 0,
73 input.public_inputs.size()));
76 return construct_arbitrary_valid_honk_proof_and_vk<NativeFlavor>(
77 input.public_inputs.size());
81 if (
builder.is_write_vk_mode()) {
90 if (!predicate.is_constant()) {
98 for (
auto [vk_witness, vk_element] :
zip_view(vk_fields, honk_vk_to_be_set->to_field_elements())) {
104 for (
auto [proof_witness, proof_element] :
zip_view(proof_fields, honk_proof_to_be_set)) {
118 RecursiveVerifier verifier(vk_and_hash);
122 native_verification_debug<Flavor>(vkey, vk_hash.
get_value(), proof_fields);
125 return verifier_output;
132template <
typename Flavor>
142 const bool vkey_and_hash_match = native_vkey->hash() == vkey_hash;
146 bool is_valid_proof = native_verifier.
verify_proof(native_proof).result;
148 info(
"===== HONK RECURSION CONSTRAINT DEBUG INFO =====");
150 if constexpr (HasIPAAccumulator<Flavor>) {
151 flavor =
"Ultra Rollup Flavor";
153 flavor =
"Ultra ZK Flavor";
155 flavor =
"Ultra Flavor";
157 info(
"Flavor used: ", flavor);
158 info(
"Honk recursion constraint: native vk hash matches witness vk hash: ", vkey_and_hash_match ?
"true" :
"false");
159 info(
"Honk recursion constraint: input proof verifies natively: ", is_valid_proof ?
"true" :
"false");
160 info(
"===== END OF HONK RECURSION CONSTRAINT DEBUG INFO =====");
164#define INSTANTIATE_HONK_RECURSION_CONSTRAINT(Flavor) \
165 template HonkRecursionConstraintOutput<typename Flavor::CircuitBuilder> create_honk_recursion_constraints<Flavor>( \
166 typename Flavor::CircuitBuilder & builder, const RecursionConstraint& input);
174#undef INSTANTIATE_HONK_RECURSION_CONSTRAINT
177#define INSTANTIATE_NATIVE_VERIFICATION_DEBUG(Flavor) \
178 template void native_verification_debug<Flavor>(const std::shared_ptr<typename Flavor::VerificationKey>, \
179 const typename Flavor::NativeFlavor::FF vkey_hash, \
180 const bb::stdlib::Proof<typename Flavor::CircuitBuilder>&);
188#undef INSTANTIATE_NATIVE_VERIFICATION_DEBUG
#define BB_ASSERT(expression,...)
#define BB_ASSERT_EQ(actual, expected,...)
Manages the data that is propagated on the public inputs of an application/function circuit.
The verification key is responsible for storing the commitments to the precomputed (non-witnessk) pol...
static constexpr bool HasZK
typename Curve::ScalarField FF
ECCVMCircuitBuilder CircuitBuilder
The data that is propagated on the public inputs of a rollup circuit.
The recursive counterpart to the "native" Ultra flavor.
The recursive counterpart to the "native" UltraRollupFlavor.
Output verify_proof(const Proof &proof)
Perform ultra verification.
The recursive counterpart to the Ultra flavor with ZK.
A simple wrapper around a vector of stdlib field elements representing a proof.
HonkProof get_value() const
Implements boolean logic in-circuit.
static field_t from_witness_index(Builder *ctx, uint32_t witness_index)
void unset_free_witness_tag() const
Unset the free witness flag for the field element's tag.
bb::fr get_value() const
Given a := *this, compute its value given by a.v * a.mul + a.add.
static field_t from_witness(Builder *ctx, const bb::fr &input)
static field_t conditional_assign(const bool_t< Builder > &predicate, const field_t &lhs, const field_t &rhs)
Manages the data that is propagated on the public inputs of an application/function circuit.
The data that is propagated on the public inputs of a rollup circuit.
Base class templates for structures that contain data parameterized by the fundamental polynomials of...
#define INSTANTIATE_NATIVE_VERIFICATION_DEBUG(Flavor)
#define INSTANTIATE_HONK_RECURSION_CONSTRAINT(Flavor)
Entry point for Barretenberg command-line interface.
std::vector< fr > HonkProof
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Output type for recursive ultra verification.