Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ > Class Template Reference

Public Types

using RecursiveFlavor = RecursiveFlavor_
 

Static Public Attributes

static constexpr bool IsRootRollup = IsRootRollup_
 
static constexpr size_t N = N_
 
static constexpr std::array< size_t, NLayerSizes = LayerSizes_
 

Detailed Description

template<typename RecursiveFlavor_, bool IsRootRollup_, size_t N_, std::array< size_t, N_ > LayerSizes_>
class HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ >

These functions are used to generate the constraints for testing Honk recursive verification.

We wish to test the following scenarios:

  1. Single recursive verification
  2. Rollup circuits: Merge/Base (2 recursive verifications), Root (2 recursive verifications + full IPA)
  3. Recursive verification of non recursive circuit and recursive circuit

We make the testing framework slighly more general to accomodate more cases, should we wish to test them. The template parameters depict the following scenarios: write (s_1, .., s_N) for the array in the template 0. s_1 <= s_2 <= .. <= s_N; instantiate an empty array (F_1, .., F_{s_1})

  1. Generate A_1, .., A_{s_1} circuits and set F_i := A_i
  2. (For s_2, .., s_N) Generate B_1, .., B_{s_i} circuits where B_i recursively verifies A_i, i <= s_i, and set . F_i = B_i for i <= s_i
  3. Construct a circuit C that recursively verifies (F_1, .., F_{s_1}) and prove it using Flavor

All the "inner" circuits F_1, .., F_{s_1} are constructed using the same builder and same flavor. This flavor is specified by RecursiveFlavor::NativeFlavor, called InnerFlavor. This flavor determines which data should be propagated (PairingPoints, IPA claims). The "outer" circuit that verifies F_1, .., F_{s_N} is constructed using the builder determined by RecursiveFlavor::CircuitBuilder. The rationale for templating the tests on a RecursiveFlavor is that this creates a direct correspondence betweeen the tests and the if/else branches in function that handles the honk recursion constraints.

NOTE: We add another template parameter: IsRootRollup so that we can force finalization of IPA claims.

EXAMPLE: If N = 1, s_1 = 1, then C = { recursively verify A_1 } performs a single recursive verification. EXAMPLE: If N = 1, s_1 = 2, IsRootRollup = false, then C = { recursively verify A_1, A_2 }. This is a Base/Merge rollup. EXAMPLE: If N = 1, s_1 = 2, IsRootRollup = true, then C = { recursively verify A_1, A_2 + IPA verification}. This is a root rollup. EXAMPLE: If N = 2, (s_1, s_2) = (2, 1), then C = { recursively verify B_1, A_2 }, where B_1 = { recursively verify A_1 }.

Definition at line 55 of file honk_recursion_constraint.test.cpp.

Member Typedef Documentation

◆ RecursiveFlavor

template<typename RecursiveFlavor_ , bool IsRootRollup_, size_t N_, std::array< size_t, N_ > LayerSizes_>
using HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ >::RecursiveFlavor = RecursiveFlavor_

Definition at line 57 of file honk_recursion_constraint.test.cpp.

Member Data Documentation

◆ IsRootRollup

template<typename RecursiveFlavor_ , bool IsRootRollup_, size_t N_, std::array< size_t, N_ > LayerSizes_>
constexpr bool HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ >::IsRootRollup = IsRootRollup_
staticconstexpr

Definition at line 58 of file honk_recursion_constraint.test.cpp.

◆ LayerSizes

template<typename RecursiveFlavor_ , bool IsRootRollup_, size_t N_, std::array< size_t, N_ > LayerSizes_>
constexpr std::array<size_t, N> HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ >::LayerSizes = LayerSizes_
staticconstexpr

Definition at line 60 of file honk_recursion_constraint.test.cpp.

◆ N

template<typename RecursiveFlavor_ , bool IsRootRollup_, size_t N_, std::array< size_t, N_ > LayerSizes_>
constexpr size_t HonkRecursionTestParams< RecursiveFlavor_, IsRootRollup_, N_, LayerSizes_ >::N = N_
staticconstexpr

Definition at line 59 of file honk_recursion_constraint.test.cpp.


The documentation for this class was generated from the following file: