Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include "barretenberg/crypto/merkle_tree/node_store/content_addressed_cache.hpp"
#include "barretenberg/common/test.hpp"
#include "barretenberg/crypto/merkle_tree/fixtures.hpp"
#include "barretenberg/crypto/merkle_tree/indexed_tree/indexed_leaf.hpp"
#include "barretenberg/crypto/merkle_tree/node_store/tree_meta.hpp"
#include "barretenberg/ecc/curves/bn254/fr.hpp"
#include <cstdint>
#include <vector>
Go to the source code of this file.
Classes | |
class | ContentAddressedCacheTest |
Typedefs | |
using | LeafValueType = PublicDataLeafValue |
using | IndexedLeafType = IndexedLeaf< PublicDataLeafValue > |
using | CacheType = ContentAddressedCache< PublicDataLeafValue > |
Functions | |
uint64_t | get_index (uint64_t max_index=0) |
void | add_to_cache (CacheType &cache, index_t leaf_offset, uint64_t num_leaves, uint64_t num_nodes, uint64_t max_index=0) |
CacheType | create_cache (uint32_t depth) |
TEST_F (ContentAddressedCacheTest, can_create_cache) | |
TEST_F (ContentAddressedCacheTest, can_checkpoint_cache) | |
TEST_F (ContentAddressedCacheTest, can_not_revert_cache_without_checkpoint) | |
TEST_F (ContentAddressedCacheTest, can_not_commit_cache_without_checkpoint) | |
std::vector< fr > | setup_nodes_test (uint32_t level, uint64_t index, CacheType &cache) |
TEST_F (ContentAddressedCacheTest, commit_then_revert_nodes) | |
TEST_F (ContentAddressedCacheTest, commit_then_commit_nodes) | |
TEST_F (ContentAddressedCacheTest, revert_then_commit_nodes) | |
TEST_F (ContentAddressedCacheTest, revert_then_revert_nodes) | |
std::optional< IndexedLeafType > | get_leaf_by_index (CacheType &cache, index_t index) |
std::vector< IndexedLeafType > | setup_leaves_tests (uint32_t index, CacheType &cache) |
TEST_F (ContentAddressedCacheTest, commit_then_revert_leaves) | |
TEST_F (ContentAddressedCacheTest, commit_then_commit_leaves) | |
TEST_F (ContentAddressedCacheTest, revert_then_commit_leaves) | |
TEST_F (ContentAddressedCacheTest, revert_then_revert_leaves) | |
TEST_F (ContentAddressedCacheTest, can_revert_cache) | |
TEST_F (ContentAddressedCacheTest, can_commit_cache) | |
TEST_F (ContentAddressedCacheTest, can_commit_all) | |
TEST_F (ContentAddressedCacheTest, can_revert_all) | |
TEST_F (ContentAddressedCacheTest, can_revert_through_multiple_levels) | |
TEST_F (ContentAddressedCacheTest, can_commit_through_multiple_levels) | |
void | test_reverts_remove_all_deeper_commits (uint64_t max_index, uint32_t depth, uint64_t num_levels) |
TEST_F (ContentAddressedCacheTest, reverts_remove_all_deeper_commits) | |
void | reverts_remove_all_deeper_commits_2 (uint64_t max_index, uint32_t depth, uint64_t num_levels) |
TEST_F (ContentAddressedCacheTest, reverts_remove_all_deeper_commits_2) | |
Definition at line 15 of file content_addressed_cache.test.cpp.
Definition at line 14 of file content_addressed_cache.test.cpp.
using LeafValueType = PublicDataLeafValue |
Definition at line 13 of file content_addressed_cache.test.cpp.
void add_to_cache | ( | CacheType & | cache, |
index_t | leaf_offset, | ||
uint64_t | num_leaves, | ||
uint64_t | num_nodes, | ||
uint64_t | max_index = 0 |
||
) |
Definition at line 29 of file content_addressed_cache.test.cpp.
CacheType create_cache | ( | uint32_t | depth | ) |
Definition at line 62 of file content_addressed_cache.test.cpp.
uint64_t get_index | ( | uint64_t | max_index = 0 | ) |
Definition at line 23 of file content_addressed_cache.test.cpp.
std::optional< IndexedLeafType > get_leaf_by_index | ( | CacheType & | cache, |
index_t | index | ||
) |
Definition at line 210 of file content_addressed_cache.test.cpp.
void reverts_remove_all_deeper_commits_2 | ( | uint64_t | max_index, |
uint32_t | depth, | ||
uint64_t | num_levels | ||
) |
Definition at line 548 of file content_addressed_cache.test.cpp.
std::vector< IndexedLeafType > setup_leaves_tests | ( | uint32_t | index, |
CacheType & | cache | ||
) |
Definition at line 221 of file content_addressed_cache.test.cpp.
Definition at line 99 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_checkpoint_cache | |||
) |
Definition at line 78 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_commit_all | |||
) |
Definition at line 421 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_commit_cache | |||
) |
Definition at line 405 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_commit_through_multiple_levels | |||
) |
Definition at line 482 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_create_cache | |||
) |
Definition at line 72 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_not_commit_cache_without_checkpoint | |||
) |
Definition at line 91 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_not_revert_cache_without_checkpoint | |||
) |
Definition at line 85 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_revert_all | |||
) |
Definition at line 442 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_revert_cache | |||
) |
Definition at line 395 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
can_revert_through_multiple_levels | |||
) |
Definition at line 462 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
commit_then_commit_leaves | |||
) |
Definition at line 286 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
commit_then_commit_nodes | |||
) |
Definition at line 142 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
commit_then_revert_leaves | |||
) |
Definition at line 253 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
commit_then_revert_nodes | |||
) |
Definition at line 120 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
revert_then_commit_leaves | |||
) |
Definition at line 323 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
revert_then_commit_nodes | |||
) |
Definition at line 164 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
revert_then_revert_leaves | |||
) |
Definition at line 361 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
revert_then_revert_nodes | |||
) |
Definition at line 187 of file content_addressed_cache.test.cpp.
TEST_F | ( | ContentAddressedCacheTest | , |
reverts_remove_all_deeper_commits | |||
) |
Definition at line 534 of file content_addressed_cache.test.cpp.
Definition at line 581 of file content_addressed_cache.test.cpp.
void test_reverts_remove_all_deeper_commits | ( | uint64_t | max_index, |
uint32_t | depth, | ||
uint64_t | num_levels | ||
) |
Definition at line 502 of file content_addressed_cache.test.cpp.