8#include "../columns.hpp"
17 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_SILO_POSEIDON2";
18 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
22 static constexpr Column COUNTS = Column::lookup_written_public_data_slots_tree_check_silo_poseidon2_counts;
23 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_silo_poseidon2_inv;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
25 ColumnAndShifts::written_public_data_slots_tree_check_sel,
26 ColumnAndShifts::written_public_data_slots_tree_check_siloing_separator,
27 ColumnAndShifts::written_public_data_slots_tree_check_address,
28 ColumnAndShifts::written_public_data_slots_tree_check_slot,
29 ColumnAndShifts::written_public_data_slots_tree_check_leaf_slot
31 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
32 ColumnAndShifts::poseidon2_hash_start,
33 ColumnAndShifts::poseidon2_hash_input_0,
34 ColumnAndShifts::poseidon2_hash_input_1,
35 ColumnAndShifts::poseidon2_hash_input_2,
36 ColumnAndShifts::poseidon2_hash_output
42template <
typename FF_>
49 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_LOW_LEAF_POSEIDON2";
50 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
54 static constexpr Column COUNTS = Column::lookup_written_public_data_slots_tree_check_low_leaf_poseidon2_counts;
55 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_low_leaf_poseidon2_inv;
56 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
57 ColumnAndShifts::written_public_data_slots_tree_check_sel,
58 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_slot,
59 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_next_slot,
60 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_next_index,
61 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_hash
63 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
64 ColumnAndShifts::poseidon2_hash_start,
65 ColumnAndShifts::poseidon2_hash_input_0,
66 ColumnAndShifts::poseidon2_hash_input_1,
67 ColumnAndShifts::poseidon2_hash_input_2,
68 ColumnAndShifts::poseidon2_hash_output
74template <
typename FF_>
81 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_UPDATED_LOW_LEAF_POSEIDON2";
82 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
84 static constexpr Column SRC_SELECTOR = Column::written_public_data_slots_tree_check_should_insert;
87 Column::lookup_written_public_data_slots_tree_check_updated_low_leaf_poseidon2_counts;
89 Column::lookup_written_public_data_slots_tree_check_updated_low_leaf_poseidon2_inv;
90 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
91 ColumnAndShifts::written_public_data_slots_tree_check_sel,
92 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_slot,
93 ColumnAndShifts::written_public_data_slots_tree_check_updated_low_leaf_next_slot,
94 ColumnAndShifts::written_public_data_slots_tree_check_updated_low_leaf_next_index,
95 ColumnAndShifts::written_public_data_slots_tree_check_updated_low_leaf_hash
97 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
98 ColumnAndShifts::poseidon2_hash_start,
99 ColumnAndShifts::poseidon2_hash_input_0,
100 ColumnAndShifts::poseidon2_hash_input_1,
101 ColumnAndShifts::poseidon2_hash_input_2,
102 ColumnAndShifts::poseidon2_hash_output
108template <
typename FF_>
115 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_LOW_LEAF_MERKLE_CHECK";
116 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
120 static constexpr Column COUNTS = Column::lookup_written_public_data_slots_tree_check_low_leaf_merkle_check_counts;
121 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_low_leaf_merkle_check_inv;
122 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
123 ColumnAndShifts::written_public_data_slots_tree_check_should_insert,
124 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_hash,
125 ColumnAndShifts::written_public_data_slots_tree_check_updated_low_leaf_hash,
126 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_index,
127 ColumnAndShifts::written_public_data_slots_tree_check_tree_height,
128 ColumnAndShifts::written_public_data_slots_tree_check_root,
129 ColumnAndShifts::written_public_data_slots_tree_check_intermediate_root
131 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
132 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
133 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
134 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
135 ColumnAndShifts::merkle_check_write_root
141template <
typename FF_>
148 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_LOW_LEAF_SLOT_VALIDATION";
149 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
154 Column::lookup_written_public_data_slots_tree_check_low_leaf_slot_validation_counts;
155 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_low_leaf_slot_validation_inv;
156 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
157 ColumnAndShifts::written_public_data_slots_tree_check_leaf_slot,
158 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_slot,
159 ColumnAndShifts::written_public_data_slots_tree_check_sel
161 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
162 ColumnAndShifts::ff_gt_b,
163 ColumnAndShifts::ff_gt_result };
168template <
typename FF_>
175 static constexpr std::string_view
NAME =
176 "LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_LOW_LEAF_NEXT_SLOT_VALIDATION";
177 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
179 static constexpr Column SRC_SELECTOR = Column::written_public_data_slots_tree_check_next_slot_is_nonzero;
182 Column::lookup_written_public_data_slots_tree_check_low_leaf_next_slot_validation_counts;
184 Column::lookup_written_public_data_slots_tree_check_low_leaf_next_slot_validation_inv;
185 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
186 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_next_slot,
187 ColumnAndShifts::written_public_data_slots_tree_check_leaf_slot,
188 ColumnAndShifts::written_public_data_slots_tree_check_sel
190 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
191 ColumnAndShifts::ff_gt_b,
192 ColumnAndShifts::ff_gt_result };
197template <
typename FF_>
204 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_NEW_LEAF_POSEIDON2";
205 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
209 static constexpr Column COUNTS = Column::lookup_written_public_data_slots_tree_check_new_leaf_poseidon2_counts;
210 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_new_leaf_poseidon2_inv;
211 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
212 ColumnAndShifts::written_public_data_slots_tree_check_sel,
213 ColumnAndShifts::written_public_data_slots_tree_check_leaf_slot,
214 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_next_slot,
215 ColumnAndShifts::written_public_data_slots_tree_check_low_leaf_next_index,
216 ColumnAndShifts::written_public_data_slots_tree_check_new_leaf_hash
218 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
219 ColumnAndShifts::poseidon2_hash_start,
220 ColumnAndShifts::poseidon2_hash_input_0,
221 ColumnAndShifts::poseidon2_hash_input_1,
222 ColumnAndShifts::poseidon2_hash_input_2,
223 ColumnAndShifts::poseidon2_hash_output
229template <
typename FF_>
236 static constexpr std::string_view
NAME =
"LOOKUP_WRITTEN_PUBLIC_DATA_SLOTS_TREE_CHECK_NEW_LEAF_MERKLE_CHECK";
237 static constexpr std::string_view
RELATION_NAME =
"written_public_data_slots_tree_check";
241 static constexpr Column COUNTS = Column::lookup_written_public_data_slots_tree_check_new_leaf_merkle_check_counts;
242 static constexpr Column INVERSES = Column::lookup_written_public_data_slots_tree_check_new_leaf_merkle_check_inv;
243 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
244 ColumnAndShifts::written_public_data_slots_tree_check_sel,
245 ColumnAndShifts::precomputed_zero,
246 ColumnAndShifts::written_public_data_slots_tree_check_new_leaf_hash,
247 ColumnAndShifts::written_public_data_slots_tree_check_tree_size_before_write,
248 ColumnAndShifts::written_public_data_slots_tree_check_tree_height,
249 ColumnAndShifts::written_public_data_slots_tree_check_intermediate_root,
250 ColumnAndShifts::written_public_data_slots_tree_check_write_root
252 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
253 ColumnAndShifts::merkle_check_write, ColumnAndShifts::merkle_check_read_node,
254 ColumnAndShifts::merkle_check_write_node, ColumnAndShifts::merkle_check_index,
255 ColumnAndShifts::merkle_check_path_len, ColumnAndShifts::merkle_check_read_root,
256 ColumnAndShifts::merkle_check_write_root
262template <
typename FF_>
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr Column SRC_SELECTOR
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column SRC_SELECTOR
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr Column DST_SELECTOR
static constexpr Column SRC_SELECTOR
static constexpr Column DST_SELECTOR
static constexpr Column INVERSES
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column COUNTS
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE