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

#include <concrete_dbs.hpp>

Inheritance diagram for bb::avm2::simulation::MerkleDB:
bb::avm2::simulation::HighLevelMerkleDBInterface

Public Member Functions

 MerkleDB (LowLevelMerkleDBInterface &raw_merkle_db, PublicDataTreeCheckInterface &public_data_tree_check, NullifierTreeCheckInterface &nullifier_tree_check, NoteHashTreeCheckInterface &note_hash_tree_check, WrittenPublicDataSlotsInterface &written_public_data_slots, L1ToL2MessageTreeCheckInterface &l1_to_l2_msg_tree_check)
 
TreeStates get_tree_state () const override
 
void create_checkpoint () override
 
void commit_checkpoint () override
 
void revert_checkpoint () override
 
uint32_t get_checkpoint_id () const override
 
FF storage_read (const AztecAddress &contract_address, const FF &slot) const override
 
void storage_write (const AztecAddress &contract_address, const FF &slot, const FF &value, bool is_protocol_write) override
 
bool was_storage_written (const AztecAddress &contract_address, const FF &slot) const override
 
bool nullifier_exists (const AztecAddress &contract_address, const FF &nullifier) const override
 
bool siloed_nullifier_exists (const FF &nullifier) const override
 
bool nullifier_write (const AztecAddress &contract_address, const FF &nullifier) override
 
bool siloed_nullifier_write (const FF &nullifier) override
 
bool note_hash_exists (uint64_t leaf_index, const FF &unique_note_hash) const override
 
void note_hash_write (const AztecAddress &contract_address, const FF &note_hash) override
 
void siloed_note_hash_write (const FF &note_hash) override
 
void unique_note_hash_write (const FF &note_hash) override
 
bool l1_to_l2_msg_exists (uint64_t leaf_index, const FF &msg_hash) const override
 
void pad_trees () override
 
void add_checkpoint_listener (CheckpointNotifiable &listener)
 
LowLevelMerkleDBInterfaceas_unconstrained () const override
 
- Public Member Functions inherited from bb::avm2::simulation::HighLevelMerkleDBInterface
virtual ~HighLevelMerkleDBInterface ()=default
 

Private Types

using Slot = FF
 

Private Member Functions

bool nullifier_exists_internal (std::optional< AztecAddress > contract_address, const FF &nullifier) const
 
bool nullifier_write_internal (std::optional< AztecAddress > contract_address, const FF &nullifier)
 

Private Attributes

LowLevelMerkleDBInterfaceraw_merkle_db
 
PublicDataTreeCheckInterfacepublic_data_tree_check
 
NullifierTreeCheckInterfacenullifier_tree_check
 
NoteHashTreeCheckInterfacenote_hash_tree_check
 
WrittenPublicDataSlotsInterfacewritten_public_data_slots
 
L1ToL2MessageTreeCheckInterfacel1_to_l2_msg_tree_check
 
std::vector< CheckpointNotifiable * > checkpoint_listeners
 
std::stack< TreeCounterstree_counters_stack
 

Detailed Description

Definition at line 54 of file concrete_dbs.hpp.

Member Typedef Documentation

◆ Slot

Definition at line 118 of file concrete_dbs.hpp.

Constructor & Destructor Documentation

◆ MerkleDB()

bb::avm2::simulation::MerkleDB::MerkleDB ( LowLevelMerkleDBInterface raw_merkle_db,
PublicDataTreeCheckInterface public_data_tree_check,
NullifierTreeCheckInterface nullifier_tree_check,
NoteHashTreeCheckInterface note_hash_tree_check,
WrittenPublicDataSlotsInterface written_public_data_slots,
L1ToL2MessageTreeCheckInterface l1_to_l2_msg_tree_check 
)
inline

Definition at line 56 of file concrete_dbs.hpp.

Member Function Documentation

◆ add_checkpoint_listener()

void bb::avm2::simulation::MerkleDB::add_checkpoint_listener ( CheckpointNotifiable listener)
inline

Definition at line 100 of file concrete_dbs.hpp.

◆ as_unconstrained()

LowLevelMerkleDBInterface & bb::avm2::simulation::MerkleDB::as_unconstrained ( ) const
inlineoverridevirtual

◆ commit_checkpoint()

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

◆ create_checkpoint()

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

◆ get_checkpoint_id()

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

◆ get_tree_state()

TreeStates bb::avm2::simulation::MerkleDB::get_tree_state ( ) const
overridevirtual

Implements bb::avm2::simulation::HighLevelMerkleDBInterface.

Definition at line 37 of file concrete_dbs.cpp.

◆ l1_to_l2_msg_exists()

bool bb::avm2::simulation::MerkleDB::l1_to_l2_msg_exists ( uint64_t  leaf_index,
const FF msg_hash 
) const
overridevirtual

◆ note_hash_exists()

bool bb::avm2::simulation::MerkleDB::note_hash_exists ( uint64_t  leaf_index,
const FF unique_note_hash 
) const
overridevirtual

◆ note_hash_write()

void bb::avm2::simulation::MerkleDB::note_hash_write ( const AztecAddress contract_address,
const FF note_hash 
)
overridevirtual

◆ nullifier_exists()

bool bb::avm2::simulation::MerkleDB::nullifier_exists ( const AztecAddress contract_address,
const FF nullifier 
) const
overridevirtual

◆ nullifier_exists_internal()

bool bb::avm2::simulation::MerkleDB::nullifier_exists_internal ( std::optional< AztecAddress contract_address,
const FF nullifier 
) const
private

Definition at line 112 of file concrete_dbs.cpp.

◆ nullifier_write()

bool bb::avm2::simulation::MerkleDB::nullifier_write ( const AztecAddress contract_address,
const FF nullifier 
)
overridevirtual

◆ nullifier_write_internal()

bool bb::avm2::simulation::MerkleDB::nullifier_write_internal ( std::optional< AztecAddress contract_address,
const FF nullifier 
)
private

Definition at line 146 of file concrete_dbs.cpp.

◆ pad_trees()

void bb::avm2::simulation::MerkleDB::pad_trees ( )
overridevirtual

◆ revert_checkpoint()

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

◆ siloed_note_hash_write()

void bb::avm2::simulation::MerkleDB::siloed_note_hash_write ( const FF note_hash)
overridevirtual

◆ siloed_nullifier_exists()

bool bb::avm2::simulation::MerkleDB::siloed_nullifier_exists ( const FF nullifier) const
overridevirtual

◆ siloed_nullifier_write()

bool bb::avm2::simulation::MerkleDB::siloed_nullifier_write ( const FF nullifier)
overridevirtual

◆ storage_read()

FF bb::avm2::simulation::MerkleDB::storage_read ( const AztecAddress contract_address,
const FF slot 
) const
overridevirtual

Implements bb::avm2::simulation::HighLevelMerkleDBInterface.

Definition at line 51 of file concrete_dbs.cpp.

◆ storage_write()

void bb::avm2::simulation::MerkleDB::storage_write ( const AztecAddress contract_address,
const FF slot,
const FF value,
bool  is_protocol_write 
)
overridevirtual

Implements bb::avm2::simulation::HighLevelMerkleDBInterface.

Definition at line 66 of file concrete_dbs.cpp.

◆ unique_note_hash_write()

void bb::avm2::simulation::MerkleDB::unique_note_hash_write ( const FF note_hash)
overridevirtual

◆ was_storage_written()

bool bb::avm2::simulation::MerkleDB::was_storage_written ( const AztecAddress contract_address,
const FF slot 
) const
overridevirtual

Implements bb::avm2::simulation::HighLevelMerkleDBInterface.

Definition at line 97 of file concrete_dbs.cpp.

Member Data Documentation

◆ checkpoint_listeners

std::vector<CheckpointNotifiable*> bb::avm2::simulation::MerkleDB::checkpoint_listeners
private

Definition at line 119 of file concrete_dbs.hpp.

◆ l1_to_l2_msg_tree_check

L1ToL2MessageTreeCheckInterface& bb::avm2::simulation::MerkleDB::l1_to_l2_msg_tree_check
private

Definition at line 115 of file concrete_dbs.hpp.

◆ note_hash_tree_check

NoteHashTreeCheckInterface& bb::avm2::simulation::MerkleDB::note_hash_tree_check
private

Definition at line 113 of file concrete_dbs.hpp.

◆ nullifier_tree_check

NullifierTreeCheckInterface& bb::avm2::simulation::MerkleDB::nullifier_tree_check
private

Definition at line 112 of file concrete_dbs.hpp.

◆ public_data_tree_check

PublicDataTreeCheckInterface& bb::avm2::simulation::MerkleDB::public_data_tree_check
private

Definition at line 111 of file concrete_dbs.hpp.

◆ raw_merkle_db

LowLevelMerkleDBInterface& bb::avm2::simulation::MerkleDB::raw_merkle_db
private

Definition at line 108 of file concrete_dbs.hpp.

◆ tree_counters_stack

std::stack<TreeCounters> bb::avm2::simulation::MerkleDB::tree_counters_stack
private
Initial value:
{
{ { .note_hash_counter = 0, .nullifier_counter = 0, .l2_to_l1_msg_counter = 0 } }
}

Definition at line 122 of file concrete_dbs.hpp.

◆ written_public_data_slots

WrittenPublicDataSlotsInterface& bb::avm2::simulation::MerkleDB::written_public_data_slots
private

Definition at line 114 of file concrete_dbs.hpp.


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