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