Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
lookups_execution.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
4#include <cstddef>
5#include <string_view>
6#include <tuple>
7
8#include "../columns.hpp"
11
12namespace bb::avm2 {
13
15
17 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_BYTECODE_RETRIEVAL_RESULT";
18 static constexpr std::string_view RELATION_NAME = "execution";
19 static constexpr size_t LOOKUP_TUPLE_SIZE = 5;
20 static constexpr Column SRC_SELECTOR = Column::execution_sel_first_row_in_context;
21 static constexpr Column DST_SELECTOR = Column::bc_retrieval_sel;
22 static constexpr Column COUNTS = Column::lookup_execution_bytecode_retrieval_result_counts;
23 static constexpr Column INVERSES = Column::lookup_execution_bytecode_retrieval_result_inv;
24 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
25 ColumnAndShifts::execution_bytecode_id,
26 ColumnAndShifts::execution_contract_address,
27 ColumnAndShifts::execution_prev_nullifier_tree_root,
28 ColumnAndShifts::execution_prev_public_data_tree_root,
29 ColumnAndShifts::execution_sel_bytecode_retrieval_failure
30 };
31 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
32 ColumnAndShifts::bc_retrieval_bytecode_id,
33 ColumnAndShifts::bc_retrieval_address,
34 ColumnAndShifts::bc_retrieval_nullifier_tree_root,
35 ColumnAndShifts::bc_retrieval_public_data_tree_root,
36 ColumnAndShifts::bc_retrieval_error
37 };
38};
39
42template <typename FF_>
45
47
49 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_INSTRUCTION_FETCHING_RESULT";
50 static constexpr std::string_view RELATION_NAME = "execution";
51 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
52 static constexpr Column SRC_SELECTOR = Column::execution_sel_bytecode_retrieval_success;
53 static constexpr Column DST_SELECTOR = Column::instr_fetching_sel;
54 static constexpr Column COUNTS = Column::lookup_execution_instruction_fetching_result_counts;
55 static constexpr Column INVERSES = Column::lookup_execution_instruction_fetching_result_inv;
56 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
57 ColumnAndShifts::execution_pc,
58 ColumnAndShifts::execution_bytecode_id,
59 ColumnAndShifts::execution_sel_instruction_fetching_failure
60 };
61 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
62 ColumnAndShifts::instr_fetching_pc,
63 ColumnAndShifts::instr_fetching_bytecode_id,
64 ColumnAndShifts::instr_fetching_sel_parsing_err
65 };
66};
67
70template <typename FF_>
73
75
77 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_INSTRUCTION_FETCHING_BODY";
78 static constexpr std::string_view RELATION_NAME = "execution";
79 static constexpr size_t LOOKUP_TUPLE_SIZE = 12;
80 static constexpr Column SRC_SELECTOR = Column::execution_sel_instruction_fetching_success;
81 static constexpr Column DST_SELECTOR = Column::instr_fetching_sel;
82 static constexpr Column COUNTS = Column::lookup_execution_instruction_fetching_body_counts;
83 static constexpr Column INVERSES = Column::lookup_execution_instruction_fetching_body_inv;
84 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
85 ColumnAndShifts::execution_pc, ColumnAndShifts::execution_bytecode_id,
86 ColumnAndShifts::execution_ex_opcode, ColumnAndShifts::execution_instr_length,
87 ColumnAndShifts::execution_indirect, ColumnAndShifts::execution_op_0_,
88 ColumnAndShifts::execution_op_1_, ColumnAndShifts::execution_op_2_,
89 ColumnAndShifts::execution_op_3_, ColumnAndShifts::execution_op_4_,
90 ColumnAndShifts::execution_op_5_, ColumnAndShifts::execution_op_6_
91 };
92 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
93 ColumnAndShifts::instr_fetching_pc, ColumnAndShifts::instr_fetching_bytecode_id,
94 ColumnAndShifts::instr_fetching_exec_opcode, ColumnAndShifts::instr_fetching_instr_size,
95 ColumnAndShifts::instr_fetching_indirect, ColumnAndShifts::instr_fetching_op1,
96 ColumnAndShifts::instr_fetching_op2, ColumnAndShifts::instr_fetching_op3,
97 ColumnAndShifts::instr_fetching_op4, ColumnAndShifts::instr_fetching_op5,
98 ColumnAndShifts::instr_fetching_op6, ColumnAndShifts::instr_fetching_op7
99 };
100};
101
104template <typename FF_>
107
109
111 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_EXEC_SPEC_READ";
112 static constexpr std::string_view RELATION_NAME = "execution";
113 static constexpr size_t LOOKUP_TUPLE_SIZE = 43;
114 static constexpr Column SRC_SELECTOR = Column::execution_sel_instruction_fetching_success;
115 static constexpr Column DST_SELECTOR = Column::precomputed_sel_exec_spec;
116 static constexpr Column COUNTS = Column::lookup_execution_exec_spec_read_counts;
117 static constexpr Column INVERSES = Column::lookup_execution_exec_spec_read_inv;
118 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
119 ColumnAndShifts::execution_ex_opcode,
120 ColumnAndShifts::execution_opcode_gas,
121 ColumnAndShifts::execution_base_da_gas,
122 ColumnAndShifts::execution_dynamic_l2_gas,
123 ColumnAndShifts::execution_dynamic_da_gas,
124 ColumnAndShifts::execution_sel_op_is_address_0_,
125 ColumnAndShifts::execution_sel_op_is_address_1_,
126 ColumnAndShifts::execution_sel_op_is_address_2_,
127 ColumnAndShifts::execution_sel_op_is_address_3_,
128 ColumnAndShifts::execution_sel_op_is_address_4_,
129 ColumnAndShifts::execution_sel_op_is_address_5_,
130 ColumnAndShifts::execution_sel_op_is_address_6_,
131 ColumnAndShifts::execution_subtrace_id,
132 ColumnAndShifts::execution_subtrace_operation_id,
133 ColumnAndShifts::execution_dyn_gas_id,
134 ColumnAndShifts::execution_sel_mem_op_reg_0_,
135 ColumnAndShifts::execution_sel_mem_op_reg_1_,
136 ColumnAndShifts::execution_sel_mem_op_reg_2_,
137 ColumnAndShifts::execution_sel_mem_op_reg_3_,
138 ColumnAndShifts::execution_sel_mem_op_reg_4_,
139 ColumnAndShifts::execution_sel_mem_op_reg_5_,
140 ColumnAndShifts::execution_sel_mem_op_reg_6_,
141 ColumnAndShifts::execution_rw_reg_0_,
142 ColumnAndShifts::execution_rw_reg_1_,
143 ColumnAndShifts::execution_rw_reg_2_,
144 ColumnAndShifts::execution_rw_reg_3_,
145 ColumnAndShifts::execution_rw_reg_4_,
146 ColumnAndShifts::execution_rw_reg_5_,
147 ColumnAndShifts::execution_rw_reg_6_,
148 ColumnAndShifts::execution_sel_tag_check_reg_0_,
149 ColumnAndShifts::execution_sel_tag_check_reg_1_,
150 ColumnAndShifts::execution_sel_tag_check_reg_2_,
151 ColumnAndShifts::execution_sel_tag_check_reg_3_,
152 ColumnAndShifts::execution_sel_tag_check_reg_4_,
153 ColumnAndShifts::execution_sel_tag_check_reg_5_,
154 ColumnAndShifts::execution_sel_tag_check_reg_6_,
155 ColumnAndShifts::execution_expected_tag_reg_0_,
156 ColumnAndShifts::execution_expected_tag_reg_1_,
157 ColumnAndShifts::execution_expected_tag_reg_2_,
158 ColumnAndShifts::execution_expected_tag_reg_3_,
159 ColumnAndShifts::execution_expected_tag_reg_4_,
160 ColumnAndShifts::execution_expected_tag_reg_5_,
161 ColumnAndShifts::execution_expected_tag_reg_6_
162 };
163 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
164 ColumnAndShifts::precomputed_clk,
165 ColumnAndShifts::precomputed_exec_opcode_opcode_gas,
166 ColumnAndShifts::precomputed_exec_opcode_base_da_gas,
167 ColumnAndShifts::precomputed_exec_opcode_dynamic_l2_gas,
168 ColumnAndShifts::precomputed_exec_opcode_dynamic_da_gas,
169 ColumnAndShifts::precomputed_sel_op_is_address_0_,
170 ColumnAndShifts::precomputed_sel_op_is_address_1_,
171 ColumnAndShifts::precomputed_sel_op_is_address_2_,
172 ColumnAndShifts::precomputed_sel_op_is_address_3_,
173 ColumnAndShifts::precomputed_sel_op_is_address_4_,
174 ColumnAndShifts::precomputed_sel_op_is_address_5_,
175 ColumnAndShifts::precomputed_sel_op_is_address_6_,
176 ColumnAndShifts::precomputed_subtrace_id,
177 ColumnAndShifts::precomputed_subtrace_operation_id,
178 ColumnAndShifts::precomputed_dyn_gas_id,
179 ColumnAndShifts::precomputed_sel_mem_op_reg_0_,
180 ColumnAndShifts::precomputed_sel_mem_op_reg_1_,
181 ColumnAndShifts::precomputed_sel_mem_op_reg_2_,
182 ColumnAndShifts::precomputed_sel_mem_op_reg_3_,
183 ColumnAndShifts::precomputed_sel_mem_op_reg_4_,
184 ColumnAndShifts::precomputed_sel_mem_op_reg_5_,
185 ColumnAndShifts::precomputed_sel_mem_op_reg_6_,
186 ColumnAndShifts::precomputed_rw_reg_0_,
187 ColumnAndShifts::precomputed_rw_reg_1_,
188 ColumnAndShifts::precomputed_rw_reg_2_,
189 ColumnAndShifts::precomputed_rw_reg_3_,
190 ColumnAndShifts::precomputed_rw_reg_4_,
191 ColumnAndShifts::precomputed_rw_reg_5_,
192 ColumnAndShifts::precomputed_rw_reg_6_,
193 ColumnAndShifts::precomputed_sel_tag_check_reg_0_,
194 ColumnAndShifts::precomputed_sel_tag_check_reg_1_,
195 ColumnAndShifts::precomputed_sel_tag_check_reg_2_,
196 ColumnAndShifts::precomputed_sel_tag_check_reg_3_,
197 ColumnAndShifts::precomputed_sel_tag_check_reg_4_,
198 ColumnAndShifts::precomputed_sel_tag_check_reg_5_,
199 ColumnAndShifts::precomputed_sel_tag_check_reg_6_,
200 ColumnAndShifts::precomputed_expected_tag_reg_0_,
201 ColumnAndShifts::precomputed_expected_tag_reg_1_,
202 ColumnAndShifts::precomputed_expected_tag_reg_2_,
203 ColumnAndShifts::precomputed_expected_tag_reg_3_,
204 ColumnAndShifts::precomputed_expected_tag_reg_4_,
205 ColumnAndShifts::precomputed_expected_tag_reg_5_,
206 ColumnAndShifts::precomputed_expected_tag_reg_6_
207 };
208};
209
211template <typename FF_>
213
215
217 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_DYN_L2_FACTOR_BITWISE";
218 static constexpr std::string_view RELATION_NAME = "execution";
219 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
220 static constexpr Column SRC_SELECTOR = Column::execution_sel_gas_bitwise;
221 static constexpr Column DST_SELECTOR = Column::precomputed_sel_tag_parameters;
222 static constexpr Column COUNTS = Column::lookup_execution_dyn_l2_factor_bitwise_counts;
223 static constexpr Column INVERSES = Column::lookup_execution_dyn_l2_factor_bitwise_inv;
224 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
225 ColumnAndShifts::execution_mem_tag_reg_0_, ColumnAndShifts::execution_dynamic_l2_gas_factor
226 };
227 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
228 ColumnAndShifts::precomputed_clk, ColumnAndShifts::precomputed_tag_byte_length
229 };
230};
231
234template <typename FF_>
237
239
241 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_CHECK_RADIX_GT_256";
242 static constexpr std::string_view RELATION_NAME = "execution";
243 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
244 static constexpr Column SRC_SELECTOR = Column::execution_sel_gas_to_radix;
245 static constexpr Column DST_SELECTOR = Column::gt_sel;
246 static constexpr Column COUNTS = Column::lookup_execution_check_radix_gt_256_counts;
247 static constexpr Column INVERSES = Column::lookup_execution_check_radix_gt_256_inv;
248 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
249 ColumnAndShifts::execution_register_1_,
250 ColumnAndShifts::execution_two_five_six,
251 ColumnAndShifts::execution_sel_radix_gt_256
252 };
253 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::gt_input_a,
254 ColumnAndShifts::gt_input_b,
255 ColumnAndShifts::gt_res };
256};
257
259template <typename FF_>
262
264
266 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_GET_P_LIMBS";
267 static constexpr std::string_view RELATION_NAME = "execution";
268 static constexpr size_t LOOKUP_TUPLE_SIZE = 2;
269 static constexpr Column SRC_SELECTOR = Column::execution_sel_lookup_num_p_limbs;
270 static constexpr Column DST_SELECTOR = Column::precomputed_sel_to_radix_p_limb_counts;
271 static constexpr Column COUNTS = Column::lookup_execution_get_p_limbs_counts;
272 static constexpr Column INVERSES = Column::lookup_execution_get_p_limbs_inv;
273 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
274 ColumnAndShifts::execution_register_1_, ColumnAndShifts::execution_num_p_limbs
275 };
276 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
277 ColumnAndShifts::precomputed_clk, ColumnAndShifts::precomputed_to_radix_num_limbs_for_p
278 };
279};
280
282template <typename FF_>
284
286
288 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_GET_MAX_LIMBS";
289 static constexpr std::string_view RELATION_NAME = "execution";
290 static constexpr size_t LOOKUP_TUPLE_SIZE = 3;
291 static constexpr Column SRC_SELECTOR = Column::execution_sel_gas_to_radix;
292 static constexpr Column DST_SELECTOR = Column::gt_sel;
293 static constexpr Column COUNTS = Column::lookup_execution_get_max_limbs_counts;
294 static constexpr Column INVERSES = Column::lookup_execution_get_max_limbs_inv;
295 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
296 ColumnAndShifts::execution_register_2_,
297 ColumnAndShifts::execution_num_p_limbs,
298 ColumnAndShifts::execution_sel_use_num_limbs
299 };
300 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = { ColumnAndShifts::gt_input_a,
301 ColumnAndShifts::gt_input_b,
302 ColumnAndShifts::gt_res };
303};
304
306template <typename FF_>
308
310
312 static constexpr std::string_view NAME = "LOOKUP_EXECUTION_CHECK_WRITTEN_STORAGE_SLOT";
313 static constexpr std::string_view RELATION_NAME = "execution";
314 static constexpr size_t LOOKUP_TUPLE_SIZE = 4;
315 static constexpr Column SRC_SELECTOR = Column::execution_sel_gas_sstore;
316 static constexpr Column DST_SELECTOR = Column::written_public_data_slots_tree_check_sel;
317 static constexpr Column COUNTS = Column::lookup_execution_check_written_storage_slot_counts;
318 static constexpr Column INVERSES = Column::lookup_execution_check_written_storage_slot_inv;
319 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> SRC_COLUMNS = {
320 ColumnAndShifts::execution_contract_address,
321 ColumnAndShifts::execution_register_1_,
322 ColumnAndShifts::execution_dynamic_da_gas_factor,
323 ColumnAndShifts::execution_prev_written_public_data_slots_tree_root
324 };
325 static constexpr std::array<ColumnAndShifts, LOOKUP_TUPLE_SIZE> DST_COLUMNS = {
326 ColumnAndShifts::written_public_data_slots_tree_check_address,
327 ColumnAndShifts::written_public_data_slots_tree_check_slot,
328 ColumnAndShifts::written_public_data_slots_tree_check_leaf_not_exists,
329 ColumnAndShifts::written_public_data_slots_tree_check_root
330 };
331};
332
335template <typename FF_>
338
339} // namespace bb::avm2
This file contains the template for the generic lookup that can be specialized to enforce various loo...
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > SRC_COLUMNS
static constexpr std::array< ColumnAndShifts, LOOKUP_TUPLE_SIZE > DST_COLUMNS