Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::simulation::HintedRawMerkleDB Class Referencefinal

#include <raw_data_dbs.hpp>

Inheritance diagram for bb::avm2::simulation::HintedRawMerkleDB:
bb::avm2::simulation::LowLevelMerkleDBInterface

Public Member Functions

 HintedRawMerkleDB (const ExecutionHints &hints)
 
const TreeSnapshotsget_tree_roots () const override
 
SiblingPath get_sibling_path (MerkleTreeId tree_id, index_t leaf_index) const override
 
GetLowIndexedLeafResponse get_low_indexed_leaf (MerkleTreeId tree_id, const FF &value) const override
 
FF get_leaf_value (MerkleTreeId tree_id, index_t leaf_index) const override
 
IndexedLeaf< PublicDataLeafValueget_leaf_preimage_public_data_tree (index_t leaf_index) const override
 
IndexedLeaf< NullifierLeafValueget_leaf_preimage_nullifier_tree (index_t leaf_index) const override
 
SequentialInsertionResult< PublicDataLeafValueinsert_indexed_leaves_public_data_tree (const PublicDataLeafValue &leaf_value) override
 
SequentialInsertionResult< NullifierLeafValueinsert_indexed_leaves_nullifier_tree (const NullifierLeafValue &leaf_value) override
 
std::vector< AppendLeafResultappend_leaves (MerkleTreeId tree_id, std::span< const FF > leaves) override
 
void pad_tree (MerkleTreeId tree_id, size_t num_leaves) override
 
void create_checkpoint () override
 
void commit_checkpoint () override
 
void revert_checkpoint () override
 
uint32_t get_checkpoint_id () const override
 
- Public Member Functions inherited from bb::avm2::simulation::LowLevelMerkleDBInterface
virtual ~LowLevelMerkleDBInterface ()=default
 

Private Types

using GetSiblingPathKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t >
 
using GetPreviousValueIndexKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, FF >
 
using GetLeafPreimageKey = std::tuple< AppendOnlyTreeSnapshot, index_t >
 
using GetLeafValueKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t >
 
using SequentialInsertHintPublicDataTreeKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, PublicDataLeafValue >
 
using SequentialInsertHintNullifierTreeKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafValue >
 
using AppendLeavesHintKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, std::vector< FF > >
 

Private Member Functions

const AppendOnlyTreeSnapshotget_tree_info (MerkleTreeId tree_id) const
 
AppendOnlyTreeSnapshotget_tree_info (MerkleTreeId tree_id)
 
AppendLeafResult appendLeafInternal (MerkleTreeId tree_id, const FF &leaf)
 

Private Attributes

TreeSnapshots tree_roots
 
uint32_t checkpoint_action_counter = 0
 
std::stack< uint32_t > checkpoint_stack { { 0 } }
 
unordered_flat_map< GetSiblingPathKey, SiblingPathget_sibling_path_hints
 
unordered_flat_map< GetPreviousValueIndexKey, GetLowIndexedLeafResponseget_previous_value_index_hints
 
unordered_flat_map< GetLeafPreimageKey, IndexedLeaf< PublicDataLeafValue > > get_leaf_preimage_hints_public_data_tree
 
unordered_flat_map< GetLeafPreimageKey, IndexedLeaf< NullifierLeafValue > > get_leaf_preimage_hints_nullifier_tree
 
unordered_flat_map< GetLeafValueKey, FFget_leaf_value_hints
 
unordered_flat_map< SequentialInsertHintPublicDataTreeKey, SequentialInsertHint< PublicDataLeafValue > > sequential_insert_hints_public_data_tree
 
unordered_flat_map< SequentialInsertHintNullifierTreeKey, SequentialInsertHint< NullifierLeafValue > > sequential_insert_hints_nullifier_tree
 
unordered_flat_map< AppendLeavesHintKey, AppendOnlyTreeSnapshotappend_leaves_hints
 
unordered_flat_map< uint32_t, CreateCheckpointHintcreate_checkpoint_hints
 
unordered_flat_map< uint32_t, CommitCheckpointHintcommit_checkpoint_hints
 
unordered_flat_map< uint32_t, RevertCheckpointHintrevert_checkpoint_hints
 

Detailed Description

Definition at line 40 of file raw_data_dbs.hpp.

Member Typedef Documentation

◆ AppendLeavesHintKey

Definition at line 90 of file raw_data_dbs.hpp.

◆ GetLeafPreimageKey

◆ GetLeafValueKey

◆ GetPreviousValueIndexKey

◆ GetSiblingPathKey

◆ SequentialInsertHintNullifierTreeKey

◆ SequentialInsertHintPublicDataTreeKey

Constructor & Destructor Documentation

◆ HintedRawMerkleDB()

bb::avm2::simulation::HintedRawMerkleDB::HintedRawMerkleDB ( const ExecutionHints hints)

Definition at line 151 of file raw_data_dbs.cpp.

Member Function Documentation

◆ append_leaves()

std::vector< AppendLeafResult > bb::avm2::simulation::HintedRawMerkleDB::append_leaves ( world_state::MerkleTreeId  tree_id,
std::span< const FF leaves 
)
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 537 of file raw_data_dbs.cpp.

◆ appendLeafInternal()

AppendLeafResult bb::avm2::simulation::HintedRawMerkleDB::appendLeafInternal ( world_state::MerkleTreeId  tree_id,
const FF leaf 
)
private

Definition at line 563 of file raw_data_dbs.cpp.

◆ commit_checkpoint()

void bb::avm2::simulation::HintedRawMerkleDB::commit_checkpoint ( )
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 443 of file raw_data_dbs.cpp.

◆ create_checkpoint()

void bb::avm2::simulation::HintedRawMerkleDB::create_checkpoint ( )
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 413 of file raw_data_dbs.cpp.

◆ get_checkpoint_id()

uint32_t bb::avm2::simulation::HintedRawMerkleDB::get_checkpoint_id ( ) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 607 of file raw_data_dbs.cpp.

◆ get_leaf_preimage_nullifier_tree()

IndexedLeaf< NullifierLeafValue > bb::avm2::simulation::HintedRawMerkleDB::get_leaf_preimage_nullifier_tree ( index_t  leaf_index) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 318 of file raw_data_dbs.cpp.

◆ get_leaf_preimage_public_data_tree()

IndexedLeaf< PublicDataLeafValue > bb::avm2::simulation::HintedRawMerkleDB::get_leaf_preimage_public_data_tree ( index_t  leaf_index) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 301 of file raw_data_dbs.cpp.

◆ get_leaf_value()

FF bb::avm2::simulation::HintedRawMerkleDB::get_leaf_value ( world_state::MerkleTreeId  tree_id,
index_t  leaf_index 
) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 293 of file raw_data_dbs.cpp.

◆ get_low_indexed_leaf()

GetLowIndexedLeafResponse bb::avm2::simulation::HintedRawMerkleDB::get_low_indexed_leaf ( world_state::MerkleTreeId  tree_id,
const FF value 
) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 273 of file raw_data_dbs.cpp.

◆ get_sibling_path()

SiblingPath bb::avm2::simulation::HintedRawMerkleDB::get_sibling_path ( world_state::MerkleTreeId  tree_id,
index_t  leaf_index 
) const
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 254 of file raw_data_dbs.cpp.

◆ get_tree_info() [1/2]

AppendOnlyTreeSnapshot & bb::avm2::simulation::HintedRawMerkleDB::get_tree_info ( world_state::MerkleTreeId  tree_id)
private

Definition at line 249 of file raw_data_dbs.cpp.

◆ get_tree_info() [2/2]

const AppendOnlyTreeSnapshot & bb::avm2::simulation::HintedRawMerkleDB::get_tree_info ( world_state::MerkleTreeId  tree_id) const
private

Definition at line 244 of file raw_data_dbs.cpp.

◆ get_tree_roots()

const TreeSnapshots & bb::avm2::simulation::HintedRawMerkleDB::get_tree_roots ( ) const
inlineoverridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 44 of file raw_data_dbs.hpp.

◆ insert_indexed_leaves_nullifier_tree()

SequentialInsertionResult< NullifierLeafValue > bb::avm2::simulation::HintedRawMerkleDB::insert_indexed_leaves_nullifier_tree ( const NullifierLeafValue leaf_value)
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 374 of file raw_data_dbs.cpp.

◆ insert_indexed_leaves_public_data_tree()

SequentialInsertionResult< PublicDataLeafValue > bb::avm2::simulation::HintedRawMerkleDB::insert_indexed_leaves_public_data_tree ( const PublicDataLeafValue leaf_value)
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 335 of file raw_data_dbs.cpp.

◆ pad_tree()

void bb::avm2::simulation::HintedRawMerkleDB::pad_tree ( world_state::MerkleTreeId  tree_id,
size_t  num_leaves 
)
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 554 of file raw_data_dbs.cpp.

◆ revert_checkpoint()

void bb::avm2::simulation::HintedRawMerkleDB::revert_checkpoint ( )
overridevirtual

Implements bb::avm2::simulation::LowLevelMerkleDBInterface.

Definition at line 484 of file raw_data_dbs.cpp.

Member Data Documentation

◆ append_leaves_hints

unordered_flat_map<AppendLeavesHintKey, AppendOnlyTreeSnapshot> bb::avm2::simulation::HintedRawMerkleDB::append_leaves_hints
private

Definition at line 91 of file raw_data_dbs.hpp.

◆ checkpoint_action_counter

uint32_t bb::avm2::simulation::HintedRawMerkleDB::checkpoint_action_counter = 0
private

Definition at line 68 of file raw_data_dbs.hpp.

◆ checkpoint_stack

std::stack<uint32_t> bb::avm2::simulation::HintedRawMerkleDB::checkpoint_stack { { 0 } }
private

Definition at line 71 of file raw_data_dbs.hpp.

◆ commit_checkpoint_hints

unordered_flat_map< uint32_t, CommitCheckpointHint> bb::avm2::simulation::HintedRawMerkleDB::commit_checkpoint_hints
private

Definition at line 93 of file raw_data_dbs.hpp.

◆ create_checkpoint_hints

unordered_flat_map< uint32_t, CreateCheckpointHint> bb::avm2::simulation::HintedRawMerkleDB::create_checkpoint_hints
private

Definition at line 92 of file raw_data_dbs.hpp.

◆ get_leaf_preimage_hints_nullifier_tree

unordered_flat_map<GetLeafPreimageKey, IndexedLeaf<NullifierLeafValue> > bb::avm2::simulation::HintedRawMerkleDB::get_leaf_preimage_hints_nullifier_tree
private

Definition at line 80 of file raw_data_dbs.hpp.

◆ get_leaf_preimage_hints_public_data_tree

unordered_flat_map<GetLeafPreimageKey, IndexedLeaf<PublicDataLeafValue> > bb::avm2::simulation::HintedRawMerkleDB::get_leaf_preimage_hints_public_data_tree
private

Definition at line 79 of file raw_data_dbs.hpp.

◆ get_leaf_value_hints

unordered_flat_map<GetLeafValueKey, FF> bb::avm2::simulation::HintedRawMerkleDB::get_leaf_value_hints
private

Definition at line 82 of file raw_data_dbs.hpp.

◆ get_previous_value_index_hints

unordered_flat_map<GetPreviousValueIndexKey, GetLowIndexedLeafResponse> bb::avm2::simulation::HintedRawMerkleDB::get_previous_value_index_hints
private

Definition at line 77 of file raw_data_dbs.hpp.

◆ get_sibling_path_hints

unordered_flat_map<GetSiblingPathKey, SiblingPath> bb::avm2::simulation::HintedRawMerkleDB::get_sibling_path_hints
private

Definition at line 75 of file raw_data_dbs.hpp.

◆ revert_checkpoint_hints

unordered_flat_map< uint32_t, RevertCheckpointHint> bb::avm2::simulation::HintedRawMerkleDB::revert_checkpoint_hints
private

Definition at line 94 of file raw_data_dbs.hpp.

◆ sequential_insert_hints_nullifier_tree

unordered_flat_map<SequentialInsertHintNullifierTreeKey, SequentialInsertHint<NullifierLeafValue> > bb::avm2::simulation::HintedRawMerkleDB::sequential_insert_hints_nullifier_tree
private

Definition at line 89 of file raw_data_dbs.hpp.

◆ sequential_insert_hints_public_data_tree

unordered_flat_map<SequentialInsertHintPublicDataTreeKey, SequentialInsertHint<PublicDataLeafValue> > bb::avm2::simulation::HintedRawMerkleDB::sequential_insert_hints_public_data_tree
private

Definition at line 86 of file raw_data_dbs.hpp.

◆ tree_roots

TreeSnapshots bb::avm2::simulation::HintedRawMerkleDB::tree_roots
private

Definition at line 67 of file raw_data_dbs.hpp.


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