Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
retrieved_bytecodes_tree_check.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <stack>
4
#include <utility>
5
6
#include "
barretenberg/vm2/common/aztec_types.hpp
"
7
#include "
barretenberg/vm2/common/field.hpp
"
8
#include "
barretenberg/vm2/simulation/events/retrieved_bytecodes_tree_check_event.hpp
"
9
#include "
barretenberg/vm2/simulation/gadgets/field_gt.hpp
"
10
#include "
barretenberg/vm2/simulation/gadgets/merkle_check.hpp
"
11
#include "
barretenberg/vm2/simulation/gadgets/poseidon2.hpp
"
12
#include "
barretenberg/vm2/simulation/interfaces/db.hpp
"
13
#include "
barretenberg/vm2/simulation/interfaces/retrieved_bytecodes_tree_check.hpp
"
14
#include "
barretenberg/vm2/simulation/lib/retrieved_bytecodes_tree.hpp
"
15
16
namespace
bb::avm2::simulation
{
17
18
class
RetrievedBytecodesTreeCheck
:
public
RetrievedBytecodesTreeCheckInterface
{
19
public
:
20
RetrievedBytecodesTreeCheck
(
Poseidon2Interface
&
poseidon2
,
21
MerkleCheckInterface
&
merkle_check
,
22
FieldGreaterThanInterface
&
field_gt
,
23
RetrievedBytecodesTree
initial_state,
24
EventEmitterInterface<RetrievedBytecodesTreeCheckEvent>
& read_event_emitter)
25
:
events
(read_event_emitter)
26
,
poseidon2
(
poseidon2
)
27
,
merkle_check
(
merkle_check
)
28
,
field_gt
(
field_gt
)
29
,
tree
(
std
::move(initial_state))
30
{}
31
32
bool
contains
(
const
FF
&
class_id
)
override
;
33
34
void
insert
(
const
FF
&
class_id
)
override
;
35
36
AppendOnlyTreeSnapshot
get_snapshot
()
const override
;
37
38
uint32_t
size
()
const override
;
39
40
private
:
41
EventEmitterInterface<RetrievedBytecodesTreeCheckEvent>
&
events
;
42
Poseidon2Interface
&
poseidon2
;
43
MerkleCheckInterface
&
merkle_check
;
44
FieldGreaterThanInterface
&
field_gt
;
45
46
RetrievedBytecodesTree
tree
;
47
48
void
validate_low_leaf_jumps_over_class_id
(
const
RetrievedBytecodesTreeLeafPreimage
& low_leaf_preimage,
49
const
FF
&
class_id
);
50
};
51
52
}
// namespace bb::avm2::simulation
aztec_types.hpp
bb::avm2::merkle_check
Definition
merkle_check.hpp:34
bb::avm2::simulation::EventEmitterInterface
Definition
event_emitter.hpp:10
bb::avm2::simulation::FieldGreaterThanInterface
Definition
field_gt.hpp:8
bb::avm2::simulation::IndexedMemoryTree< ClassIdLeafValue, Poseidon2HashPolicy >
bb::avm2::simulation::MerkleCheckInterface
Definition
merkle_check.hpp:10
bb::avm2::simulation::Poseidon2Interface
Definition
poseidon2.hpp:14
bb::avm2::simulation::RetrievedBytecodesTreeCheck
Definition
retrieved_bytecodes_tree_check.hpp:18
bb::avm2::simulation::RetrievedBytecodesTreeCheck::merkle_check
MerkleCheckInterface & merkle_check
Definition
retrieved_bytecodes_tree_check.hpp:43
bb::avm2::simulation::RetrievedBytecodesTreeCheck::poseidon2
Poseidon2Interface & poseidon2
Definition
retrieved_bytecodes_tree_check.hpp:42
bb::avm2::simulation::RetrievedBytecodesTreeCheck::validate_low_leaf_jumps_over_class_id
void validate_low_leaf_jumps_over_class_id(const RetrievedBytecodesTreeLeafPreimage &low_leaf_preimage, const FF &class_id)
Definition
retrieved_bytecodes_tree_check.cpp:8
bb::avm2::simulation::RetrievedBytecodesTreeCheck::contains
bool contains(const FF &class_id) override
Definition
retrieved_bytecodes_tree_check.cpp:19
bb::avm2::simulation::RetrievedBytecodesTreeCheck::events
EventEmitterInterface< RetrievedBytecodesTreeCheckEvent > & events
Definition
retrieved_bytecodes_tree_check.hpp:41
bb::avm2::simulation::RetrievedBytecodesTreeCheck::tree
RetrievedBytecodesTree tree
Definition
retrieved_bytecodes_tree_check.hpp:46
bb::avm2::simulation::RetrievedBytecodesTreeCheck::insert
void insert(const FF &class_id) override
Definition
retrieved_bytecodes_tree_check.cpp:52
bb::avm2::simulation::RetrievedBytecodesTreeCheck::size
uint32_t size() const override
Definition
retrieved_bytecodes_tree_check.cpp:116
bb::avm2::simulation::RetrievedBytecodesTreeCheck::field_gt
FieldGreaterThanInterface & field_gt
Definition
retrieved_bytecodes_tree_check.hpp:44
bb::avm2::simulation::RetrievedBytecodesTreeCheck::get_snapshot
AppendOnlyTreeSnapshot get_snapshot() const override
Definition
retrieved_bytecodes_tree_check.cpp:111
bb::avm2::simulation::RetrievedBytecodesTreeCheck::RetrievedBytecodesTreeCheck
RetrievedBytecodesTreeCheck(Poseidon2Interface &poseidon2, MerkleCheckInterface &merkle_check, FieldGreaterThanInterface &field_gt, RetrievedBytecodesTree initial_state, EventEmitterInterface< RetrievedBytecodesTreeCheckEvent > &read_event_emitter)
Definition
retrieved_bytecodes_tree_check.hpp:20
bb::avm2::simulation::RetrievedBytecodesTreeCheckInterface
Definition
retrieved_bytecodes_tree_check.hpp:15
bb::crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
class_id
FF class_id
Definition
retrieved_bytecodes_tree_check.test.cpp:90
db.hpp
field_gt.hpp
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
std
STL namespace.
retrieved_bytecodes_tree.hpp
retrieved_bytecodes_tree_check_event.hpp
merkle_check.hpp
retrieved_bytecodes_tree_check.hpp
bb::avm2::AppendOnlyTreeSnapshot
Definition
aztec_types.hpp:293
bb::crypto::merkle_tree::IndexedLeaf< ClassIdLeafValue >
field.hpp
poseidon2.hpp
src
barretenberg
vm2
simulation
gadgets
retrieved_bytecodes_tree_check.hpp
Generated by
1.9.8