Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
mega_honk.test.cpp File Reference

Go to the source code of this file.

Classes

class  MegaHonkTests< Flavor >
 

Typedefs

using FlavorTypes = ::testing::Types< MegaFlavor, MegaZKFlavor >
 

Functions

 TYPED_TEST_SUITE (MegaHonkTests, FlavorTypes)
 
 TYPED_TEST (MegaHonkTests, ProofLengthCheck)
 Check that size of a mega proof matches the corresponding constant.
 
 TYPED_TEST (MegaHonkTests, MergeProofSizeCheck)
 Check that size of a merge proof matches the corresponding constant.
 
 TYPED_TEST (MegaHonkTests, Basic)
 Test proof construction/verification for a circuit with ECC op gates, public inputs, and basic arithmetic gates.
 
 TYPED_TEST (MegaHonkTests, BasicStructured)
 Test proof construction/verification for a structured execution trace.
 
 TYPED_TEST (MegaHonkTests, DynamicVirtualSizeIncrease)
 Test that increasing the virtual size of a valid set of prover polynomials still results in a valid Megahonk proof.
 
 TYPED_TEST (MegaHonkTests, SingleCircuit)
 Test proof construction/verification for a circuit with ECC op gates, public inputs, and basic arithmetic gates.
 
 TYPED_TEST (MegaHonkTests, MultipleCircuitsMergeOnly)
 Test Merge proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.
 
 TYPED_TEST (MegaHonkTests, MultipleCircuitsMergeOnlyPrependThenAppend)
 
 TYPED_TEST (MegaHonkTests, MultipleCircuitsHonkOnly)
 Test Honk proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.
 
 TYPED_TEST (MegaHonkTests, MultipleCircuitsHonkAndMerge)
 Test Honk and Merge proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.
 
 TYPED_TEST (MegaHonkTests, StructuredTraceOverflow)
 Test the structured trace overflow mechanism for various circuits which overflow in different ways.
 
 TYPED_TEST (MegaHonkTests, PolySwap)
 A sanity check that a simple std::swap on a ProverPolynomials object works as expected.
 
 TYPED_TEST (MegaHonkTests, OpQueueWithRandomValues)
 To ensure the Merge proof sent to the rollup is ZK we have to randomise the commitments and evaluation of column polynomials. We achieve this by adding some randomness to the op queue via random ops in builders. As we produce a MegaHonk proof for such builders, this test ensure random ops do not alter the correctness of such proof (which only asserts that the data in ecc_op_wires has been compied correctly from the other wires).
 

Variables

auto & engine = numeric::get_debug_randomness()
 

Typedef Documentation

◆ FlavorTypes

using FlavorTypes = ::testing::Types<MegaFlavor, MegaZKFlavor>

Definition at line 20 of file mega_honk.test.cpp.

Function Documentation

◆ TYPED_TEST() [1/13]

TYPED_TEST ( MegaHonkTests  ,
Basic   
)

Test proof construction/verification for a circuit with ECC op gates, public inputs, and basic arithmetic gates.

Definition at line 151 of file mega_honk.test.cpp.

◆ TYPED_TEST() [2/13]

TYPED_TEST ( MegaHonkTests  ,
BasicStructured   
)

Test proof construction/verification for a structured execution trace.

Definition at line 167 of file mega_honk.test.cpp.

◆ TYPED_TEST() [3/13]

TYPED_TEST ( MegaHonkTests  ,
DynamicVirtualSizeIncrease   
)

Test that increasing the virtual size of a valid set of prover polynomials still results in a valid Megahonk proof.

Definition at line 206 of file mega_honk.test.cpp.

◆ TYPED_TEST() [4/13]

TYPED_TEST ( MegaHonkTests  ,
MergeProofSizeCheck   
)

Check that size of a merge proof matches the corresponding constant.

This is useful for ensuring correct construction of mock merge proofs

Definition at line 132 of file mega_honk.test.cpp.

◆ TYPED_TEST() [5/13]

TYPED_TEST ( MegaHonkTests  ,
MultipleCircuitsHonkAndMerge   
)

Test Honk and Merge proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.

Definition at line 363 of file mega_honk.test.cpp.

◆ TYPED_TEST() [6/13]

TYPED_TEST ( MegaHonkTests  ,
MultipleCircuitsHonkOnly   
)

Test Honk proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.

Definition at line 339 of file mega_honk.test.cpp.

◆ TYPED_TEST() [7/13]

TYPED_TEST ( MegaHonkTests  ,
MultipleCircuitsMergeOnly   
)

Test Merge proof construction/verification for multiple circuits with ECC op gates, public inputs, and basic arithmetic gates.

Definition at line 289 of file mega_honk.test.cpp.

◆ TYPED_TEST() [8/13]

TYPED_TEST ( MegaHonkTests  ,
MultipleCircuitsMergeOnlyPrependThenAppend   
)

Definition at line 307 of file mega_honk.test.cpp.

◆ TYPED_TEST() [9/13]

TYPED_TEST ( MegaHonkTests  ,
OpQueueWithRandomValues   
)

To ensure the Merge proof sent to the rollup is ZK we have to randomise the commitments and evaluation of column polynomials. We achieve this by adding some randomness to the op queue via random ops in builders. As we produce a MegaHonk proof for such builders, this test ensure random ops do not alter the correctness of such proof (which only asserts that the data in ecc_op_wires has been compied correctly from the other wires).

Definition at line 534 of file mega_honk.test.cpp.

◆ TYPED_TEST() [10/13]

TYPED_TEST ( MegaHonkTests  ,
PolySwap   
)

A sanity check that a simple std::swap on a ProverPolynomials object works as expected.

Constuct two valid proving keys. Tamper with the prover_polynomials of one key then swap the prover_polynomials of the two keys. The key who received the tampered polys leads to a failed verification while the other succeeds.

Definition at line 472 of file mega_honk.test.cpp.

◆ TYPED_TEST() [11/13]

TYPED_TEST ( MegaHonkTests  ,
ProofLengthCheck   
)

Check that size of a mega proof matches the corresponding constant.

If this test FAILS, then the following (non-exhaustive) list should probably be updated as well:

  • Proof length formula in ultra_flavor.hpp, mega_flavor.hpp, etc...
  • mega_transcript.test.cpp
  • constants in yarn-project in: constants.nr, constants.gen.ts, ConstantsGen.sol, various main.nr files of programs with recursive verification circuits
  • Places that define SIZE_OF_PROOF_IF_LOGN_IS_28

Definition at line 110 of file mega_honk.test.cpp.

◆ TYPED_TEST() [12/13]

TYPED_TEST ( MegaHonkTests  ,
SingleCircuit   
)

Test proof construction/verification for a circuit with ECC op gates, public inputs, and basic arithmetic gates.

Note
We simulate op queue interactions with a previous circuit so the actual circuit under test utilizes an op queue with non-empty 'previous' data. This avoid complications with zero-commitments etc.

Definition at line 268 of file mega_honk.test.cpp.

◆ TYPED_TEST() [13/13]

TYPED_TEST ( MegaHonkTests  ,
StructuredTraceOverflow   
)

Test the structured trace overflow mechanism for various circuits which overflow in different ways.

Definition at line 403 of file mega_honk.test.cpp.

◆ TYPED_TEST_SUITE()

TYPED_TEST_SUITE ( MegaHonkTests  ,
FlavorTypes   
)

Variable Documentation

◆ engine

auto& engine = numeric::get_debug_randomness()

Definition at line 18 of file mega_honk.test.cpp.