14 if (!instance.has_value()) {
27 if (!klass.has_value()) {
69 bool is_protocol_write)
76 auto& low_leaf_hint = hint.low_leaf_witness_data.at(0);
77 auto& insertion_hint = hint.insertion_witness_data.at(0);
92 if (!is_protocol_write) {
169 low_leaf_path = insertion_result.low_leaf_witness_data.at(0).path;
170 low_leaf_preimage = insertion_result.low_leaf_witness_data.at(0).
leaf;
171 insertion_path = insertion_result.insertion_witness_data.at(0).path;
183 (void)snapshot_after;
216 note_hash,
contract_address, note_hash_counter, append_result.path, snapshot_before);
218 (void)snapshot_after;
237 note_hash_tree_check.append_siloed_note_hash(siloed_note_hash, note_hash_counter, hint.path, snapshot_before);
239 (void)snapshot_after;
253 note_hash_tree_check.append_unique_note_hash(unique_note_hash, note_hash_counter, hint.path, snapshot_before);
255 (void)snapshot_after;
285 listener->on_checkpoint_created();
297 listener->on_checkpoint_committed();
307 listener->on_checkpoint_reverted();
#define MAX_NOTE_HASHES_PER_TX
#define MAX_NULLIFIERS_PER_TX
ContractDBInterface & raw_contract_db
std::optional< ContractInstance > get_contract_instance(const AztecAddress &address) const override
std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const override
virtual std::optional< ContractInstance > get_contract_instance(const AztecAddress &address) const =0
virtual std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const =0
virtual bool exists(const FF &msg_hash, const FF &leaf_value, uint64_t leaf_index, std::span< const FF > sibling_path, const AppendOnlyTreeSnapshot &snapshot)=0
virtual IndexedLeaf< PublicDataLeafValue > get_leaf_preimage_public_data_tree(index_t leaf_index) const =0
virtual void revert_checkpoint()=0
virtual void commit_checkpoint()=0
virtual void create_checkpoint()=0
virtual std::vector< AppendLeafResult > append_leaves(MerkleTreeId tree_id, std::span< const FF > leaves)=0
virtual void pad_tree(MerkleTreeId tree_id, size_t num_leaves)=0
virtual IndexedLeaf< NullifierLeafValue > get_leaf_preimage_nullifier_tree(index_t leaf_index) const =0
virtual SequentialInsertionResult< NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const NullifierLeafValue &leaf_value)=0
virtual GetLowIndexedLeafResponse get_low_indexed_leaf(MerkleTreeId tree_id, const FF &value) const =0
virtual SiblingPath get_sibling_path(MerkleTreeId tree_id, index_t leaf_index) const =0
virtual uint32_t get_checkpoint_id() const =0
virtual SequentialInsertionResult< PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const PublicDataLeafValue &leaf_value)=0
virtual const TreeSnapshots & get_tree_roots() const =0
virtual FF get_leaf_value(MerkleTreeId tree_id, index_t leaf_index) const =0
WrittenPublicDataSlotsInterface & written_public_data_slots
void note_hash_write(const AztecAddress &contract_address, const FF ¬e_hash) override
std::vector< CheckpointNotifiable * > checkpoint_listeners
std::stack< TreeCounters > tree_counters_stack
bool nullifier_exists(const AztecAddress &contract_address, const FF &nullifier) const override
LowLevelMerkleDBInterface & raw_merkle_db
void create_checkpoint() override
void unique_note_hash_write(const FF ¬e_hash) override
TreeStates get_tree_state() const override
bool was_storage_written(const AztecAddress &contract_address, const FF &slot) const override
NullifierTreeCheckInterface & nullifier_tree_check
uint32_t get_checkpoint_id() const override
bool nullifier_write_internal(std::optional< AztecAddress > contract_address, const FF &nullifier)
bool note_hash_exists(uint64_t leaf_index, const FF &unique_note_hash) const override
void siloed_note_hash_write(const FF ¬e_hash) override
void pad_trees() override
FF storage_read(const AztecAddress &contract_address, const FF &slot) const override
bool siloed_nullifier_exists(const FF &nullifier) const override
void commit_checkpoint() override
bool nullifier_write(const AztecAddress &contract_address, const FF &nullifier) override
PublicDataTreeCheckInterface & public_data_tree_check
void storage_write(const AztecAddress &contract_address, const FF &slot, const FF &value, bool is_protocol_write) override
bool nullifier_exists_internal(std::optional< AztecAddress > contract_address, const FF &nullifier) const
void revert_checkpoint() override
bool siloed_nullifier_write(const FF &nullifier) override
L1ToL2MessageTreeCheckInterface & l1_to_l2_msg_tree_check
bool l1_to_l2_msg_exists(uint64_t leaf_index, const FF &msg_hash) const override
virtual AppendOnlyTreeSnapshot write(const FF &nullifier, std::optional< AztecAddress > contract_address, uint64_t nullifier_counter, const NullifierTreeLeafPreimage &low_leaf_preimage, uint64_t low_leaf_index, std::span< const FF > low_leaf_sibling_path, const AppendOnlyTreeSnapshot &prev_snapshot, std::optional< std::span< const FF > > insertion_sibling_path)=0
virtual void assert_read(const FF &nullifier, std::optional< AztecAddress > contract_address, bool exists, const NullifierTreeLeafPreimage &low_leaf_preimage, uint64_t low_leaf_index, std::span< const FF > sibling_path, const AppendOnlyTreeSnapshot &snapshot)=0
virtual AppendOnlyTreeSnapshot write(const FF &slot, const AztecAddress &contract_address, const FF &value, const PublicDataTreeLeafPreimage &low_leaf_preimage, uint64_t low_leaf_index, std::span< const FF > low_leaf_sibling_path, const AppendOnlyTreeSnapshot &prev_snapshot, std::span< const FF > insertion_sibling_path, bool is_protocol_write)=0
virtual void assert_read(const FF &slot, const AztecAddress &contract_address, const FF &value, const PublicDataTreeLeafPreimage &low_leaf_preimage, uint64_t low_leaf_index, std::span< const FF > sibling_path, const AppendOnlyTreeSnapshot &snapshot)=0
virtual void revert_checkpoint()=0
virtual bool contains(const AztecAddress &contract_address, const FF &slot)=0
virtual void commit_checkpoint()=0
virtual void insert(const AztecAddress &contract_address, const FF &slot)=0
virtual uint32_t size() const =0
virtual void create_checkpoint()=0
AztecAddress contract_address
::bb::crypto::merkle_tree::fr_sibling_path SiblingPath
FF unconstrained_make_unique_note_hash(const FF &siloed_note_hash, const FF &first_nullifier, uint64_t note_hash_counter)
::bb::crypto::merkle_tree::PublicDataLeafValue PublicDataLeafValue
FF unconstrained_compute_leaf_slot(const AztecAddress &contract_address, const FF &slot)
FF unconstrained_silo_note_hash(const AztecAddress &contract_address, const FF ¬e_hash)
FF unconstrained_silo_nullifier(const AztecAddress &contract_address, const FF &nullifier)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
AppendOnlyTreeSnapshot noteHashTree
AppendOnlyTreeSnapshot nullifierTree
AppendOnlyTreeSnapshot l1ToL2MessageTree
AppendOnlyTreeSnapshot publicDataTree
uint32_t nullifier_counter
uint32_t l2_to_l1_msg_counter
uint32_t note_hash_counter