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