Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
ThrowingNullifierStore Class Reference
Inheritance diagram for ThrowingNullifierStore:
bb::crypto::merkle_tree::ContentAddressedCachedTreeStore< NullifierLeafValue >

Public Types

using Base = ContentAddressedCachedTreeStore< NullifierLeafValue >
 
- Public Types inherited from bb::crypto::merkle_tree::ContentAddressedCachedTreeStore< NullifierLeafValue >
using PersistedStoreType = LMDBTreeStore
 
using LeafType = NullifierLeafValue
 
using IndexedLeafValueType = IndexedLeaf< NullifierLeafValue >
 
using ReadTransaction = typename PersistedStoreType::ReadTransaction
 
using WriteTransaction = typename PersistedStoreType::WriteTransaction
 
using ReadTransactionPtr = std::unique_ptr< ReadTransaction >
 
using WriteTransactionPtr = std::unique_ptr< WriteTransaction >
 

Public Member Functions

void put_cached_node_by_index (uint32_t level, index_t index, const fr &value)
 
- Public Member Functions inherited from bb::crypto::merkle_tree::ContentAddressedCachedTreeStore< NullifierLeafValue >
 ContentAddressedCachedTreeStore (std::string name, uint32_t levels, PersistedStoreType::SharedPtr dataStore)
 
 ContentAddressedCachedTreeStore (std::string name, uint32_t levels, const block_number_t &referenceBlockNumber, PersistedStoreType::SharedPtr dataStore)
 
 ContentAddressedCachedTreeStore ()=delete
 
 ContentAddressedCachedTreeStore (ContentAddressedCachedTreeStore const &other)=delete
 
 ContentAddressedCachedTreeStore (ContentAddressedCachedTreeStore const &&other)=delete
 
 ~ContentAddressedCachedTreeStore ()=default
 
ContentAddressedCachedTreeStoreoperator= (ContentAddressedCachedTreeStore const &other)=delete
 
ContentAddressedCachedTreeStoreoperator= (ContentAddressedCachedTreeStore const &&other)=delete
 
std::pair< bool, index_tfind_low_value (const fr &new_leaf_key, const RequestContext &requestContext, ReadTransaction &tx) const
 Returns the index of the leaf with a value immediately lower than the value provided.
 
std::optional< IndexedLeafValueTypeget_leaf (const index_t &index, ReadTransaction &tx, bool includeUncommitted) const
 Returns the leaf at the provided index, if one exists.
 
void set_leaf_key_at_index (const index_t &index, const IndexedLeafValueType &leaf)
 Adds the leaf at the given index, updates the leaf index if requested.
 
void update_index (const index_t &index, const fr &leaf)
 Updates the leaf index.
 
void put_node_by_hash (const fr &nodeHash, const NodePayload &payload)
 Writes the provided data at the given node coordinates. Only writes to uncommitted data.
 
bool get_node_by_hash (const fr &nodeHash, NodePayload &payload, ReadTransaction &transaction, bool includeUncommitted) const
 Returns the data at the given node coordinates if available. Reads from uncommitted state if requested.
 
void put_cached_node_by_index (uint32_t level, const index_t &index, const fr &data, bool overwriteIfPresent=true)
 Writes the provided data at the given node coordinates. Only writes to uncommitted data.
 
bool get_cached_node_by_index (uint32_t level, const index_t &index, fr &data) const
 Returns the data at the given node coordinates if available.
 
void put_meta (const TreeMeta &m)
 Writes the provided meta data to uncommitted state.
 
void get_meta (TreeMeta &m, ReadTransaction &tx, bool includeUncommitted) const
 Reads the tree meta data, including uncommitted data if requested.
 
void get_meta (TreeMeta &m) const
 Reads the uncommitted tree meta data.
 
bool get_block_data (const block_number_t &blockNumber, BlockPayload &blockData, ReadTransaction &tx) const
 Reads the tree meta data, including uncommitted data if requested.
 
std::optional< index_tfind_leaf_index (const NullifierLeafValue &leaf, const RequestContext &requestContext, ReadTransaction &tx) const
 Finds the index of the given leaf value in the tree if available. Includes uncommitted data if requested.
 
std::optional< index_tfind_leaf_index_from (const NullifierLeafValue &leaf, const index_t &start_index, const RequestContext &requestContext, ReadTransaction &tx) const
 Finds the index of the given leaf value in the tree if available. Includes uncommitted data if requested.
 
void commit_block (TreeMeta &finalMeta, TreeDBStats &dbStats)
 Commits the uncommitted data to the underlying store.
 
void commit_genesis_state ()
 Commits the initial state of uncommitted data to the underlying store.
 
void rollback ()
 Rolls back the uncommitted state.
 
std::string get_name () const
 Returns the name of the tree.
 
ReadTransactionPtr create_read_transaction () const
 Returns a read transaction against the underlying store.
 
std::optional< IndexedLeafValueTypeget_leaf_by_hash (const fr &leaf_hash, ReadTransaction &tx, bool includeUncommitted) const
 
void put_leaf_by_hash (const fr &leaf_hash, const IndexedLeafValueType &leafPreImage)
 
std::optional< IndexedLeafValueTypeget_cached_leaf_by_index (const index_t &index) const
 
void put_cached_leaf_by_index (const index_t &index, const IndexedLeafValueType &leafPreImage)
 
fr get_current_root (ReadTransaction &tx, bool includeUncommitted) const
 
void remove_historical_block (const block_number_t &blockNumber, TreeMeta &finalMeta, TreeDBStats &dbStats)
 
void unwind_block (const block_number_t &blockNumber, TreeMeta &finalMeta, TreeDBStats &dbStats)
 
void advance_finalized_block (const block_number_t &blockNumber)
 
std::optional< block_number_tfind_block_for_index (const index_t &index, ReadTransaction &tx) const
 
uint32_t checkpoint ()
 
void revert_checkpoint ()
 
void commit_checkpoint ()
 
void revert_all_checkpoints_to ()
 
void commit_all_checkpoints_to ()
 
void commit_to_depth (uint32_t depth)
 
void revert_to_depth (uint32_t depth)
 
uint32_t checkpoint_depth () const
 

Public Attributes

std::atomic< bool > throw_on_put_cached_node_by_index { false }
 
std::atomic< uint64_t > num_put_cached_node_calls { 0 }
 

Detailed Description

Definition at line 3252 of file content_addressed_indexed_tree.test.cpp.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ put_cached_node_by_index()

void ThrowingNullifierStore::put_cached_node_by_index ( uint32_t  level,
index_t  index,
const fr value 
)
inline

Definition at line 3260 of file content_addressed_indexed_tree.test.cpp.

Member Data Documentation

◆ num_put_cached_node_calls

std::atomic<uint64_t> ThrowingNullifierStore::num_put_cached_node_calls { 0 }

Definition at line 3258 of file content_addressed_indexed_tree.test.cpp.

◆ throw_on_put_cached_node_by_index

std::atomic<bool> ThrowingNullifierStore::throw_on_put_cached_node_by_index { false }

Definition at line 3257 of file content_addressed_indexed_tree.test.cpp.


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