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