Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy > Class Template Reference

Implements a simple append-only merkle tree All methods are asynchronous unless specified as otherwise Accepts template arguments of the type of store backing the tree and the hashing policy Accepts the store as an argument on construction as well as a thread pool instance Asynchronous methods are exeucted on the provided thread pool. More...

#include <content_addressed_append_only_tree.hpp>

Inheritance diagram for bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >:
bb::crypto::merkle_tree::ContentAddressedIndexedTree< Store, HashingPolicy >

Public Types

using StoreType = Store
 
using EmptyResponseCallback = std::function< void(Response &)>
 
using AppendCompletionCallback = std::function< void(TypedResponse< AddDataResponse > &)>
 
using MetaDataCallback = std::function< void(TypedResponse< TreeMetaResponse > &)>
 
using HashPathCallback = std::function< void(TypedResponse< GetSiblingPathResponse > &)>
 
using FindLeafCallback = std::function< void(TypedResponse< FindLeafIndexResponse > &)>
 
using FindSiblingPathCallback = std::function< void(TypedResponse< FindLeafPathResponse > &)>
 
using GetLeafCallback = std::function< void(TypedResponse< GetLeafResponse > &)>
 
using CommitCallback = std::function< void(TypedResponse< CommitResponse > &)>
 
using RollbackCallback = EmptyResponseCallback
 
using RemoveHistoricBlockCallback = std::function< void(TypedResponse< RemoveHistoricResponse > &)>
 
using UnwindBlockCallback = std::function< void(TypedResponse< UnwindResponse > &)>
 
using FinalizeBlockCallback = EmptyResponseCallback
 
using GetBlockForIndexCallback = std::function< void(TypedResponse< BlockForIndexResponse > &)>
 
using CheckpointCallback = EmptyResponseCallback
 
using CheckpointCommitCallback = EmptyResponseCallback
 
using CheckpointRevertCallback = EmptyResponseCallback
 

Public Member Functions

 ContentAddressedAppendOnlyTree (std::unique_ptr< Store > store, std::shared_ptr< ThreadPool > workers, const std::vector< fr > &initial_values={}, bool commit_genesis_state=true)
 
 ContentAddressedAppendOnlyTree (ContentAddressedAppendOnlyTree const &other)=delete
 
 ContentAddressedAppendOnlyTree (ContentAddressedAppendOnlyTree &&other)=delete
 
ContentAddressedAppendOnlyTreeoperator= (ContentAddressedAppendOnlyTree const &other)=delete
 
ContentAddressedAppendOnlyTreeoperator= (ContentAddressedAppendOnlyTree const &&other)=delete
 
virtual ~ContentAddressedAppendOnlyTree ()=default
 
virtual void add_value (const fr &value, const AppendCompletionCallback &on_completion)
 Adds a single value to the end of the tree.
 
virtual void add_values (const std::vector< fr > &values, const AppendCompletionCallback &on_completion)
 Adds the given set of values to the end of the tree.
 
void get_sibling_path (const index_t &index, const HashPathCallback &on_completion, bool includeUncommitted) const
 Returns the sibling path from the leaf at the given index to the root.
 
void get_sibling_path (const index_t &index, const block_number_t &blockNumber, const HashPathCallback &on_completion, bool includeUncommitted) const
 Returns the sibling path from the leaf at the given index to the root.
 
void get_subtree_sibling_path (uint32_t subtree_depth, const HashPathCallback &on_completion, bool includeUncommitted) const
 Get the subtree sibling path object.
 
void get_subtree_sibling_path (const index_t &leaf_index, uint32_t subtree_depth, const HashPathCallback &on_completion, bool includeUncommitted) const
 Get the subtree sibling path object to a leaf.
 
void get_meta_data (bool includeUncommitted, const MetaDataCallback &on_completion) const
 Returns the tree meta data.
 
void get_meta_data (const block_number_t &blockNumber, bool includeUncommitted, const MetaDataCallback &on_completion) const
 Returns the tree meta data.
 
void get_leaf (const index_t &index, bool includeUncommitted, const GetLeafCallback &completion) const
 Returns the leaf value at the provided index.
 
void get_leaf (const index_t &index, const block_number_t &blockNumber, bool includeUncommitted, const GetLeafCallback &completion) const
 Returns the leaf value at the provided index.
 
void find_leaf_indices (const std::vector< typename Store::LeafType > &leaves, bool includeUncommitted, const FindLeafCallback &on_completion) const
 Returns the index of the provided leaf in the tree.
 
void find_leaf_indices (const std::vector< typename Store::LeafType > &leaves, const block_number_t &blockNumber, bool includeUncommitted, const FindLeafCallback &on_completion) const
 Returns the index of the provided leaf in the tree.
 
void find_leaf_sibling_paths (const std::vector< typename Store::LeafType > &leaves, bool includeUncommitted, const FindSiblingPathCallback &on_completion) const
 Returns the sibling paths for the provided leaves in the tree.
 
void find_leaf_sibling_paths (const std::vector< typename Store::LeafType > &leaves, const block_number_t &block_number, bool includeUncommitted, const FindSiblingPathCallback &on_completion) const
 Returns the sibling paths for the provided leaves in the tree.
 
void find_leaf_indices_from (const std::vector< typename Store::LeafType > &leaves, const index_t &start_index, bool includeUncommitted, const FindLeafCallback &on_completion) const
 Returns the index of the provided leaf in the tree only if it exists after the index value provided.
 
void find_leaf_indices_from (const std::vector< typename Store::LeafType > &leaves, const index_t &start_index, const block_number_t &blockNumber, bool includeUncommitted, const FindLeafCallback &on_completion) const
 Returns the index of the provided leaf in the tree only if it exists after the index value provided.
 
void find_block_numbers (const std::vector< index_t > &indices, const GetBlockForIndexCallback &on_completion) const
 Returns the block numbers that correspond to the given indices values.
 
void find_block_numbers (const std::vector< index_t > &indices, const block_number_t &blockNumber, const GetBlockForIndexCallback &on_completion) const
 Returns the block numbers that correspond to the given indices values, from the perspective of a historical block number.
 
void commit (const CommitCallback &on_completion)
 Commit the tree to the backing store.
 
void rollback (const RollbackCallback &on_completion)
 Rollback the uncommitted changes.
 
uint32_t depth () const
 Synchronous method to retrieve the depth of the tree.
 
void remove_historic_block (const block_number_t &blockNumber, const RemoveHistoricBlockCallback &on_completion)
 
void unwind_block (const block_number_t &blockNumber, const UnwindBlockCallback &on_completion)
 
void finalize_block (const block_number_t &blockNumber, const FinalizeBlockCallback &on_completion)
 
void checkpoint (const CheckpointCallback &on_completion)
 
void commit_checkpoint (const CheckpointCommitCallback &on_completion)
 
void revert_checkpoint (const CheckpointRevertCallback &on_completion)
 
void commit_all_checkpoints (const CheckpointCommitCallback &on_completion)
 
void revert_all_checkpoints (const CheckpointRevertCallback &on_completion)
 

Protected Types

using ReadTransaction = typename Store::ReadTransaction
 
using ReadTransactionPtr = typename Store::ReadTransactionPtr
 
using OptionalSiblingPath = std::vector< std::optional< fr > >
 

Protected Member Functions

fr_sibling_path optional_sibling_path_to_full_sibling_path (const OptionalSiblingPath &optionalPath) const
 
void add_values_internal (std::shared_ptr< std::vector< fr > > values, fr &new_root, index_t &new_size, bool update_index)
 
void add_values_internal (const std::vector< fr > &values, const AppendCompletionCallback &on_completion, bool update_index)
 
OptionalSiblingPath get_subtree_sibling_path_internal (const index_t &leaf_index, uint32_t subtree_depth, const RequestContext &requestContext, ReadTransaction &tx) const
 
std::optional< frfind_leaf_hash (const index_t &leaf_index, const RequestContext &requestContext, ReadTransaction &tx, bool updateNodesByIndexCache=false) const
 
index_t get_batch_insertion_size (const index_t &treeSize, const index_t &remainingAppendSize)
 
void add_batch_internal (std::vector< fr > &values, fr &new_root, index_t &new_size, bool update_index, ReadTransaction &tx)
 

Protected Attributes

std::unique_ptr< Storestore_
 
uint32_t depth_
 
uint64_t max_size_
 
std::vector< frzero_hashes_
 
std::shared_ptr< ThreadPoolworkers_
 

Detailed Description

template<typename Store, typename HashingPolicy>
class bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >

Implements a simple append-only merkle tree All methods are asynchronous unless specified as otherwise Accepts template arguments of the type of store backing the tree and the hashing policy Accepts the store as an argument on construction as well as a thread pool instance Asynchronous methods are exeucted on the provided thread pool.

Definition at line 45 of file content_addressed_append_only_tree.hpp.

Member Typedef Documentation

◆ AppendCompletionCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::AppendCompletionCallback = std::function<void(TypedResponse<AddDataResponse>&)>

Definition at line 51 of file content_addressed_append_only_tree.hpp.

◆ CheckpointCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::CheckpointCallback = EmptyResponseCallback

Definition at line 63 of file content_addressed_append_only_tree.hpp.

◆ CheckpointCommitCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::CheckpointCommitCallback = EmptyResponseCallback

Definition at line 64 of file content_addressed_append_only_tree.hpp.

◆ CheckpointRevertCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::CheckpointRevertCallback = EmptyResponseCallback

Definition at line 65 of file content_addressed_append_only_tree.hpp.

◆ CommitCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::CommitCallback = std::function<void(TypedResponse<CommitResponse>&)>

Definition at line 57 of file content_addressed_append_only_tree.hpp.

◆ EmptyResponseCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::EmptyResponseCallback = std::function<void(Response&)>

Definition at line 50 of file content_addressed_append_only_tree.hpp.

◆ FinalizeBlockCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::FinalizeBlockCallback = EmptyResponseCallback

Definition at line 61 of file content_addressed_append_only_tree.hpp.

◆ FindLeafCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::FindLeafCallback = std::function<void(TypedResponse<FindLeafIndexResponse>&)>

Definition at line 54 of file content_addressed_append_only_tree.hpp.

◆ FindSiblingPathCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::FindSiblingPathCallback = std::function<void(TypedResponse<FindLeafPathResponse>&)>

Definition at line 55 of file content_addressed_append_only_tree.hpp.

◆ GetBlockForIndexCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::GetBlockForIndexCallback = std::function<void(TypedResponse<BlockForIndexResponse>&)>

Definition at line 62 of file content_addressed_append_only_tree.hpp.

◆ GetLeafCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::GetLeafCallback = std::function<void(TypedResponse<GetLeafResponse>&)>

Definition at line 56 of file content_addressed_append_only_tree.hpp.

◆ HashPathCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::HashPathCallback = std::function<void(TypedResponse<GetSiblingPathResponse>&)>

Definition at line 53 of file content_addressed_append_only_tree.hpp.

◆ MetaDataCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::MetaDataCallback = std::function<void(TypedResponse<TreeMetaResponse>&)>

Definition at line 52 of file content_addressed_append_only_tree.hpp.

◆ OptionalSiblingPath

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::OptionalSiblingPath = std::vector<std::optional<fr> >
protected

Definition at line 264 of file content_addressed_append_only_tree.hpp.

◆ ReadTransaction

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::ReadTransaction = typename Store::ReadTransaction
protected

Definition at line 261 of file content_addressed_append_only_tree.hpp.

◆ ReadTransactionPtr

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::ReadTransactionPtr = typename Store::ReadTransactionPtr
protected

Definition at line 262 of file content_addressed_append_only_tree.hpp.

◆ RemoveHistoricBlockCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::RemoveHistoricBlockCallback = std::function<void(TypedResponse<RemoveHistoricResponse>&)>

Definition at line 59 of file content_addressed_append_only_tree.hpp.

◆ RollbackCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::RollbackCallback = EmptyResponseCallback

Definition at line 58 of file content_addressed_append_only_tree.hpp.

◆ StoreType

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::StoreType = Store

Definition at line 47 of file content_addressed_append_only_tree.hpp.

◆ UnwindBlockCallback

template<typename Store , typename HashingPolicy >
using bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::UnwindBlockCallback = std::function<void(TypedResponse<UnwindResponse>&)>

Definition at line 60 of file content_addressed_append_only_tree.hpp.

Constructor & Destructor Documentation

◆ ContentAddressedAppendOnlyTree() [1/3]

template<typename Store , typename HashingPolicy >
bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::ContentAddressedAppendOnlyTree ( std::unique_ptr< Store store,
std::shared_ptr< ThreadPool workers,
const std::vector< fr > &  initial_values = {},
bool  commit_genesis_state = true 
)

Definition at line 300 of file content_addressed_append_only_tree.hpp.

◆ ContentAddressedAppendOnlyTree() [2/3]

template<typename Store , typename HashingPolicy >
bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::ContentAddressedAppendOnlyTree ( ContentAddressedAppendOnlyTree< Store, HashingPolicy > const &  other)
delete

◆ ContentAddressedAppendOnlyTree() [3/3]

template<typename Store , typename HashingPolicy >
bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::ContentAddressedAppendOnlyTree ( ContentAddressedAppendOnlyTree< Store, HashingPolicy > &&  other)
delete

◆ ~ContentAddressedAppendOnlyTree()

template<typename Store , typename HashingPolicy >
virtual bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::~ContentAddressedAppendOnlyTree ( )
virtualdefault

Member Function Documentation

◆ add_batch_internal()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::add_batch_internal ( std::vector< fr > &  values,
fr new_root,
index_t new_size,
bool  update_index,
ReadTransaction tx 
)
protected

Definition at line 1100 of file content_addressed_append_only_tree.hpp.

◆ add_value()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::add_value ( const fr value,
const AppendCompletionCallback on_completion 
)
virtual

Adds a single value to the end of the tree.

Parameters
valueThe value to be added
on_completionCallback to be called on completion

Definition at line 913 of file content_addressed_append_only_tree.hpp.

◆ add_values()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::add_values ( const std::vector< fr > &  values,
const AppendCompletionCallback on_completion 
)
virtual

Adds the given set of values to the end of the tree.

Parameters
valuesThe values to be added
on_completionCallback to be called on completion

Definition at line 920 of file content_addressed_append_only_tree.hpp.

◆ add_values_internal() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::add_values_internal ( const std::vector< fr > &  values,
const AppendCompletionCallback on_completion,
bool  update_index 
)
protected

Definition at line 927 of file content_addressed_append_only_tree.hpp.

◆ add_values_internal() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::add_values_internal ( std::shared_ptr< std::vector< fr > >  values,
fr new_root,
index_t new_size,
bool  update_index 
)
protected

Definition at line 1077 of file content_addressed_append_only_tree.hpp.

◆ checkpoint()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::checkpoint ( const CheckpointCallback on_completion)

Definition at line 967 of file content_addressed_append_only_tree.hpp.

◆ commit()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::commit ( const CommitCallback on_completion)

Commit the tree to the backing store.

Definition at line 942 of file content_addressed_append_only_tree.hpp.

◆ commit_all_checkpoints()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::commit_all_checkpoints ( const CheckpointCommitCallback on_completion)

Definition at line 990 of file content_addressed_append_only_tree.hpp.

◆ commit_checkpoint()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::commit_checkpoint ( const CheckpointCommitCallback on_completion)

Definition at line 974 of file content_addressed_append_only_tree.hpp.

◆ depth()

template<typename Store , typename HashingPolicy >
uint32_t bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::depth ( ) const
inline

Synchronous method to retrieve the depth of the tree.

Definition at line 246 of file content_addressed_append_only_tree.hpp.

◆ finalize_block()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::finalize_block ( const block_number_t blockNumber,
const FinalizeBlockCallback on_completion 
)

Definition at line 1040 of file content_addressed_append_only_tree.hpp.

◆ find_block_numbers() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_block_numbers ( const std::vector< index_t > &  indices,
const block_number_t blockNumber,
const GetBlockForIndexCallback on_completion 
) const

Returns the block numbers that correspond to the given indices values, from the perspective of a historical block number.

Definition at line 461 of file content_addressed_append_only_tree.hpp.

◆ find_block_numbers() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_block_numbers ( const std::vector< index_t > &  indices,
const GetBlockForIndexCallback on_completion 
) const

Returns the block numbers that correspond to the given indices values.

Definition at line 442 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_hash()

template<typename Store , typename HashingPolicy >
std::optional< fr > bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_hash ( const index_t leaf_index,
const RequestContext requestContext,
ReadTransaction tx,
bool  updateNodesByIndexCache = false 
) const
protected

Definition at line 554 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_indices() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_indices ( const std::vector< typename Store::LeafType > &  leaves,
bool  includeUncommitted,
const FindLeafCallback on_completion 
) const

Returns the index of the provided leaf in the tree.

Definition at line 745 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_indices() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_indices ( const std::vector< typename Store::LeafType > &  leaves,
const block_number_t blockNumber,
bool  includeUncommitted,
const FindLeafCallback on_completion 
) const

Returns the index of the provided leaf in the tree.

Definition at line 754 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_indices_from() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_indices_from ( const std::vector< typename Store::LeafType > &  leaves,
const index_t start_index,
bool  includeUncommitted,
const FindLeafCallback on_completion 
) const

Returns the index of the provided leaf in the tree only if it exists after the index value provided.

Definition at line 764 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_indices_from() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_indices_from ( const std::vector< typename Store::LeafType > &  leaves,
const index_t start_index,
const block_number_t blockNumber,
bool  includeUncommitted,
const FindLeafCallback on_completion 
) const

Returns the index of the provided leaf in the tree only if it exists after the index value provided.

Definition at line 791 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_sibling_paths() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_sibling_paths ( const std::vector< typename Store::LeafType > &  leaves,
bool  includeUncommitted,
const FindSiblingPathCallback on_completion 
) const

Returns the sibling paths for the provided leaves in the tree.

Definition at line 832 of file content_addressed_append_only_tree.hpp.

◆ find_leaf_sibling_paths() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::find_leaf_sibling_paths ( const std::vector< typename Store::LeafType > &  leaves,
const block_number_t block_number,
bool  includeUncommitted,
const FindSiblingPathCallback on_completion 
) const

Returns the sibling paths for the provided leaves in the tree.

Definition at line 867 of file content_addressed_append_only_tree.hpp.

◆ get_batch_insertion_size()

template<typename Store , typename HashingPolicy >
index_t bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_batch_insertion_size ( const index_t treeSize,
const index_t remainingAppendSize 
)
protected

Definition at line 1057 of file content_addressed_append_only_tree.hpp.

◆ get_leaf() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_leaf ( const index_t index,
bool  includeUncommitted,
const GetLeafCallback completion 
) const

Returns the leaf value at the provided index.

Parameters
indexThe index of the leaf to be retrieved
includeUncommittedWhether to include uncommitted changes
on_completionCallback to be called on completion

Definition at line 672 of file content_addressed_append_only_tree.hpp.

◆ get_leaf() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_leaf ( const index_t index,
const block_number_t blockNumber,
bool  includeUncommitted,
const GetLeafCallback completion 
) const

Returns the leaf value at the provided index.

Parameters
indexThe index of the leaf to be retrieved
blockNumberThe block number of the tree to use as a reference
includeUncommittedWhether to include uncommitted changes
on_completionCallback to be called on completion

Definition at line 697 of file content_addressed_append_only_tree.hpp.

◆ get_meta_data() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_meta_data ( bool  includeUncommitted,
const MetaDataCallback on_completion 
) const

Returns the tree meta data.

Parameters
includeUncommittedWhether to include uncommitted changes
on_completionCallback to be called on completion

Definition at line 359 of file content_addressed_append_only_tree.hpp.

◆ get_meta_data() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_meta_data ( const block_number_t blockNumber,
bool  includeUncommitted,
const MetaDataCallback on_completion 
) const

Returns the tree meta data.

Parameters
blockNumberThe block number of the tree to use as a reference
includeUncommittedWhether to include uncommitted changes
on_completionCallback to be called on completion

Definition at line 374 of file content_addressed_append_only_tree.hpp.

◆ get_sibling_path() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_sibling_path ( const index_t index,
const block_number_t blockNumber,
const HashPathCallback on_completion,
bool  includeUncommitted 
) const

Returns the sibling path from the leaf at the given index to the root.

Parameters
indexThe index at which to read the sibling path
blockNumberThe block number of the tree to use as a reference
on_completionCallback to be called on completion
includeUncommittedWhether to include uncommitted changes

Definition at line 408 of file content_addressed_append_only_tree.hpp.

◆ get_sibling_path() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_sibling_path ( const index_t index,
const HashPathCallback on_completion,
bool  includeUncommitted 
) const

Returns the sibling path from the leaf at the given index to the root.

Parameters
indexThe index at which to read the sibling path
on_completionCallback to be called on completion
includeUncommittedWhether to include uncommitted changes

Definition at line 400 of file content_addressed_append_only_tree.hpp.

◆ get_subtree_sibling_path() [1/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_subtree_sibling_path ( const index_t leaf_index,
uint32_t  subtree_depth,
const HashPathCallback on_completion,
bool  includeUncommitted 
) const

Get the subtree sibling path object to a leaf.

Parameters
leaf_indexThe depth of the subtree
subtree_depthThe depth of the subtree
on_completionCallback to be called on completion
includeUncommittedWhether to include uncommitted changes

Definition at line 513 of file content_addressed_append_only_tree.hpp.

◆ get_subtree_sibling_path() [2/2]

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_subtree_sibling_path ( uint32_t  subtree_depth,
const HashPathCallback on_completion,
bool  includeUncommitted 
) const

Get the subtree sibling path object.

Parameters
subtree_depthThe depth of the subtree
on_completionCallback to be called on completion
includeUncommittedWhether to include uncommitted changes

Definition at line 491 of file content_addressed_append_only_tree.hpp.

◆ get_subtree_sibling_path_internal()

template<typename Store , typename HashingPolicy >
ContentAddressedAppendOnlyTree< Store, HashingPolicy >::OptionalSiblingPath bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::get_subtree_sibling_path_internal ( const index_t leaf_index,
uint32_t  subtree_depth,
const RequestContext requestContext,
ReadTransaction tx 
) const
protected

Definition at line 627 of file content_addressed_append_only_tree.hpp.

◆ operator=() [1/2]

template<typename Store , typename HashingPolicy >
ContentAddressedAppendOnlyTree & bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::operator= ( ContentAddressedAppendOnlyTree< Store, HashingPolicy > const &&  other)
delete

◆ operator=() [2/2]

template<typename Store , typename HashingPolicy >
ContentAddressedAppendOnlyTree & bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::operator= ( ContentAddressedAppendOnlyTree< Store, HashingPolicy > const &  other)
delete

◆ optional_sibling_path_to_full_sibling_path()

template<typename Store , typename HashingPolicy >
fr_sibling_path bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::optional_sibling_path_to_full_sibling_path ( const OptionalSiblingPath optionalPath) const
protected

Definition at line 537 of file content_addressed_append_only_tree.hpp.

◆ remove_historic_block()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::remove_historic_block ( const block_number_t blockNumber,
const RemoveHistoricBlockCallback on_completion 
)

Definition at line 1006 of file content_addressed_append_only_tree.hpp.

◆ revert_all_checkpoints()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::revert_all_checkpoints ( const CheckpointRevertCallback on_completion)

Definition at line 998 of file content_addressed_append_only_tree.hpp.

◆ revert_checkpoint()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::revert_checkpoint ( const CheckpointRevertCallback on_completion)

Definition at line 982 of file content_addressed_append_only_tree.hpp.

◆ rollback()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::rollback ( const RollbackCallback on_completion)

Rollback the uncommitted changes.

Definition at line 955 of file content_addressed_append_only_tree.hpp.

◆ unwind_block()

template<typename Store , typename HashingPolicy >
void bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::unwind_block ( const block_number_t blockNumber,
const UnwindBlockCallback on_completion 
)

Definition at line 1023 of file content_addressed_append_only_tree.hpp.

Member Data Documentation

◆ depth_

template<typename Store , typename HashingPolicy >
uint32_t bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::depth_
protected

Definition at line 293 of file content_addressed_append_only_tree.hpp.

◆ max_size_

template<typename Store , typename HashingPolicy >
uint64_t bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::max_size_
protected

Definition at line 294 of file content_addressed_append_only_tree.hpp.

◆ store_

template<typename Store , typename HashingPolicy >
std::unique_ptr<Store> bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::store_
protected

Definition at line 292 of file content_addressed_append_only_tree.hpp.

◆ workers_

template<typename Store , typename HashingPolicy >
std::shared_ptr<ThreadPool> bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::workers_
protected

Definition at line 296 of file content_addressed_append_only_tree.hpp.

◆ zero_hashes_

template<typename Store , typename HashingPolicy >
std::vector<fr> bb::crypto::merkle_tree::ContentAddressedAppendOnlyTree< Store, HashingPolicy >::zero_hashes_
protected

Definition at line 295 of file content_addressed_append_only_tree.hpp.


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