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