Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
merkle_check_event.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
barretenberg/vm2/common/field.hpp
"
4
5
#include <cstdint>
6
#include <vector>
7
8
namespace
bb::avm2::simulation
{
9
10
/* A Merkle check event has 2 flavors: READ (assert membership) or WRITE (write a new leaf).
11
* The distinction between the two flavors in the event is not explicit but relies on the `new_leaf_value` field.
12
* If `new_leaf_value` is present, it means the event is a WRITE event.
13
* If `new_leaf_value` is absent, it means the event is a READ event.
14
* Same for `new_root` field.
15
* leaf_value, leaf_index, sibling_path, root are common to both flavors and are explicitly set for both flavors.
16
*/
17
struct
MerkleCheckEvent
{
18
FF
leaf_value
= 0;
19
std::optional<FF>
new_leaf_value
;
20
uint64_t
leaf_index
= 0;
21
std::vector<FF>
sibling_path
;
22
FF
root
= 0;
23
std::optional<FF>
new_root
;
24
25
bool
operator==
(
const
MerkleCheckEvent
& other)
const
=
default
;
26
};
27
28
}
// namespace bb::avm2::simulation
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
std::get
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition
tuple.hpp:13
bb::avm2::simulation::MerkleCheckEvent
Definition
merkle_check_event.hpp:17
bb::avm2::simulation::MerkleCheckEvent::leaf_index
uint64_t leaf_index
Definition
merkle_check_event.hpp:20
bb::avm2::simulation::MerkleCheckEvent::root
FF root
Definition
merkle_check_event.hpp:22
bb::avm2::simulation::MerkleCheckEvent::new_leaf_value
std::optional< FF > new_leaf_value
Definition
merkle_check_event.hpp:19
bb::avm2::simulation::MerkleCheckEvent::operator==
bool operator==(const MerkleCheckEvent &other) const =default
bb::avm2::simulation::MerkleCheckEvent::new_root
std::optional< FF > new_root
Definition
merkle_check_event.hpp:23
bb::avm2::simulation::MerkleCheckEvent::leaf_value
FF leaf_value
Definition
merkle_check_event.hpp:18
bb::avm2::simulation::MerkleCheckEvent::sibling_path
std::vector< FF > sibling_path
Definition
merkle_check_event.hpp:21
field.hpp
src
barretenberg
vm2
simulation
events
merkle_check_event.hpp
Generated by
1.9.8