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