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

#include <concrete_dbs.hpp>

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

Public Member Functions

 PureMerkleDB (const FF &first_nullifier, LowLevelMerkleDBInterface &raw_merkle_db, WrittenPublicDataSlotsInterface &written_public_data_slots)
 
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
 
void nullifier_write (const AztecAddress &contract_address, const FF &nullifier) override
 
void 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
 
void nullifier_write_internal (std::optional< AztecAddress > contract_address, const FF &nullifier)
 

Private Attributes

FF first_nullifier
 
LowLevelMerkleDBInterfaceraw_merkle_db
 
WrittenPublicDataSlotsInterfacewritten_public_data_slots
 
std::vector< CheckpointNotifiable * > checkpoint_listeners
 
std::stack< TreeCounterstree_counters_stack
 

Detailed Description

Definition at line 29 of file concrete_dbs.hpp.

Member Typedef Documentation

◆ Slot

Definition at line 84 of file concrete_dbs.hpp.

Constructor & Destructor Documentation

◆ PureMerkleDB()

bb::avm2::simulation::PureMerkleDB::PureMerkleDB ( const FF first_nullifier,
LowLevelMerkleDBInterface raw_merkle_db,
WrittenPublicDataSlotsInterface written_public_data_slots 
)
inline

Definition at line 31 of file concrete_dbs.hpp.

Member Function Documentation

◆ add_checkpoint_listener()

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

Definition at line 69 of file concrete_dbs.hpp.

◆ as_unconstrained()

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

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

Definition at line 71 of file concrete_dbs.hpp.

◆ commit_checkpoint()

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

◆ create_checkpoint()

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

◆ get_checkpoint_id()

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

◆ get_tree_state()

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

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

Definition at line 22 of file concrete_dbs.cpp.

◆ l1_to_l2_msg_exists()

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

◆ note_hash_exists()

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

◆ note_hash_write()

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

◆ nullifier_exists()

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

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

Definition at line 68 of file concrete_dbs.cpp.

◆ nullifier_exists_internal()

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

Definition at line 78 of file concrete_dbs.cpp.

◆ nullifier_write()

void bb::avm2::simulation::PureMerkleDB::nullifier_write ( const AztecAddress contract_address,
const FF nullifier 
)
overridevirtual

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

Definition at line 91 of file concrete_dbs.cpp.

◆ nullifier_write_internal()

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

Definition at line 101 of file concrete_dbs.cpp.

◆ pad_trees()

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

◆ revert_checkpoint()

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

◆ siloed_note_hash_write()

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

◆ siloed_nullifier_exists()

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

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

Definition at line 73 of file concrete_dbs.cpp.

◆ siloed_nullifier_write()

void bb::avm2::simulation::PureMerkleDB::siloed_nullifier_write ( const FF nullifier)
overridevirtual

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

Definition at line 96 of file concrete_dbs.cpp.

◆ storage_read()

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

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

Definition at line 36 of file concrete_dbs.cpp.

◆ storage_write()

void bb::avm2::simulation::PureMerkleDB::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 50 of file concrete_dbs.cpp.

◆ unique_note_hash_write()

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

◆ was_storage_written()

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

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

Definition at line 63 of file concrete_dbs.cpp.

Member Data Documentation

◆ checkpoint_listeners

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

Definition at line 85 of file concrete_dbs.hpp.

◆ first_nullifier

FF bb::avm2::simulation::PureMerkleDB::first_nullifier
private

Definition at line 77 of file concrete_dbs.hpp.

◆ raw_merkle_db

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

Definition at line 78 of file concrete_dbs.hpp.

◆ tree_counters_stack

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

Definition at line 88 of file concrete_dbs.hpp.

◆ written_public_data_slots

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

Definition at line 81 of file concrete_dbs.hpp.


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