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