|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/chonk/chonk.hpp"#include "barretenberg/chonk/mock_circuit_producer.hpp"#include "barretenberg/chonk/test_bench_shared.hpp"#include "barretenberg/common/assert.hpp"#include "barretenberg/common/mem.hpp"#include "barretenberg/common/test.hpp"#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"#include "barretenberg/goblin/goblin.hpp"#include "barretenberg/goblin/mock_circuits.hpp"#include "barretenberg/serialize/msgpack_impl.hpp"#include "barretenberg/stdlib_circuit_builders/mega_circuit_builder.hpp"#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp"#include "gtest/gtest.h"Go to the source code of this file.
Classes | |
| class | ChonkTests |
Functions | |
| TEST_F (ChonkTests, TestCircuitSizes) | |
| Test sizes of the circuits generated by MockCircuitProducer. | |
| TEST_F (ChonkTests, Basic) | |
| Test basic IVC. | |
| TEST_F (ChonkTests, BadProofFailure) | |
| Check that the IVC fails if an intermediate fold proof is invalid. | |
| TEST_F (ChonkTests, WrongProofComponentFailure) | |
| Produce 2 valid Chonk proofs. Ensure that replacing a proof component with a component from a different proof leads to a verification failure. | |
| TEST_F (ChonkTests, VKIndependenceFromNumberOfCircuits) | |
| Ensure that the Chonk VK is independent of the number of circuits accumulated. | |
| TEST_F (ChonkTests, VKIndependenceFromCircuitSize) | |
| Ensure that the Chonk VK is independent of the sizes of the circuits being accumulated. | |
| HEAVY_TEST (ChonkKernelCapacity, MaxCapacityPassing) | |
| Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size. | |
| TEST_F (ChonkTests, MsgpackProofFromFileOrBuffer) | |
| Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format. | |
| TEST_F (ChonkTests, DatabusFailure) | |
| Demonstrate that a databus inconsistency leads to verification failure for the IVC. | |
| HEAVY_TEST | ( | ChonkKernelCapacity | , |
| MaxCapacityPassing | |||
| ) |
Test to establish the "max" number of apps that can be accumulated due to limitations on the ECCVM size.
Definition at line 313 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| BadProofFailure | |||
| ) |
Check that the IVC fails if an intermediate fold proof is invalid.
When accumulating 4 circuits, there are 3 fold proofs to verify (the first two are recursively verfied and the 3rd is verified as part of the IVC proof). Check that if any of one of these proofs is invalid, the IVC will fail.
Definition at line 113 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| Basic | |||
| ) |
Test basic IVC.
Definition at line 98 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| DatabusFailure | |||
| ) |
Demonstrate that a databus inconsistency leads to verification failure for the IVC.
Kernel circuits contain databus consistency checks that establish that data was passed faithfully between circuits, e.g. the output (return_data) of an app was the input (secondary_calldata) of a kernel. This test tampers with the databus in such a way that one of the kernels receives secondary_calldata based on tampered app return data. This leads to an invalid witness in the check that ensures that the two corresponding commitments are equal and thus causes failure of the IVC to verify.
Definition at line 374 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| MsgpackProofFromFileOrBuffer | |||
| ) |
Test methods for serializing and deserializing a proof to/from a file/buffer in msgpack format.
Definition at line 328 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| TestCircuitSizes | |||
| ) |
Test sizes of the circuits generated by MockCircuitProducer.
The sizes of the circuits depends on the TestSettings:
Definition at line 74 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| VKIndependenceFromCircuitSize | |||
| ) |
Ensure that the Chonk VK is independent of the sizes of the circuits being accumulated.
Definition at line 286 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| VKIndependenceFromNumberOfCircuits | |||
| ) |
Ensure that the Chonk VK is independent of the number of circuits accumulated.
Definition at line 265 of file chonk.test.cpp.
| TEST_F | ( | ChonkTests | , |
| WrongProofComponentFailure | |||
| ) |
Produce 2 valid Chonk proofs. Ensure that replacing a proof component with a component from a different proof leads to a verification failure.
Definition at line 211 of file chonk.test.cpp.