25 const auto snapshot = tree.get_snapshot();
26 auto [
exists, low_leaf_index] = tree.get_low_indexed_leaf(leaf_slot);
27 auto sibling_path = tree.get_sibling_path(low_leaf_index);
28 auto low_leaf_preimage = tree.get_leaf_preimage(low_leaf_index);
37 .
value = low_leaf_preimage.leaf.slot,
38 .next_value = low_leaf_preimage.nextKey,
39 .next_index = low_leaf_preimage.nextIndex,
65 auto& [low_leaf_preimage, low_leaf_index, low_leaf_sibling_path] = insertion_result.low_leaf_witness_data.at(0);
66 std::span<FF> insertion_sibling_path = insertion_result.insertion_witness_data.at(0).path;
70 bool exists = leaf_slot == low_leaf_preimage.leaf.slot;
80 .
value = low_leaf_preimage.leaf.slot,
81 .next_value = low_leaf_preimage.nextKey,
82 .next_index = low_leaf_preimage.nextIndex,
85 low_leaf_sibling_path,
90 BB_ASSERT_EQ(next_snapshot, tree.get_snapshot(),
"Next snapshot mismatch");
#define BB_ASSERT_EQ(actual, expected,...)
#define DOM_SEP__PUBLIC_LEAF_SLOT
bool contains(const AztecAddress &contract_address, const FF &slot) override
Checks whether a public data slot exists in the written public data slots tree.
uint32_t size() const override
Returns the number of written public data slots in the tree.
AppendOnlyTreeSnapshot get_snapshot() const override
Returns the current tree snapshot from the top of the checkpoint stack.
void revert_checkpoint() override
Reverts the current checkpoint by discarding the top of the tree state stack.
std::stack< WrittenPublicDataSlotsTree > written_public_data_slots_tree_stack
void insert(const AztecAddress &contract_address, const FF &slot) override
Inserts a public data slot into the written public data slots tree.
void create_checkpoint() override
Creates a checkpoint by pushing a copy of the current tree state onto the stack.
void commit_checkpoint() override
Commits the current checkpoint by replacing the previous tree state with the current one.
AVM range check gadget for witness generation.
FF unconstrained_compute_leaf_slot(const AztecAddress &contract_address, const FF &slot)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept