Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
side_effect_tracking_db.hpp
Go to the documentation of this file.
1#pragma once
2
7
8namespace bb::avm2::simulation {
9
17 public:
25
26 // These methods just delegate to the merkle db.
27 FF storage_read(const AztecAddress& contract_address, const FF& slot) const override;
28 bool was_storage_written(const AztecAddress& contract_address, const FF& slot) const override;
29 bool nullifier_exists(const AztecAddress& contract_address, const FF& nullifier) const override;
30 bool siloed_nullifier_exists(const FF& nullifier) const override;
31 bool note_hash_exists(uint64_t leaf_index, const FF& unique_note_hash) const override;
32 bool l1_to_l2_msg_exists(uint64_t leaf_index, const FF& msg_hash) const override;
33 uint32_t get_checkpoint_id() const override;
34 TreeStates get_tree_state() const override;
36
37 // These methods track the side effects and delegate to the merkle db.
39 const FF& slot,
40 const FF& value,
41 bool is_protocol_write) override;
42 void nullifier_write(const AztecAddress& contract_address, const FF& nullifier) override;
43 void siloed_nullifier_write(const FF& nullifier) override;
44 void note_hash_write(const AztecAddress& contract_address, const FF& note_hash) override;
45 void siloed_note_hash_write(const FF& note_hash) override;
46 void unique_note_hash_write(const FF& note_hash) override;
47 void pad_trees() override;
48
49 // These methods notify the tracked container, and delegate to the merkle db.
50 void create_checkpoint() override;
51 void commit_checkpoint() override;
52 void revert_checkpoint() override;
53
54 private:
58};
59
60} // namespace bb::avm2::simulation
A high-level merkle db that tracks side effects.
void unique_note_hash_write(const FF &note_hash) override
SideEffectTrackingDB(const FF &first_nullifier, HighLevelMerkleDBInterface &merkle_db, SideEffectTrackerInterface &tracked_side_effects)
bool siloed_nullifier_exists(const FF &nullifier) const override
void nullifier_write(const AztecAddress &contract_address, const FF &nullifier) override
bool note_hash_exists(uint64_t leaf_index, const FF &unique_note_hash) const override
LowLevelMerkleDBInterface & as_unconstrained() const override
FF storage_read(const AztecAddress &contract_address, const FF &slot) const override
bool l1_to_l2_msg_exists(uint64_t leaf_index, const FF &msg_hash) const override
void siloed_nullifier_write(const FF &nullifier) 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 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
AvmFlavorSettings::FF FF
Definition field.hpp:10