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
15
16#include <optional>
17#include <stack>
18
19namespace bb::wsdb_client {
20
22 public:
29
30 avm2::TreeSnapshots get_tree_roots() const override;
31
32 // Query methods
34 avm2::simulation::index_t leaf_index) const override;
36 const avm2::FF& value) const override;
38 avm2::simulation::index_t leaf_index) const override;
40 avm2::simulation::index_t leaf_index) const override;
42 avm2::simulation::index_t leaf_index) const override;
43
44 // State modification methods
50 void pad_tree(avm2::simulation::MerkleTreeId tree_id, size_t num_leaves) override;
51
52 // Checkpoint methods
53 void create_checkpoint() override;
54 void commit_checkpoint() override;
55 void revert_checkpoint() override;
56 uint32_t get_checkpoint_id() const override;
57
58 private:
59 template <typename T> static std::vector<uint8_t> serialize_to_msgpack(const T& value);
60 template <typename T> static T deserialize_from_msgpack(const std::vector<uint8_t>& bytes);
61
64
67 std::stack<uint32_t> checkpoint_stack_{ { 0 } };
70};
71
72} // namespace bb::wsdb_client
Auto-generated IPC client.
avm2::TreeSnapshots get_tree_roots() const override
avm2::simulation::SiblingPath get_sibling_path(avm2::simulation::MerkleTreeId tree_id, avm2::simulation::index_t leaf_index) const override
static std::vector< uint8_t > serialize_to_msgpack(const T &value)
avm2::simulation::IndexedLeaf< avm2::simulation::PublicDataLeafValue > get_leaf_preimage_public_data_tree(avm2::simulation::index_t leaf_index) const override
std::optional< avm2::TreeSnapshots > cached_tree_roots_
crypto::merkle_tree::GetLowIndexedLeafResponse get_low_indexed_leaf(avm2::simulation::MerkleTreeId tree_id, const avm2::FF &value) const override
static T deserialize_from_msgpack(const std::vector< uint8_t > &bytes)
std::stack< uint32_t > checkpoint_stack_
avm2::simulation::SequentialInsertionResult< avm2::simulation::PublicDataLeafValue > insert_indexed_leaves_public_data_tree(const avm2::simulation::PublicDataLeafValue &leaf_value) override
void pad_tree(avm2::simulation::MerkleTreeId tree_id, size_t num_leaves) 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::NullifierLeafValue > insert_indexed_leaves_nullifier_tree(const avm2::simulation::NullifierLeafValue &leaf_value) override
avm2::FF get_leaf_value(avm2::simulation::MerkleTreeId tree_id, avm2::simulation::index_t leaf_index) const override
world_state::WorldStateRevision revision_
uint32_t get_checkpoint_id() const override
::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
NamedUnion command structs for the aztec-wsdb world state database API.
WsdbCommand NamedUnion, WsdbRequest context, and dispatch function.