Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
context_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void contextImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 const auto execution_SEL_INTERNAL_OP =
19 in.get(C::execution_sel_execute_internal_call) + in.get(C::execution_sel_read_unwind_call_stack);
20 const auto execution_NOT_LAST_EXEC = in.get(C::execution_sel) * in.get(C::execution_sel_shift);
21 const auto execution_DEFAULT_CTX_ROW =
22 ((in.get(C::execution_sel) - in.get(C::execution_sel_enter_call)) - in.get(C::execution_sel_exit_call));
23 const auto execution_PC_JUMP = in.get(C::execution_sel_execute_internal_call) +
24 in.get(C::execution_sel_execute_internal_return) +
25 in.get(C::execution_sel_execute_jump) + in.get(C::execution_sel_execute_jumpi);
26 const auto execution_NESTED_EXIT_CALL = in.get(C::execution_nested_failure) + in.get(C::execution_nested_return);
27 const auto execution_NESTED_RET_REV_ONLY = execution_NESTED_EXIT_CALL * (FF(1) - in.get(C::execution_sel_error));
28 const auto execution_SEL_CONSUMED_ALL_GAS = in.get(C::execution_sel_error);
29 const auto execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END =
30 ((in.get(C::execution_sel) - in.get(C::execution_nested_failure)) - in.get(C::execution_enqueued_call_end));
31
32 {
33 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
34 auto tmp = (static_cast<View>(in.get(C::execution_sel_enter_call)) -
35 (static_cast<View>(in.get(C::execution_sel_execute_call)) +
36 static_cast<View>(in.get(C::execution_sel_execute_static_call))));
37 std::get<0>(evals) += (tmp * scaling_factor);
38 }
39 {
40 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
41 auto tmp = (static_cast<View>(in.get(C::execution_sel_exit_call)) -
42 (static_cast<View>(in.get(C::execution_sel_failure)) +
43 static_cast<View>(in.get(C::execution_sel_execute_return))));
44 std::get<1>(evals) += (tmp * scaling_factor);
45 }
46 { // IS_STATIC_ON_SEL
47 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
48 auto tmp =
49 (FF(1) - static_cast<View>(in.get(C::execution_sel))) * static_cast<View>(in.get(C::execution_is_static));
50 std::get<2>(evals) += (tmp * scaling_factor);
51 }
52 {
53 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
54 auto tmp = static_cast<View>(in.get(C::execution_has_parent_ctx)) *
55 (FF(1) - static_cast<View>(in.get(C::execution_has_parent_ctx)));
56 std::get<3>(evals) += (tmp * scaling_factor);
57 }
58 {
59 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
60 auto tmp = (static_cast<View>(in.get(C::execution_parent_id)) *
61 ((FF(1) - static_cast<View>(in.get(C::execution_has_parent_ctx))) *
62 (FF(1) - static_cast<View>(in.get(C::execution_is_parent_id_inv))) +
63 static_cast<View>(in.get(C::execution_is_parent_id_inv))) -
64 static_cast<View>(in.get(C::execution_has_parent_ctx)));
65 std::get<4>(evals) += (tmp * scaling_factor);
66 }
67 {
68 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
69 auto tmp = (static_cast<View>(in.get(C::execution_nested_return)) -
70 static_cast<View>(in.get(C::execution_has_parent_ctx)) *
71 static_cast<View>(in.get(C::execution_sel_execute_return)));
72 std::get<5>(evals) += (tmp * scaling_factor);
73 }
74 {
75 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
76 auto tmp = (static_cast<View>(in.get(C::execution_nested_failure)) -
77 static_cast<View>(in.get(C::execution_has_parent_ctx)) *
78 static_cast<View>(in.get(C::execution_sel_failure)));
79 std::get<6>(evals) += (tmp * scaling_factor);
80 }
81 { // ENQUEUED_CALL_START_NEXT_CTX_ID
82 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
83 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
84 ((static_cast<View>(in.get(C::execution_context_id)) + FF(1)) -
85 static_cast<View>(in.get(C::execution_next_context_id)));
86 std::get<7>(evals) += (tmp * scaling_factor);
87 }
88 { // INCR_NEXT_CONTEXT_ID
89 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
90 auto tmp =
91 CView(execution_NOT_LAST_EXEC) * (static_cast<View>(in.get(C::execution_next_context_id_shift)) -
92 (static_cast<View>(in.get(C::execution_next_context_id)) +
93 static_cast<View>(in.get(C::execution_sel_first_row_in_context_shift))));
94 std::get<8>(evals) += (tmp * scaling_factor);
95 }
96 { // CONTEXT_ID_EXT_CALL
97 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
98 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
99 (static_cast<View>(in.get(C::execution_context_id_shift)) -
100 static_cast<View>(in.get(C::execution_next_context_id)));
101 std::get<9>(evals) += (tmp * scaling_factor);
102 }
103 { // CONTEXT_ID_NESTED_EXIT
104 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
105 auto tmp = CView(execution_NESTED_EXIT_CALL) * (static_cast<View>(in.get(C::execution_context_id_shift)) -
106 static_cast<View>(in.get(C::execution_parent_id)));
107 std::get<10>(evals) += (tmp * scaling_factor);
108 }
109 { // CONTEXT_ID_NEXT_DEFAULT_ROW
110 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
111 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_context_id_shift)) -
112 static_cast<View>(in.get(C::execution_context_id)));
113 std::get<11>(evals) += (tmp * scaling_factor);
114 }
115 { // PARENT_ID_INIT
116 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
117 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
118 static_cast<View>(in.get(C::execution_parent_id));
119 std::get<12>(evals) += (tmp * scaling_factor);
120 }
121 { // PARENT_ID_NEXT_EXT_CALL
122 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
123 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
124 (static_cast<View>(in.get(C::execution_parent_id_shift)) -
125 static_cast<View>(in.get(C::execution_context_id)));
126 std::get<13>(evals) += (tmp * scaling_factor);
127 }
128 { // PARENT_ID_NEXT_DEFAULT_ROW
129 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
130 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_id_shift)) -
131 static_cast<View>(in.get(C::execution_parent_id)));
132 std::get<14>(evals) += (tmp * scaling_factor);
133 }
134 { // NEXT_PC
135 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
136 auto tmp = static_cast<View>(in.get(C::execution_sel_instruction_fetching_success)) *
137 ((static_cast<View>(in.get(C::execution_pc)) + static_cast<View>(in.get(C::execution_instr_size))) -
138 static_cast<View>(in.get(C::execution_next_pc)));
139 std::get<15>(evals) += (tmp * scaling_factor);
140 }
141 { // PC_NEW_CONTEXT_INIT
142 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
143 auto tmp = static_cast<View>(in.get(C::execution_sel_first_row_in_context)) *
144 static_cast<View>(in.get(C::execution_pc));
145 std::get<16>(evals) += (tmp * scaling_factor);
146 }
147 { // PC_NEXT_ROW_DEFAULT
148 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
149 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (FF(1) - CView(execution_PC_JUMP)) *
150 (static_cast<View>(in.get(C::execution_pc_shift)) - static_cast<View>(in.get(C::execution_next_pc)));
151 std::get<17>(evals) += (tmp * scaling_factor);
152 }
153 { // MSG_SENDER_NEXT_ROW_EXT_CALL
154 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
155 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
156 (static_cast<View>(in.get(C::execution_msg_sender_shift)) -
157 static_cast<View>(in.get(C::execution_contract_address)));
158 std::get<18>(evals) += (tmp * scaling_factor);
159 }
160 { // MSG_SENDER_NEXT_ROW_DEFAULT
161 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
162 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_msg_sender_shift)) -
163 static_cast<View>(in.get(C::execution_msg_sender)));
164 std::get<19>(evals) += (tmp * scaling_factor);
165 }
166 { // CONTRACT_ADDR_NEXT_ROW_EXT_CALL
167 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
168 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
169 (static_cast<View>(in.get(C::execution_contract_address_shift)) -
170 static_cast<View>(in.get(C::execution_register_2_)));
171 std::get<20>(evals) += (tmp * scaling_factor);
172 }
173 { // CONTRACT_ADDR_NEXT_ROW
174 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
175 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_contract_address_shift)) -
176 static_cast<View>(in.get(C::execution_contract_address)));
177 std::get<21>(evals) += (tmp * scaling_factor);
178 }
179 { // BYTECODE_ID_NEXT_ROW
180 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
181 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_bytecode_id_shift)) -
182 static_cast<View>(in.get(C::execution_bytecode_id)));
183 std::get<22>(evals) += (tmp * scaling_factor);
184 }
185 { // TRANSACTION_FEE_NEXT_ROW
186 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
187 auto tmp = ((FF(1) - static_cast<View>(in.get(C::execution_enqueued_call_end))) -
188 static_cast<View>(in.get(C::precomputed_first_row))) *
189 (static_cast<View>(in.get(C::execution_transaction_fee_shift)) -
190 static_cast<View>(in.get(C::execution_transaction_fee)));
191 std::get<23>(evals) += (tmp * scaling_factor);
192 }
193 { // IS_STATIC_IF_STATIC_CALL
194 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
195 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
196 (FF(1) - static_cast<View>(in.get(C::execution_is_static))) *
197 (static_cast<View>(in.get(C::execution_is_static_shift)) -
198 static_cast<View>(in.get(C::execution_sel_execute_static_call)));
199 std::get<24>(evals) += (tmp * scaling_factor);
200 }
201 { // IS_STATIC_IF_CALL_FROM_STATIC_CONTEXT
202 using View = typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
203 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
204 static_cast<View>(in.get(C::execution_is_static)) *
205 (static_cast<View>(in.get(C::execution_is_static_shift)) - FF(1));
206 std::get<25>(evals) += (tmp * scaling_factor);
207 }
208 { // IS_STATIC_NEXT_ROW_DEFAULT
209 using View = typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
210 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_is_static_shift)) -
211 static_cast<View>(in.get(C::execution_is_static)));
212 std::get<26>(evals) += (tmp * scaling_factor);
213 }
214 { // CD_ADDR_ENQUEUED_CALL_IS_ZERO
215 using View = typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
216 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
217 static_cast<View>(in.get(C::execution_parent_calldata_addr));
218 std::get<27>(evals) += (tmp * scaling_factor);
219 }
220 { // CD_ADDR_NEXT_ROW_EXT_CALL
221 using View = typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
222 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
223 (static_cast<View>(in.get(C::execution_parent_calldata_addr_shift)) -
224 static_cast<View>(in.get(C::execution_rop_4_)));
225 std::get<28>(evals) += (tmp * scaling_factor);
226 }
227 { // CD_ADDR_NEXT_ROW_DEFAULT
228 using View = typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
229 auto tmp =
230 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_calldata_addr_shift)) -
231 static_cast<View>(in.get(C::execution_parent_calldata_addr)));
232 std::get<29>(evals) += (tmp * scaling_factor);
233 }
234 { // CD_SIZE_NEXT_ROW_EXT_CALL
235 using View = typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
236 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
237 (static_cast<View>(in.get(C::execution_parent_calldata_size_shift)) -
238 static_cast<View>(in.get(C::execution_register_3_)));
239 std::get<30>(evals) += (tmp * scaling_factor);
240 }
241 { // CD_SIZE_NEXT_ROW_DEFAULT
242 using View = typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
243 auto tmp =
244 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_calldata_size_shift)) -
245 static_cast<View>(in.get(C::execution_parent_calldata_size)));
246 std::get<31>(evals) += (tmp * scaling_factor);
247 }
248 { // RD_ADDR_INIT
249 using View = typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
250 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
251 static_cast<View>(in.get(C::execution_last_child_returndata_addr));
252 std::get<32>(evals) += (tmp * scaling_factor);
253 }
254 { // RET_REV_RD_ADDR
255 using View = typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
256 auto tmp = CView(execution_NESTED_RET_REV_ONLY) *
257 (static_cast<View>(in.get(C::execution_last_child_returndata_addr_shift)) -
258 static_cast<View>(in.get(C::execution_rop_1_)));
259 std::get<33>(evals) += (tmp * scaling_factor);
260 }
261 { // NEXT_RD_ADDR_IS_ZERO
262 using View = typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
263 auto tmp = (static_cast<View>(in.get(C::execution_sel_enter_call)) +
264 static_cast<View>(in.get(C::execution_sel_error))) *
265 static_cast<View>(in.get(C::execution_last_child_returndata_addr_shift));
266 std::get<34>(evals) += (tmp * scaling_factor);
267 }
268 { // PROPAGATE_RD_ADDR_DEFAULT
269 using View = typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
270 auto tmp = CView(execution_DEFAULT_CTX_ROW) *
271 (static_cast<View>(in.get(C::execution_last_child_returndata_addr_shift)) -
272 static_cast<View>(in.get(C::execution_last_child_returndata_addr)));
273 std::get<35>(evals) += (tmp * scaling_factor);
274 }
275 { // RD_SIZE_INIT
276 using View = typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
277 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
278 static_cast<View>(in.get(C::execution_last_child_returndata_size));
279 std::get<36>(evals) += (tmp * scaling_factor);
280 }
281 { // RET_REV_RD_SIZE
282 using View = typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
283 auto tmp = CView(execution_NESTED_RET_REV_ONLY) *
284 (static_cast<View>(in.get(C::execution_last_child_returndata_size_shift)) -
285 static_cast<View>(in.get(C::execution_register_0_)));
286 std::get<37>(evals) += (tmp * scaling_factor);
287 }
288 { // NEXT_RD_SIZE_IS_ZERO
289 using View = typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
290 auto tmp = (static_cast<View>(in.get(C::execution_sel_enter_call)) +
291 static_cast<View>(in.get(C::execution_sel_error))) *
292 static_cast<View>(in.get(C::execution_last_child_returndata_size_shift));
293 std::get<38>(evals) += (tmp * scaling_factor);
294 }
295 { // PROPAGATE_RD_SIZE_DEFAULT
296 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
297 auto tmp = CView(execution_DEFAULT_CTX_ROW) *
298 (static_cast<View>(in.get(C::execution_last_child_returndata_size_shift)) -
299 static_cast<View>(in.get(C::execution_last_child_returndata_size)));
300 std::get<39>(evals) += (tmp * scaling_factor);
301 }
302 { // LAST_CHILD_SUCCESS_INIT
303 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
304 auto tmp = static_cast<View>(in.get(C::execution_enqueued_call_start)) *
305 static_cast<View>(in.get(C::execution_last_child_success));
306 std::get<40>(evals) += (tmp * scaling_factor);
307 }
308 { // NESTED_RETURN_LAST_CHILD_SUCCESS
309 using View = typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
310 auto tmp = static_cast<View>(in.get(C::execution_nested_return)) *
311 (static_cast<View>(in.get(C::execution_last_child_success_shift)) - FF(1));
312 std::get<41>(evals) += (tmp * scaling_factor);
313 }
314 { // LAST_CHILD_SUCCESS_NEXT_ROW_ZERO
315 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
316 auto tmp = (static_cast<View>(in.get(C::execution_nested_failure)) +
317 static_cast<View>(in.get(C::execution_sel_enter_call))) *
318 static_cast<View>(in.get(C::execution_last_child_success_shift));
319 std::get<42>(evals) += (tmp * scaling_factor);
320 }
321 { // LAST_CHILD_SUCCESS_NEXT_ROW_DEFAULT
322 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
323 auto tmp =
324 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_last_child_success_shift)) -
325 static_cast<View>(in.get(C::execution_last_child_success)));
326 std::get<43>(evals) += (tmp * scaling_factor);
327 }
328 { // LAST_CHILD_ID_INIT
329 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
330 auto tmp = static_cast<View>(in.get(C::execution_sel_first_row_in_context)) *
331 static_cast<View>(in.get(C::execution_last_child_id));
332 std::get<44>(evals) += (tmp * scaling_factor);
333 }
334 { // EXIT_CALL_LAST_CHILD_ID
335 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
336 auto tmp = CView(execution_NESTED_EXIT_CALL) * (static_cast<View>(in.get(C::execution_last_child_id_shift)) -
337 static_cast<View>(in.get(C::execution_context_id)));
338 std::get<45>(evals) += (tmp * scaling_factor);
339 }
340 { // LAST_CHILD_ID_NEXT_ROW_DEFAULT
341 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
342 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_last_child_id_shift)) -
343 static_cast<View>(in.get(C::execution_last_child_id)));
344 std::get<46>(evals) += (tmp * scaling_factor);
345 }
346 { // L2_GAS_LIMIT_RESTORE_ON_EXIT
347 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
348 auto tmp = CView(execution_NESTED_EXIT_CALL) * (static_cast<View>(in.get(C::execution_l2_gas_limit_shift)) -
349 static_cast<View>(in.get(C::execution_parent_l2_gas_limit)));
350 std::get<47>(evals) += (tmp * scaling_factor);
351 }
352 { // L2_GAS_LIMIT_NEXT_ROW_DEFAULT
353 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
354 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_l2_gas_limit_shift)) -
355 static_cast<View>(in.get(C::execution_l2_gas_limit)));
356 std::get<48>(evals) += (tmp * scaling_factor);
357 }
358 { // DA_GAS_LIMIT_RESTORE_ON_EXIT
359 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
360 auto tmp = CView(execution_NESTED_EXIT_CALL) * (static_cast<View>(in.get(C::execution_da_gas_limit_shift)) -
361 static_cast<View>(in.get(C::execution_parent_da_gas_limit)));
362 std::get<49>(evals) += (tmp * scaling_factor);
363 }
364 { // DA_GAS_LIMIT_NEXT_ROW_DEFAULT
365 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
366 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_da_gas_limit_shift)) -
367 static_cast<View>(in.get(C::execution_da_gas_limit)));
368 std::get<50>(evals) += (tmp * scaling_factor);
369 }
370 { // PARENT_L2_GAS_LIMIT_STORE_ON_ENTER
371 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
372 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
373 (static_cast<View>(in.get(C::execution_parent_l2_gas_limit_shift)) -
374 static_cast<View>(in.get(C::execution_l2_gas_limit)));
375 std::get<51>(evals) += (tmp * scaling_factor);
376 }
377 { // PARENT_L2_GAS_LIMIT_NEXT_ROW_DEFAULT
378 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
379 auto tmp =
380 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_l2_gas_limit_shift)) -
381 static_cast<View>(in.get(C::execution_parent_l2_gas_limit)));
382 std::get<52>(evals) += (tmp * scaling_factor);
383 }
384 { // PARENT_DA_GAS_LIMIT_STORE_ON_ENTER
385 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
386 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
387 (static_cast<View>(in.get(C::execution_parent_da_gas_limit_shift)) -
388 static_cast<View>(in.get(C::execution_da_gas_limit)));
389 std::get<53>(evals) += (tmp * scaling_factor);
390 }
391 { // PARENT_DA_GAS_LIMIT_NEXT_ROW_DEFAULT
392 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
393 auto tmp =
394 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_da_gas_limit_shift)) -
395 static_cast<View>(in.get(C::execution_parent_da_gas_limit)));
396 std::get<54>(evals) += (tmp * scaling_factor);
397 }
398 { // PARENT_L2_GAS_USED_STORE_ON_ENTER
399 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
400 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
401 (static_cast<View>(in.get(C::execution_parent_l2_gas_used_shift)) -
402 static_cast<View>(in.get(C::execution_l2_gas_used)));
403 std::get<55>(evals) += (tmp * scaling_factor);
404 }
405 { // PARENT_L2_GAS_USED_NEXT_ROW_DEFAULT
406 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
407 auto tmp =
408 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_l2_gas_used_shift)) -
409 static_cast<View>(in.get(C::execution_parent_l2_gas_used)));
410 std::get<56>(evals) += (tmp * scaling_factor);
411 }
412 { // PARENT_DA_GAS_USED_STORE_ON_ENTER
413 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
414 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
415 (static_cast<View>(in.get(C::execution_parent_da_gas_used_shift)) -
416 static_cast<View>(in.get(C::execution_da_gas_used)));
417 std::get<57>(evals) += (tmp * scaling_factor);
418 }
419 { // PARENT_DA_GAS_USED_NEXT_ROW_DEFAULT
420 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
421 auto tmp =
422 CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_parent_da_gas_used_shift)) -
423 static_cast<View>(in.get(C::execution_parent_da_gas_used)));
424 std::get<58>(evals) += (tmp * scaling_factor);
425 }
426 { // INTERNAL_CALL_ID_INIT
427 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
428 auto tmp = static_cast<View>(in.get(C::execution_sel_first_row_in_context)) *
429 (static_cast<View>(in.get(C::execution_internal_call_id)) - FF(1));
430 std::get<59>(evals) += (tmp * scaling_factor);
431 }
432 { // INTERNAL_CALL_ID_NEXT_ROW_DEFAULT
433 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
434 auto tmp = (CView(execution_DEFAULT_CTX_ROW) - CView(execution_SEL_INTERNAL_OP)) *
435 (static_cast<View>(in.get(C::execution_internal_call_id_shift)) -
436 static_cast<View>(in.get(C::execution_internal_call_id)));
437 std::get<60>(evals) += (tmp * scaling_factor);
438 }
439 { // INTERNAL_CALL_RETURN_ID_INIT
440 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
441 auto tmp = static_cast<View>(in.get(C::execution_sel_first_row_in_context)) *
442 static_cast<View>(in.get(C::execution_internal_call_return_id));
443 std::get<61>(evals) += (tmp * scaling_factor);
444 }
445 { // INTERNAL_CALL_RETURN_ID_NEXT_ROW_DEFAULT
446 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
447 auto tmp = (CView(execution_DEFAULT_CTX_ROW) - CView(execution_SEL_INTERNAL_OP)) *
448 (static_cast<View>(in.get(C::execution_internal_call_return_id_shift)) -
449 static_cast<View>(in.get(C::execution_internal_call_return_id)));
450 std::get<62>(evals) += (tmp * scaling_factor);
451 }
452 { // NEXT_INTERNAL_CALL_ID_INIT
453 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
454 auto tmp = static_cast<View>(in.get(C::execution_sel_first_row_in_context)) *
455 (static_cast<View>(in.get(C::execution_next_internal_call_id)) - FF(2));
456 std::get<63>(evals) += (tmp * scaling_factor);
457 }
458 { // NEXT_INTERNAL_CALL_ID_NEXT_ROW_DEFAULT
459 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
460 auto tmp = (CView(execution_DEFAULT_CTX_ROW) - CView(execution_SEL_INTERNAL_OP)) *
461 (static_cast<View>(in.get(C::execution_next_internal_call_id_shift)) -
462 static_cast<View>(in.get(C::execution_next_internal_call_id)));
463 std::get<64>(evals) += (tmp * scaling_factor);
464 }
465 { // RETRIEVED_BYTECODES_TREE_ROOT_CONTINUITY
466 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
467 auto tmp =
468 (static_cast<View>(in.get(C::execution_sel)) - static_cast<View>(in.get(C::execution_enqueued_call_end))) *
469 (static_cast<View>(in.get(C::execution_retrieved_bytecodes_tree_root)) -
470 static_cast<View>(in.get(C::execution_prev_retrieved_bytecodes_tree_root_shift)));
471 std::get<65>(evals) += (tmp * scaling_factor);
472 }
473 { // RETRIEVED_BYTECODES_TREE_SIZE_CONTINUITY
474 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
475 auto tmp =
476 (static_cast<View>(in.get(C::execution_sel)) - static_cast<View>(in.get(C::execution_enqueued_call_end))) *
477 (static_cast<View>(in.get(C::execution_retrieved_bytecodes_tree_size)) -
478 static_cast<View>(in.get(C::execution_prev_retrieved_bytecodes_tree_size_shift)));
479 std::get<66>(evals) += (tmp * scaling_factor);
480 }
481 {
482 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
483 auto tmp = (((static_cast<View>(in.get(C::execution_l2_gas_limit)) -
484 static_cast<View>(in.get(C::execution_total_gas_l2))) *
485 CView(execution_SEL_CONSUMED_ALL_GAS) +
486 static_cast<View>(in.get(C::execution_total_gas_l2))) -
487 static_cast<View>(in.get(C::execution_l2_gas_used)));
488 std::get<67>(evals) += (tmp * scaling_factor);
489 }
490 {
491 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
492 auto tmp = (((static_cast<View>(in.get(C::execution_da_gas_limit)) -
493 static_cast<View>(in.get(C::execution_total_gas_da))) *
494 CView(execution_SEL_CONSUMED_ALL_GAS) +
495 static_cast<View>(in.get(C::execution_total_gas_da))) -
496 static_cast<View>(in.get(C::execution_da_gas_used)));
497 std::get<68>(evals) += (tmp * scaling_factor);
498 }
499 { // L2_GAS_USED_ZERO_AFTER_CALL
500 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
501 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
502 static_cast<View>(in.get(C::execution_prev_l2_gas_used_shift));
503 std::get<69>(evals) += (tmp * scaling_factor);
504 }
505 { // L2_GAS_USED_INGEST_AFTER_EXIT
506 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
507 auto tmp = CView(execution_NESTED_EXIT_CALL) * ((static_cast<View>(in.get(C::execution_parent_l2_gas_used)) +
508 static_cast<View>(in.get(C::execution_l2_gas_used))) -
509 static_cast<View>(in.get(C::execution_prev_l2_gas_used_shift)));
510 std::get<70>(evals) += (tmp * scaling_factor);
511 }
512 { // L2_GAS_USED_DEFAULT_ROW
513 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
514 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_l2_gas_used)) -
515 static_cast<View>(in.get(C::execution_prev_l2_gas_used_shift)));
516 std::get<71>(evals) += (tmp * scaling_factor);
517 }
518 { // DA_GAS_USED_ZERO_AFTER_CALL
519 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
520 auto tmp = static_cast<View>(in.get(C::execution_sel_enter_call)) *
521 static_cast<View>(in.get(C::execution_prev_da_gas_used_shift));
522 std::get<72>(evals) += (tmp * scaling_factor);
523 }
524 { // DA_GAS_USED_INGEST_AFTER_EXIT
525 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
526 auto tmp = CView(execution_NESTED_EXIT_CALL) * ((static_cast<View>(in.get(C::execution_parent_da_gas_used)) +
527 static_cast<View>(in.get(C::execution_da_gas_used))) -
528 static_cast<View>(in.get(C::execution_prev_da_gas_used_shift)));
529 std::get<73>(evals) += (tmp * scaling_factor);
530 }
531 { // DA_GAS_USED_DEFAULT_ROW
532 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
533 auto tmp = CView(execution_DEFAULT_CTX_ROW) * (static_cast<View>(in.get(C::execution_da_gas_used)) -
534 static_cast<View>(in.get(C::execution_prev_da_gas_used_shift)));
535 std::get<74>(evals) += (tmp * scaling_factor);
536 }
537 { // NOTE_HASH_TREE_ROOT_CONTINUITY
538 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
539 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
540 (static_cast<View>(in.get(C::execution_note_hash_tree_root)) -
541 static_cast<View>(in.get(C::execution_prev_note_hash_tree_root_shift)));
542 std::get<75>(evals) += (tmp * scaling_factor);
543 }
544 { // NOTE_HASH_TREE_SIZE_CONTINUITY
545 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
546 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
547 (static_cast<View>(in.get(C::execution_note_hash_tree_size)) -
548 static_cast<View>(in.get(C::execution_prev_note_hash_tree_size_shift)));
549 std::get<76>(evals) += (tmp * scaling_factor);
550 }
551 { // NUM_NOTE_HASHES_EMITTED_CONTINUITY
552 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
553 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
554 (static_cast<View>(in.get(C::execution_num_note_hashes_emitted)) -
555 static_cast<View>(in.get(C::execution_prev_num_note_hashes_emitted_shift)));
556 std::get<77>(evals) += (tmp * scaling_factor);
557 }
558 { // NULLIFIER_TREE_ROOT_CONTINUITY
559 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
560 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
561 (static_cast<View>(in.get(C::execution_nullifier_tree_root)) -
562 static_cast<View>(in.get(C::execution_prev_nullifier_tree_root_shift)));
563 std::get<78>(evals) += (tmp * scaling_factor);
564 }
565 { // NULLIFIER_TREE_SIZE_CONTINUITY
566 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
567 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
568 (static_cast<View>(in.get(C::execution_nullifier_tree_size)) -
569 static_cast<View>(in.get(C::execution_prev_nullifier_tree_size_shift)));
570 std::get<79>(evals) += (tmp * scaling_factor);
571 }
572 { // NUM_NULLIFIERS_EMITTED_CONTINUITY
573 using View = typename std::tuple_element_t<80, ContainerOverSubrelations>::View;
574 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
575 (static_cast<View>(in.get(C::execution_num_nullifiers_emitted)) -
576 static_cast<View>(in.get(C::execution_prev_num_nullifiers_emitted_shift)));
577 std::get<80>(evals) += (tmp * scaling_factor);
578 }
579 { // PUBLIC_DATA_TREE_ROOT_CONTINUITY
580 using View = typename std::tuple_element_t<81, ContainerOverSubrelations>::View;
581 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
582 (static_cast<View>(in.get(C::execution_public_data_tree_root)) -
583 static_cast<View>(in.get(C::execution_prev_public_data_tree_root_shift)));
584 std::get<81>(evals) += (tmp * scaling_factor);
585 }
586 { // PUBLIC_DATA_TREE_SIZE_CONTINUITY
587 using View = typename std::tuple_element_t<82, ContainerOverSubrelations>::View;
588 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
589 (static_cast<View>(in.get(C::execution_public_data_tree_size)) -
590 static_cast<View>(in.get(C::execution_prev_public_data_tree_size_shift)));
591 std::get<82>(evals) += (tmp * scaling_factor);
592 }
593 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_CONTINUITY
594 using View = typename std::tuple_element_t<83, ContainerOverSubrelations>::View;
595 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
596 (static_cast<View>(in.get(C::execution_written_public_data_slots_tree_root)) -
597 static_cast<View>(in.get(C::execution_prev_written_public_data_slots_tree_root_shift)));
598 std::get<83>(evals) += (tmp * scaling_factor);
599 }
600 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_CONTINUITY
601 using View = typename std::tuple_element_t<84, ContainerOverSubrelations>::View;
602 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
603 (static_cast<View>(in.get(C::execution_written_public_data_slots_tree_size)) -
604 static_cast<View>(in.get(C::execution_prev_written_public_data_slots_tree_size_shift)));
605 std::get<84>(evals) += (tmp * scaling_factor);
606 }
607 { // NUM_PUBLIC_LOGS_CONTINUITY
608 using View = typename std::tuple_element_t<85, ContainerOverSubrelations>::View;
609 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
610 (static_cast<View>(in.get(C::execution_num_public_log_fields)) -
611 static_cast<View>(in.get(C::execution_prev_num_public_log_fields_shift)));
612 std::get<85>(evals) += (tmp * scaling_factor);
613 }
614 { // NUM_L2_TO_L1_MESSAGES_CONTINUITY
615 using View = typename std::tuple_element_t<86, ContainerOverSubrelations>::View;
616 auto tmp = CView(execution_NOT_LAST_NOT_FAILURE_NOT_ENQ_END) *
617 (static_cast<View>(in.get(C::execution_num_l2_to_l1_messages)) -
618 static_cast<View>(in.get(C::execution_prev_num_l2_to_l1_messages_shift)));
619 std::get<86>(evals) += (tmp * scaling_factor);
620 }
621 { // L1_L2_TREE_ROOT_CONTINUITY
622 using View = typename std::tuple_element_t<87, ContainerOverSubrelations>::View;
623 auto tmp = CView(execution_NOT_LAST_EXEC) * (static_cast<View>(in.get(C::execution_l1_l2_tree_root)) -
624 static_cast<View>(in.get(C::execution_l1_l2_tree_root_shift)));
625 std::get<87>(evals) += (tmp * scaling_factor);
626 }
627}
628
629} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:35
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define CView(v)
Container for parameters used by the grand product (permutation, lookup) Honk relations.