8#include "../columns.hpp"
17 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_PHASE_SPEC";
22 static constexpr Column COUNTS = Column::lookup_tx_read_phase_spec_counts;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
25 ColumnAndShifts::tx_phase_value,
26 ColumnAndShifts::tx_is_public_call_request,
27 ColumnAndShifts::tx_is_teardown,
28 ColumnAndShifts::tx_is_collect_fee,
29 ColumnAndShifts::tx_is_tree_padding,
30 ColumnAndShifts::tx_is_cleanup,
31 ColumnAndShifts::tx_is_revertible,
32 ColumnAndShifts::tx_read_pi_start_offset,
33 ColumnAndShifts::tx_read_pi_length_offset,
34 ColumnAndShifts::tx_sel_non_revertible_append_note_hash,
35 ColumnAndShifts::tx_sel_non_revertible_append_nullifier,
36 ColumnAndShifts::tx_sel_non_revertible_append_l2_l1_msg,
37 ColumnAndShifts::tx_sel_revertible_append_note_hash,
38 ColumnAndShifts::tx_sel_revertible_append_nullifier,
39 ColumnAndShifts::tx_sel_revertible_append_l2_l1_msg,
40 ColumnAndShifts::tx_next_phase_on_revert
42 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
43 ColumnAndShifts::precomputed_clk,
44 ColumnAndShifts::precomputed_is_public_call_request,
45 ColumnAndShifts::precomputed_is_teardown,
46 ColumnAndShifts::precomputed_is_collect_fee,
47 ColumnAndShifts::precomputed_is_tree_padding,
48 ColumnAndShifts::precomputed_is_cleanup,
49 ColumnAndShifts::precomputed_is_revertible,
50 ColumnAndShifts::precomputed_read_pi_start_offset,
51 ColumnAndShifts::precomputed_read_pi_length_offset,
52 ColumnAndShifts::precomputed_sel_non_revertible_append_note_hash,
53 ColumnAndShifts::precomputed_sel_non_revertible_append_nullifier,
54 ColumnAndShifts::precomputed_sel_non_revertible_append_l2_l1_msg,
55 ColumnAndShifts::precomputed_sel_revertible_append_note_hash,
56 ColumnAndShifts::precomputed_sel_revertible_append_nullifier,
57 ColumnAndShifts::precomputed_sel_revertible_append_l2_l1_msg,
58 ColumnAndShifts::precomputed_next_phase_on_revert
63template <
typename FF_>
69 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_PHASE_LENGTH";
74 static constexpr Column COUNTS = Column::lookup_tx_read_phase_length_counts;
76 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
77 ColumnAndShifts::tx_read_pi_length_offset, ColumnAndShifts::tx_remaining_phase_counter
79 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
80 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
85template <
typename FF_>
91 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_PUBLIC_CALL_REQUEST_PHASE";
96 static constexpr Column COUNTS = Column::lookup_tx_read_public_call_request_phase_counts;
97 static constexpr Column INVERSES = Column::lookup_tx_read_public_call_request_phase_inv;
98 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = { ColumnAndShifts::tx_read_pi_offset,
99 ColumnAndShifts::tx_msg_sender,
100 ColumnAndShifts::tx_contract_addr,
101 ColumnAndShifts::tx_is_static,
102 ColumnAndShifts::tx_calldata_hash };
103 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
104 ColumnAndShifts::precomputed_clk,
105 ColumnAndShifts::public_inputs_cols_0_,
106 ColumnAndShifts::public_inputs_cols_1_,
107 ColumnAndShifts::public_inputs_cols_2_,
108 ColumnAndShifts::public_inputs_cols_3_
114template <
typename FF_>
121 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_TREE_INSERT_VALUE";
126 static constexpr Column COUNTS = Column::lookup_tx_read_tree_insert_value_counts;
128 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = { ColumnAndShifts::tx_read_pi_offset,
129 ColumnAndShifts::tx_leaf_value };
130 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
131 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
136template <
typename FF_>
142 static constexpr std::string_view
NAME =
"LOOKUP_TX_NOTE_HASH_APPEND";
147 static constexpr Column COUNTS = Column::lookup_tx_note_hash_append_counts;
149 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
150 ColumnAndShifts::tx_leaf_value,
151 ColumnAndShifts::tx_prev_note_hash_tree_size,
152 ColumnAndShifts::tx_prev_note_hash_tree_root,
153 ColumnAndShifts::precomputed_zero,
154 ColumnAndShifts::tx_sel_revertible_append_note_hash,
155 ColumnAndShifts::tx_prev_num_note_hashes_emitted,
156 ColumnAndShifts::tx_discard,
157 ColumnAndShifts::tx_next_note_hash_tree_root
159 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
160 ColumnAndShifts::note_hash_tree_check_note_hash, ColumnAndShifts::note_hash_tree_check_leaf_index,
161 ColumnAndShifts::note_hash_tree_check_prev_root, ColumnAndShifts::note_hash_tree_check_should_silo,
162 ColumnAndShifts::note_hash_tree_check_should_unique, ColumnAndShifts::note_hash_tree_check_note_hash_index,
163 ColumnAndShifts::note_hash_tree_check_discard, ColumnAndShifts::note_hash_tree_check_next_root
168template <
typename FF_>
174 static constexpr std::string_view
NAME =
"LOOKUP_TX_NULLIFIER_APPEND";
179 static constexpr Column COUNTS = Column::lookup_tx_nullifier_append_counts;
181 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
182 ColumnAndShifts::tx_leaf_value,
183 ColumnAndShifts::tx_prev_nullifier_tree_root,
184 ColumnAndShifts::tx_reverted,
185 ColumnAndShifts::tx_next_nullifier_tree_root,
186 ColumnAndShifts::tx_prev_nullifier_tree_size,
187 ColumnAndShifts::tx_discard,
188 ColumnAndShifts::tx_prev_num_nullifiers_emitted,
189 ColumnAndShifts::precomputed_zero
191 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
192 ColumnAndShifts::nullifier_check_nullifier,
193 ColumnAndShifts::nullifier_check_root,
194 ColumnAndShifts::nullifier_check_exists,
195 ColumnAndShifts::nullifier_check_write_root,
196 ColumnAndShifts::nullifier_check_tree_size_before_write,
197 ColumnAndShifts::nullifier_check_discard,
198 ColumnAndShifts::nullifier_check_nullifier_index,
199 ColumnAndShifts::nullifier_check_should_silo
204template <
typename FF_>
210 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_L2_L1_MSG";
215 static constexpr Column COUNTS = Column::lookup_tx_read_l2_l1_msg_counts;
217 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
218 ColumnAndShifts::tx_read_pi_offset,
219 ColumnAndShifts::tx_l2_l1_msg_recipient,
220 ColumnAndShifts::tx_l2_l1_msg_content,
221 ColumnAndShifts::tx_l2_l1_msg_contract_address
223 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
224 ColumnAndShifts::precomputed_clk,
225 ColumnAndShifts::public_inputs_cols_0_,
226 ColumnAndShifts::public_inputs_cols_1_,
227 ColumnAndShifts::public_inputs_cols_2_
232template <
typename FF_>
238 static constexpr std::string_view
NAME =
"LOOKUP_TX_WRITE_L2_L1_MSG";
243 static constexpr Column COUNTS = Column::lookup_tx_write_l2_l1_msg_counts;
245 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
246 ColumnAndShifts::tx_write_pi_offset,
247 ColumnAndShifts::tx_l2_l1_msg_recipient,
248 ColumnAndShifts::tx_l2_l1_msg_content,
249 ColumnAndShifts::tx_l2_l1_msg_contract_address
251 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
252 ColumnAndShifts::precomputed_clk,
253 ColumnAndShifts::public_inputs_cols_0_,
254 ColumnAndShifts::public_inputs_cols_1_,
255 ColumnAndShifts::public_inputs_cols_2_
260template <
typename FF_>
266 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_EFFECTIVE_FEE_PUBLIC_INPUTS";
271 static constexpr Column COUNTS = Column::lookup_tx_read_effective_fee_public_inputs_counts;
272 static constexpr Column INVERSES = Column::lookup_tx_read_effective_fee_public_inputs_inv;
273 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
274 ColumnAndShifts::tx_read_pi_offset,
275 ColumnAndShifts::tx_effective_fee_per_da_gas,
276 ColumnAndShifts::tx_effective_fee_per_l2_gas
278 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
279 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_, ColumnAndShifts::public_inputs_cols_1_
285template <
typename FF_>
292 static constexpr std::string_view
NAME =
"LOOKUP_TX_READ_FEE_PAYER_PUBLIC_INPUTS";
297 static constexpr Column COUNTS = Column::lookup_tx_read_fee_payer_public_inputs_counts;
298 static constexpr Column INVERSES = Column::lookup_tx_read_fee_payer_public_inputs_inv;
299 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
300 ColumnAndShifts::tx_fee_payer_pi_offset, ColumnAndShifts::tx_fee_payer
302 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
303 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
309template <
typename FF_>
316 static constexpr std::string_view
NAME =
"LOOKUP_TX_BALANCE_SLOT_POSEIDON2";
321 static constexpr Column COUNTS = Column::lookup_tx_balance_slot_poseidon2_counts;
323 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
324 ColumnAndShifts::tx_is_collect_fee,
325 ColumnAndShifts::tx_fee_juice_balances_slot_constant,
326 ColumnAndShifts::tx_fee_payer,
327 ColumnAndShifts::precomputed_zero,
328 ColumnAndShifts::tx_fee_juice_balance_slot
330 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
331 ColumnAndShifts::poseidon2_hash_start,
332 ColumnAndShifts::poseidon2_hash_input_0,
333 ColumnAndShifts::poseidon2_hash_input_1,
334 ColumnAndShifts::poseidon2_hash_input_2,
335 ColumnAndShifts::poseidon2_hash_output
340template <
typename FF_>
346 static constexpr std::string_view
NAME =
"LOOKUP_TX_BALANCE_READ";
351 static constexpr Column COUNTS = Column::lookup_tx_balance_read_counts;
353 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
354 ColumnAndShifts::tx_fee_payer_balance,
355 ColumnAndShifts::tx_fee_juice_contract_address,
356 ColumnAndShifts::tx_fee_juice_balance_slot,
357 ColumnAndShifts::tx_prev_public_data_tree_root
359 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
360 ColumnAndShifts::public_data_check_value,
361 ColumnAndShifts::public_data_check_address,
362 ColumnAndShifts::public_data_check_slot,
363 ColumnAndShifts::public_data_check_root
368template <
typename FF_>
374 static constexpr std::string_view
NAME =
"LOOKUP_TX_BALANCE_VALIDATION";
379 static constexpr Column COUNTS = Column::lookup_tx_balance_validation_counts;
381 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = {
382 ColumnAndShifts::tx_fee, ColumnAndShifts::tx_fee_payer_balance, ColumnAndShifts::precomputed_zero
384 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = { ColumnAndShifts::ff_gt_a,
385 ColumnAndShifts::ff_gt_b,
386 ColumnAndShifts::ff_gt_result };
390template <
typename FF_>
396 static constexpr std::string_view
NAME =
"LOOKUP_TX_WRITE_FEE_PUBLIC_INPUTS";
401 static constexpr Column COUNTS = Column::lookup_tx_write_fee_public_inputs_counts;
402 static constexpr Column INVERSES = Column::lookup_tx_write_fee_public_inputs_inv;
403 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
SRC_COLUMNS = { ColumnAndShifts::tx_write_pi_offset,
404 ColumnAndShifts::tx_fee };
405 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE>
DST_COLUMNS = {
406 ColumnAndShifts::precomputed_clk, ColumnAndShifts::public_inputs_cols_0_
411template <
typename FF_>
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr Column COUNTS
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view RELATION_NAME
static constexpr Column DST_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::string_view NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr Column COUNTS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME
static constexpr Column INVERSES
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column INVERSES
static constexpr std::string_view RELATION_NAME
static constexpr Column COUNTS
static constexpr Column SRC_SELECTOR
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr Column SRC_SELECTOR
static constexpr std::string_view RELATION_NAME
static constexpr Column INVERSES
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::string_view NAME
static constexpr Column SRC_SELECTOR
static constexpr Column INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column COUNTS
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 std::string_view RELATION_NAME
static constexpr std::string_view NAME
static constexpr Column COUNTS
static constexpr Column INVERSES
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::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::string_view NAME
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column SRC_SELECTOR
static constexpr Column COUNTS
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 INVERSES
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr size_t LOOKUP_TUPLE_SIZE
static constexpr Column COUNTS
static constexpr Column DST_SELECTOR
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::string_view NAME
static constexpr std::string_view RELATION_NAME