Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
wsdb_ipc_merkle_db.hpp
Go to the documentation of this file.
1#pragma once
13
14#include <optional>
15#include <stack>
16
17namespace bb::avm2::simulation {
18
20 public:
26 WsdbIpcMerkleDB(wsdb::WsdbIpcClient& client, world_state::WorldStateRevision revision);
27
28 avm2::TreeSnapshots get_tree_roots() const override;
29
30 // Query methods
32 avm2::simulation::index_t leaf_index) const override;
34 const avm2::FF& value) const override;
36 avm2::simulation::index_t leaf_index) const override;
38 avm2::simulation::index_t leaf_index) const override;
40 avm2::simulation::index_t leaf_index) const override;
41
42 // State modification methods
48 void pad_tree(avm2::simulation::MerkleTreeId tree_id, size_t num_leaves) override;
49
50 // Checkpoint methods
51 void create_checkpoint() override;
52 void commit_checkpoint() override;
53 void revert_checkpoint() override;
54 uint32_t get_checkpoint_id() const override;
55
56 private:
59
60 wsdb::WsdbIpcClient& client_;
62 std::stack<uint32_t> checkpoint_stack_{ { 0 } };
65};
66
67} // namespace bb::avm2::simulation
avm2::simulation::IndexedLeaf< avm2::simulation::PublicDataLeafValue > get_leaf_preimage_public_data_tree(avm2::simulation::index_t leaf_index) const override
world_state::WorldStateRevision revision_
avm2::FF get_leaf_value(avm2::simulation::MerkleTreeId tree_id, avm2::simulation::index_t leaf_index) const override
crypto::merkle_tree::GetLowIndexedLeafResponse get_low_indexed_leaf(avm2::simulation::MerkleTreeId tree_id, const avm2::FF &value) const override
void pad_tree(avm2::simulation::MerkleTreeId tree_id, size_t num_leaves) override
avm2::simulation::SequentialInsertionResult< avm2::simulation::NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const avm2::simulation::NullifierLeafValue &leaf_value) override
avm2::TreeSnapshots get_tree_roots() const override
avm2::simulation::IndexedLeaf< avm2::simulation::NullifierLeafValue > get_leaf_preimage_nullifier_tree(avm2::simulation::index_t leaf_index) const override
void append_leaves(avm2::simulation::MerkleTreeId tree_id, std::span< const avm2::FF > leaves) override
avm2::simulation::SequentialInsertionResult< avm2::simulation::PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const avm2::simulation::PublicDataLeafValue &leaf_value) override
std::optional< avm2::TreeSnapshots > cached_tree_roots_
avm2::simulation::SiblingPath get_sibling_path(avm2::simulation::MerkleTreeId tree_id, avm2::simulation::index_t leaf_index) const override
AVM range check gadget for witness generation.
::bb::crypto::merkle_tree::fr_sibling_path SiblingPath
Definition db.hpp:36
::bb::crypto::merkle_tree::index_t index_t
Definition db.hpp:37
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13