Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
execution_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
5
6namespace bb::avm2 {
7
8template <typename FF_>
9template <typename ContainerOverSubrelations, typename AllEntities>
10void executionImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
11 const AllEntities& in,
12 [[maybe_unused]] const RelationParameters<FF_>&,
13 [[maybe_unused]] const FF_& scaling_factor)
14{
15 using C = ColumnAndShifts;
16
17 PROFILE_THIS_NAME("accumulate/execution");
18
19 const auto constants_MEM_TAG_U1 = FF(1);
20 const auto constants_MEM_TAG_U32 = FF(4);
21 const auto constants_AVM_SUBTRACE_ID_EXECUTION = FF(1);
22 const auto constants_AVM_SUBTRACE_ID_ALU = FF(2);
23 const auto constants_AVM_SUBTRACE_ID_CAST = FF(4);
24 const auto constants_AVM_SUBTRACE_ID_SET = FF(8);
25 const auto constants_AVM_SUBTRACE_ID_BITWISE = FF(16);
26 const auto constants_AVM_SUBTRACE_ID_POSEIDON_PERM = FF(32);
27 const auto constants_AVM_SUBTRACE_ID_TO_RADIX = FF(64);
28 const auto constants_AVM_SUBTRACE_ID_ECC = FF(128);
29 const auto constants_AVM_SUBTRACE_ID_KECCAKF1600 = FF(256);
30 const auto constants_AVM_SUBTRACE_ID_CALLDATA_COPY = FF(512);
31 const auto constants_AVM_SUBTRACE_ID_GETCONTRACTINSTANCE = FF(1024);
32 const auto constants_AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG = FF(2048);
33 const auto constants_AVM_SUBTRACE_ID_SHA256_COMPRESSION = FF(4096);
34 const auto constants_AVM_SUBTRACE_ID_RETURNDATA_COPY = FF(8192);
35 const auto constants_AVM_DYN_GAS_ID_CALLDATACOPY = FF(1);
36 const auto constants_AVM_DYN_GAS_ID_RETURNDATACOPY = FF(2);
37 const auto constants_AVM_DYN_GAS_ID_TORADIX = FF(4);
38 const auto constants_AVM_DYN_GAS_ID_BITWISE = FF(8);
39 const auto constants_AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG = FF(16);
40 const auto constants_AVM_DYN_GAS_ID_SSTORE = FF(32);
41 const auto constants_AVM_EXEC_OP_ID_GETENVVAR = FF(1);
42 const auto constants_AVM_EXEC_OP_ID_MOV = FF(2);
43 const auto constants_AVM_EXEC_OP_ID_JUMP = FF(4);
44 const auto constants_AVM_EXEC_OP_ID_JUMPI = FF(8);
45 const auto constants_AVM_EXEC_OP_ID_CALL = FF(16);
46 const auto constants_AVM_EXEC_OP_ID_STATICCALL = FF(32);
47 const auto constants_AVM_EXEC_OP_ID_INTERNALCALL = FF(64);
48 const auto constants_AVM_EXEC_OP_ID_INTERNALRETURN = FF(128);
49 const auto constants_AVM_EXEC_OP_ID_RETURN = FF(256);
50 const auto constants_AVM_EXEC_OP_ID_REVERT = FF(512);
51 const auto constants_AVM_EXEC_OP_ID_SUCCESSCOPY = FF(1024);
52 const auto constants_AVM_EXEC_OP_ID_RETURNDATASIZE = FF(2048);
53 const auto constants_AVM_EXEC_OP_ID_DEBUGLOG = FF(4096);
54 const auto constants_AVM_EXEC_OP_ID_SLOAD = FF(8192);
55 const auto constants_AVM_EXEC_OP_ID_SSTORE = FF(16384);
56 const auto constants_AVM_EXEC_OP_ID_NOTEHASH_EXISTS = FF(32768);
57 const auto constants_AVM_EXEC_OP_ID_EMIT_NOTEHASH = FF(65536);
58 const auto constants_AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS = FF(131072);
59 const auto constants_AVM_EXEC_OP_ID_NULLIFIER_EXISTS = FF(262144);
60 const auto constants_AVM_EXEC_OP_ID_EMIT_NULLIFIER = FF(524288);
61 const auto constants_AVM_EXEC_OP_ID_SENDL2TOL1MSG = FF(1048576);
62 const auto execution_NOT_LAST_EXEC = in.get(C::execution_sel) * in.get(C::execution_sel_shift);
63 const auto execution_SEL_SHOULD_RESOLVE_ADDRESS =
64 in.get(C::execution_sel_bytecode_retrieval_success) * in.get(C::execution_sel_instruction_fetching_success);
65
66 {
67 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
68 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel));
69 tmp *= scaling_factor;
70 std::get<0>(evals) += typename Accumulator::View(tmp);
71 }
72 {
73 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
74 auto tmp = in.get(C::execution_last) * (FF(1) - in.get(C::execution_last));
75 tmp *= scaling_factor;
76 std::get<1>(evals) += typename Accumulator::View(tmp);
77 }
78 { // ENQUEUED_CALL_START
79 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
80 auto tmp = (in.get(C::execution_enqueued_call_start_shift) -
81 (in.get(C::precomputed_first_row) + in.get(C::execution_enqueued_call_end)) *
82 in.get(C::execution_sel_shift));
83 tmp *= scaling_factor;
84 std::get<2>(evals) += typename Accumulator::View(tmp);
85 }
86 { // ENQUEUED_CALL_END
87 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
88 auto tmp = (in.get(C::execution_enqueued_call_end) -
89 in.get(C::execution_sel_exit_call) * (FF(1) - in.get(C::execution_has_parent_ctx)));
90 tmp *= scaling_factor;
91 std::get<3>(evals) += typename Accumulator::View(tmp);
92 }
93 {
94 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
95 auto tmp = (in.get(C::execution_sel_first_row_in_context_shift) -
96 (in.get(C::execution_sel_enter_call) + in.get(C::execution_enqueued_call_start_shift)));
97 tmp *= scaling_factor;
98 std::get<4>(evals) += typename Accumulator::View(tmp);
99 }
100 { // TRACE_CONTINUITY
101 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
102 auto tmp = (FF(1) - in.get(C::execution_sel)) * (FF(1) - in.get(C::precomputed_first_row)) *
103 in.get(C::execution_sel_shift);
104 tmp *= scaling_factor;
105 std::get<5>(evals) += typename Accumulator::View(tmp);
106 }
107 { // LAST_IS_LAST
108 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
109 auto tmp = (in.get(C::execution_last) - in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_shift)));
110 tmp *= scaling_factor;
111 std::get<6>(evals) += typename Accumulator::View(tmp);
112 }
113 {
114 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
115 auto tmp = (in.get(C::execution_sel_bytecode_retrieval_success) -
116 in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_bytecode_retrieval_failure)));
117 tmp *= scaling_factor;
118 std::get<7>(evals) += typename Accumulator::View(tmp);
119 }
120 {
121 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
122 auto tmp = (in.get(C::execution_sel_instruction_fetching_success) -
123 in.get(C::execution_sel_bytecode_retrieval_success) *
124 (FF(1) - in.get(C::execution_sel_instruction_fetching_failure)));
125 tmp *= scaling_factor;
126 std::get<8>(evals) += typename Accumulator::View(tmp);
127 }
128 {
129 using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>;
130 auto tmp = (in.get(C::execution_sel_should_read_registers) -
131 execution_SEL_SHOULD_RESOLVE_ADDRESS * (FF(1) - in.get(C::execution_sel_addressing_error)));
132 tmp *= scaling_factor;
133 std::get<9>(evals) += typename Accumulator::View(tmp);
134 }
135 {
136 using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>;
137 auto tmp =
138 (in.get(C::execution_sel_should_check_gas) -
139 in.get(C::execution_sel_should_read_registers) * (FF(1) - in.get(C::execution_sel_register_read_error)));
140 tmp *= scaling_factor;
141 std::get<10>(evals) += typename Accumulator::View(tmp);
142 }
143 {
144 using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>;
145 auto tmp = in.get(C::execution_sel_gas_to_radix) * (in.get(C::execution_two_five_six) - FF(256));
146 tmp *= scaling_factor;
147 std::get<11>(evals) += typename Accumulator::View(tmp);
148 }
149 {
150 using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>;
151 auto tmp = (in.get(C::execution_sel_lookup_num_p_limbs) -
152 in.get(C::execution_sel_gas_to_radix) * (FF(1) - in.get(C::execution_sel_radix_gt_256)));
153 tmp *= scaling_factor;
154 std::get<12>(evals) += typename Accumulator::View(tmp);
155 }
156 { // NUM_P_LIMBS_CEIL
157 using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>;
158 auto tmp = in.get(C::execution_sel_gas_to_radix) * in.get(C::execution_sel_radix_gt_256) *
159 (in.get(C::execution_num_p_limbs) - FF(32));
160 tmp *= scaling_factor;
161 std::get<13>(evals) += typename Accumulator::View(tmp);
162 }
163 { // DYN_L2_FACTOR_TO_RADIX_BE
164 using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>;
165 auto tmp = in.get(C::execution_sel_gas_to_radix) *
166 (((in.get(C::execution_register_2_) - in.get(C::execution_num_p_limbs)) *
167 in.get(C::execution_sel_use_num_limbs) +
168 in.get(C::execution_num_p_limbs)) -
169 in.get(C::execution_dynamic_l2_gas_factor));
170 tmp *= scaling_factor;
171 std::get<14>(evals) += typename Accumulator::View(tmp);
172 }
173 { // SSTORE_DYN_L2_GAS_IS_ZERO
174 using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>;
175 auto tmp = in.get(C::execution_sel_execute_sstore) * in.get(C::execution_dynamic_l2_gas_factor);
176 tmp *= scaling_factor;
177 std::get<15>(evals) += typename Accumulator::View(tmp);
178 }
179 {
180 using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>;
181 auto tmp = in.get(C::execution_sel_gas_emit_unencrypted_log) * in.get(C::execution_dynamic_l2_gas_factor);
182 tmp *= scaling_factor;
183 std::get<16>(evals) += typename Accumulator::View(tmp);
184 }
185 {
186 using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>;
187 auto tmp = in.get(C::execution_sel_gas_emit_unencrypted_log) *
188 (in.get(C::execution_register_1_) - in.get(C::execution_dynamic_da_gas_factor));
189 tmp *= scaling_factor;
190 std::get<17>(evals) += typename Accumulator::View(tmp);
191 }
192 {
193 using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>;
194 auto tmp = (in.get(C::execution_sel_should_execute_opcode) -
195 in.get(C::execution_sel_should_check_gas) * (FF(1) - in.get(C::execution_sel_out_of_gas)));
196 tmp *= scaling_factor;
197 std::get<18>(evals) += typename Accumulator::View(tmp);
198 }
199 {
200 using Accumulator = typename std::tuple_element_t<19, ContainerOverSubrelations>;
201 auto tmp = in.get(C::execution_sel_opcode_error) * (FF(1) - in.get(C::execution_sel_opcode_error));
202 tmp *= scaling_factor;
203 std::get<19>(evals) += typename Accumulator::View(tmp);
204 }
205 {
206 using Accumulator = typename std::tuple_element_t<20, ContainerOverSubrelations>;
207 auto tmp = in.get(C::execution_sel_execute_alu) * (FF(1) - in.get(C::execution_sel_execute_alu));
208 tmp *= scaling_factor;
209 std::get<20>(evals) += typename Accumulator::View(tmp);
210 }
211 {
212 using Accumulator = typename std::tuple_element_t<21, ContainerOverSubrelations>;
213 auto tmp = in.get(C::execution_sel_execute_bitwise) * (FF(1) - in.get(C::execution_sel_execute_bitwise));
214 tmp *= scaling_factor;
215 std::get<21>(evals) += typename Accumulator::View(tmp);
216 }
217 {
218 using Accumulator = typename std::tuple_element_t<22, ContainerOverSubrelations>;
219 auto tmp = in.get(C::execution_sel_execute_cast) * (FF(1) - in.get(C::execution_sel_execute_cast));
220 tmp *= scaling_factor;
221 std::get<22>(evals) += typename Accumulator::View(tmp);
222 }
223 {
224 using Accumulator = typename std::tuple_element_t<23, ContainerOverSubrelations>;
225 auto tmp = in.get(C::execution_sel_execute_set) * (FF(1) - in.get(C::execution_sel_execute_set));
226 tmp *= scaling_factor;
227 std::get<23>(evals) += typename Accumulator::View(tmp);
228 }
229 {
230 using Accumulator = typename std::tuple_element_t<24, ContainerOverSubrelations>;
231 auto tmp = in.get(C::execution_sel_execute_to_radix) * (FF(1) - in.get(C::execution_sel_execute_to_radix));
232 tmp *= scaling_factor;
233 std::get<24>(evals) += typename Accumulator::View(tmp);
234 }
235 {
236 using Accumulator = typename std::tuple_element_t<25, ContainerOverSubrelations>;
237 auto tmp =
238 in.get(C::execution_sel_execute_poseidon2_perm) * (FF(1) - in.get(C::execution_sel_execute_poseidon2_perm));
239 tmp *= scaling_factor;
240 std::get<25>(evals) += typename Accumulator::View(tmp);
241 }
242 {
243 using Accumulator = typename std::tuple_element_t<26, ContainerOverSubrelations>;
244 auto tmp = in.get(C::execution_sel_execute_ecc_add) * (FF(1) - in.get(C::execution_sel_execute_ecc_add));
245 tmp *= scaling_factor;
246 std::get<26>(evals) += typename Accumulator::View(tmp);
247 }
248 {
249 using Accumulator = typename std::tuple_element_t<27, ContainerOverSubrelations>;
250 auto tmp = in.get(C::execution_sel_execute_execution) * (FF(1) - in.get(C::execution_sel_execute_execution));
251 tmp *= scaling_factor;
252 std::get<27>(evals) += typename Accumulator::View(tmp);
253 }
254 {
255 using Accumulator = typename std::tuple_element_t<28, ContainerOverSubrelations>;
256 auto tmp =
257 in.get(C::execution_sel_execute_calldata_copy) * (FF(1) - in.get(C::execution_sel_execute_calldata_copy));
258 tmp *= scaling_factor;
259 std::get<28>(evals) += typename Accumulator::View(tmp);
260 }
261 {
262 using Accumulator = typename std::tuple_element_t<29, ContainerOverSubrelations>;
263 auto tmp = in.get(C::execution_sel_execute_returndata_copy) *
264 (FF(1) - in.get(C::execution_sel_execute_returndata_copy));
265 tmp *= scaling_factor;
266 std::get<29>(evals) += typename Accumulator::View(tmp);
267 }
268 {
269 using Accumulator = typename std::tuple_element_t<30, ContainerOverSubrelations>;
270 auto tmp =
271 in.get(C::execution_sel_execute_keccakf1600) * (FF(1) - in.get(C::execution_sel_execute_keccakf1600));
272 tmp *= scaling_factor;
273 std::get<30>(evals) += typename Accumulator::View(tmp);
274 }
275 {
276 using Accumulator = typename std::tuple_element_t<31, ContainerOverSubrelations>;
277 auto tmp = in.get(C::execution_sel_execute_get_contract_instance) *
278 (FF(1) - in.get(C::execution_sel_execute_get_contract_instance));
279 tmp *= scaling_factor;
280 std::get<31>(evals) += typename Accumulator::View(tmp);
281 }
282 {
283 using Accumulator = typename std::tuple_element_t<32, ContainerOverSubrelations>;
284 auto tmp = in.get(C::execution_sel_execute_emit_unencrypted_log) *
285 (FF(1) - in.get(C::execution_sel_execute_emit_unencrypted_log));
286 tmp *= scaling_factor;
287 std::get<32>(evals) += typename Accumulator::View(tmp);
288 }
289 {
290 using Accumulator = typename std::tuple_element_t<33, ContainerOverSubrelations>;
291 auto tmp = in.get(C::execution_sel_execute_sha256_compression) *
292 (FF(1) - in.get(C::execution_sel_execute_sha256_compression));
293 tmp *= scaling_factor;
294 std::get<33>(evals) += typename Accumulator::View(tmp);
295 }
296 { // SUBTRACE_ID_DECOMPOSITION
297 using Accumulator = typename std::tuple_element_t<34, ContainerOverSubrelations>;
298 auto tmp =
299 ((in.get(C::execution_sel_execute_execution) * constants_AVM_SUBTRACE_ID_EXECUTION +
300 in.get(C::execution_sel_execute_alu) * constants_AVM_SUBTRACE_ID_ALU +
301 in.get(C::execution_sel_execute_cast) * constants_AVM_SUBTRACE_ID_CAST +
302 in.get(C::execution_sel_execute_set) * constants_AVM_SUBTRACE_ID_SET +
303 in.get(C::execution_sel_execute_bitwise) * constants_AVM_SUBTRACE_ID_BITWISE +
304 in.get(C::execution_sel_execute_poseidon2_perm) * constants_AVM_SUBTRACE_ID_POSEIDON_PERM +
305 in.get(C::execution_sel_execute_to_radix) * constants_AVM_SUBTRACE_ID_TO_RADIX +
306 in.get(C::execution_sel_execute_ecc_add) * constants_AVM_SUBTRACE_ID_ECC +
307 in.get(C::execution_sel_execute_keccakf1600) * constants_AVM_SUBTRACE_ID_KECCAKF1600 +
308 in.get(C::execution_sel_execute_calldata_copy) * constants_AVM_SUBTRACE_ID_CALLDATA_COPY +
309 in.get(C::execution_sel_execute_get_contract_instance) * constants_AVM_SUBTRACE_ID_GETCONTRACTINSTANCE +
310 in.get(C::execution_sel_execute_emit_unencrypted_log) * constants_AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG +
311 in.get(C::execution_sel_execute_sha256_compression) * constants_AVM_SUBTRACE_ID_SHA256_COMPRESSION +
312 in.get(C::execution_sel_execute_returndata_copy) * constants_AVM_SUBTRACE_ID_RETURNDATA_COPY) -
313 in.get(C::execution_sel_should_execute_opcode) * in.get(C::execution_subtrace_id));
314 tmp *= scaling_factor;
315 std::get<34>(evals) += typename Accumulator::View(tmp);
316 }
317 {
318 using Accumulator = typename std::tuple_element_t<35, ContainerOverSubrelations>;
319 auto tmp =
320 in.get(C::execution_sel_execute_get_env_var) * (FF(1) - in.get(C::execution_sel_execute_get_env_var));
321 tmp *= scaling_factor;
322 std::get<35>(evals) += typename Accumulator::View(tmp);
323 }
324 {
325 using Accumulator = typename std::tuple_element_t<36, ContainerOverSubrelations>;
326 auto tmp = in.get(C::execution_sel_execute_mov) * (FF(1) - in.get(C::execution_sel_execute_mov));
327 tmp *= scaling_factor;
328 std::get<36>(evals) += typename Accumulator::View(tmp);
329 }
330 {
331 using Accumulator = typename std::tuple_element_t<37, ContainerOverSubrelations>;
332 auto tmp = in.get(C::execution_sel_execute_jump) * (FF(1) - in.get(C::execution_sel_execute_jump));
333 tmp *= scaling_factor;
334 std::get<37>(evals) += typename Accumulator::View(tmp);
335 }
336 {
337 using Accumulator = typename std::tuple_element_t<38, ContainerOverSubrelations>;
338 auto tmp = in.get(C::execution_sel_execute_jumpi) * (FF(1) - in.get(C::execution_sel_execute_jumpi));
339 tmp *= scaling_factor;
340 std::get<38>(evals) += typename Accumulator::View(tmp);
341 }
342 {
343 using Accumulator = typename std::tuple_element_t<39, ContainerOverSubrelations>;
344 auto tmp = in.get(C::execution_sel_execute_call) * (FF(1) - in.get(C::execution_sel_execute_call));
345 tmp *= scaling_factor;
346 std::get<39>(evals) += typename Accumulator::View(tmp);
347 }
348 {
349 using Accumulator = typename std::tuple_element_t<40, ContainerOverSubrelations>;
350 auto tmp =
351 in.get(C::execution_sel_execute_static_call) * (FF(1) - in.get(C::execution_sel_execute_static_call));
352 tmp *= scaling_factor;
353 std::get<40>(evals) += typename Accumulator::View(tmp);
354 }
355 {
356 using Accumulator = typename std::tuple_element_t<41, ContainerOverSubrelations>;
357 auto tmp =
358 in.get(C::execution_sel_execute_internal_call) * (FF(1) - in.get(C::execution_sel_execute_internal_call));
359 tmp *= scaling_factor;
360 std::get<41>(evals) += typename Accumulator::View(tmp);
361 }
362 {
363 using Accumulator = typename std::tuple_element_t<42, ContainerOverSubrelations>;
364 auto tmp = in.get(C::execution_sel_execute_internal_return) *
365 (FF(1) - in.get(C::execution_sel_execute_internal_return));
366 tmp *= scaling_factor;
367 std::get<42>(evals) += typename Accumulator::View(tmp);
368 }
369 {
370 using Accumulator = typename std::tuple_element_t<43, ContainerOverSubrelations>;
371 auto tmp = in.get(C::execution_sel_execute_return) * (FF(1) - in.get(C::execution_sel_execute_return));
372 tmp *= scaling_factor;
373 std::get<43>(evals) += typename Accumulator::View(tmp);
374 }
375 {
376 using Accumulator = typename std::tuple_element_t<44, ContainerOverSubrelations>;
377 auto tmp = in.get(C::execution_sel_execute_revert) * (FF(1) - in.get(C::execution_sel_execute_revert));
378 tmp *= scaling_factor;
379 std::get<44>(evals) += typename Accumulator::View(tmp);
380 }
381 {
382 using Accumulator = typename std::tuple_element_t<45, ContainerOverSubrelations>;
383 auto tmp =
384 in.get(C::execution_sel_execute_success_copy) * (FF(1) - in.get(C::execution_sel_execute_success_copy));
385 tmp *= scaling_factor;
386 std::get<45>(evals) += typename Accumulator::View(tmp);
387 }
388 {
389 using Accumulator = typename std::tuple_element_t<46, ContainerOverSubrelations>;
390 auto tmp = in.get(C::execution_sel_execute_returndata_size) *
391 (FF(1) - in.get(C::execution_sel_execute_returndata_size));
392 tmp *= scaling_factor;
393 std::get<46>(evals) += typename Accumulator::View(tmp);
394 }
395 {
396 using Accumulator = typename std::tuple_element_t<47, ContainerOverSubrelations>;
397 auto tmp = in.get(C::execution_sel_execute_debug_log) * (FF(1) - in.get(C::execution_sel_execute_debug_log));
398 tmp *= scaling_factor;
399 std::get<47>(evals) += typename Accumulator::View(tmp);
400 }
401 {
402 using Accumulator = typename std::tuple_element_t<48, ContainerOverSubrelations>;
403 auto tmp = in.get(C::execution_sel_execute_sload) * (FF(1) - in.get(C::execution_sel_execute_sload));
404 tmp *= scaling_factor;
405 std::get<48>(evals) += typename Accumulator::View(tmp);
406 }
407 {
408 using Accumulator = typename std::tuple_element_t<49, ContainerOverSubrelations>;
409 auto tmp = in.get(C::execution_sel_execute_sstore) * (FF(1) - in.get(C::execution_sel_execute_sstore));
410 tmp *= scaling_factor;
411 std::get<49>(evals) += typename Accumulator::View(tmp);
412 }
413 {
414 using Accumulator = typename std::tuple_element_t<50, ContainerOverSubrelations>;
415 auto tmp = in.get(C::execution_sel_execute_notehash_exists) *
416 (FF(1) - in.get(C::execution_sel_execute_notehash_exists));
417 tmp *= scaling_factor;
418 std::get<50>(evals) += typename Accumulator::View(tmp);
419 }
420 {
421 using Accumulator = typename std::tuple_element_t<51, ContainerOverSubrelations>;
422 auto tmp =
423 in.get(C::execution_sel_execute_emit_notehash) * (FF(1) - in.get(C::execution_sel_execute_emit_notehash));
424 tmp *= scaling_factor;
425 std::get<51>(evals) += typename Accumulator::View(tmp);
426 }
427 {
428 using Accumulator = typename std::tuple_element_t<52, ContainerOverSubrelations>;
429 auto tmp = in.get(C::execution_sel_execute_l1_to_l2_message_exists) *
430 (FF(1) - in.get(C::execution_sel_execute_l1_to_l2_message_exists));
431 tmp *= scaling_factor;
432 std::get<52>(evals) += typename Accumulator::View(tmp);
433 }
434 {
435 using Accumulator = typename std::tuple_element_t<53, ContainerOverSubrelations>;
436 auto tmp = in.get(C::execution_sel_execute_nullifier_exists) *
437 (FF(1) - in.get(C::execution_sel_execute_nullifier_exists));
438 tmp *= scaling_factor;
439 std::get<53>(evals) += typename Accumulator::View(tmp);
440 }
441 {
442 using Accumulator = typename std::tuple_element_t<54, ContainerOverSubrelations>;
443 auto tmp =
444 in.get(C::execution_sel_execute_emit_nullifier) * (FF(1) - in.get(C::execution_sel_execute_emit_nullifier));
445 tmp *= scaling_factor;
446 std::get<54>(evals) += typename Accumulator::View(tmp);
447 }
448 {
449 using Accumulator = typename std::tuple_element_t<55, ContainerOverSubrelations>;
450 auto tmp = in.get(C::execution_sel_execute_send_l2_to_l1_msg) *
451 (FF(1) - in.get(C::execution_sel_execute_send_l2_to_l1_msg));
452 tmp *= scaling_factor;
453 std::get<55>(evals) += typename Accumulator::View(tmp);
454 }
455 { // EXEC_OP_ID_DECOMPOSITION
456 using Accumulator = typename std::tuple_element_t<56, ContainerOverSubrelations>;
457 auto tmp = ((in.get(C::execution_sel_execute_get_env_var) * constants_AVM_EXEC_OP_ID_GETENVVAR +
458 in.get(C::execution_sel_execute_mov) * constants_AVM_EXEC_OP_ID_MOV +
459 in.get(C::execution_sel_execute_jump) * constants_AVM_EXEC_OP_ID_JUMP +
460 in.get(C::execution_sel_execute_jumpi) * constants_AVM_EXEC_OP_ID_JUMPI +
461 in.get(C::execution_sel_execute_call) * constants_AVM_EXEC_OP_ID_CALL +
462 in.get(C::execution_sel_execute_static_call) * constants_AVM_EXEC_OP_ID_STATICCALL +
463 in.get(C::execution_sel_execute_internal_call) * constants_AVM_EXEC_OP_ID_INTERNALCALL +
464 in.get(C::execution_sel_execute_internal_return) * constants_AVM_EXEC_OP_ID_INTERNALRETURN +
465 in.get(C::execution_sel_execute_return) * constants_AVM_EXEC_OP_ID_RETURN +
466 in.get(C::execution_sel_execute_revert) * constants_AVM_EXEC_OP_ID_REVERT +
467 in.get(C::execution_sel_execute_success_copy) * constants_AVM_EXEC_OP_ID_SUCCESSCOPY +
468 in.get(C::execution_sel_execute_returndata_size) * constants_AVM_EXEC_OP_ID_RETURNDATASIZE +
469 in.get(C::execution_sel_execute_debug_log) * constants_AVM_EXEC_OP_ID_DEBUGLOG +
470 in.get(C::execution_sel_execute_sload) * constants_AVM_EXEC_OP_ID_SLOAD +
471 in.get(C::execution_sel_execute_sstore) * constants_AVM_EXEC_OP_ID_SSTORE +
472 in.get(C::execution_sel_execute_notehash_exists) * constants_AVM_EXEC_OP_ID_NOTEHASH_EXISTS +
473 in.get(C::execution_sel_execute_emit_notehash) * constants_AVM_EXEC_OP_ID_EMIT_NOTEHASH +
474 in.get(C::execution_sel_execute_l1_to_l2_message_exists) *
475 constants_AVM_EXEC_OP_ID_L1_TO_L2_MESSAGE_EXISTS +
476 in.get(C::execution_sel_execute_nullifier_exists) * constants_AVM_EXEC_OP_ID_NULLIFIER_EXISTS +
477 in.get(C::execution_sel_execute_emit_nullifier) * constants_AVM_EXEC_OP_ID_EMIT_NULLIFIER +
478 in.get(C::execution_sel_execute_send_l2_to_l1_msg) * constants_AVM_EXEC_OP_ID_SENDL2TOL1MSG) -
479 in.get(C::execution_sel_should_execute_opcode) * in.get(C::execution_sel_execute_execution) *
480 in.get(C::execution_subtrace_operation_id));
481 tmp *= scaling_factor;
482 std::get<56>(evals) += typename Accumulator::View(tmp);
483 }
484 {
485 using Accumulator = typename std::tuple_element_t<57, ContainerOverSubrelations>;
486 auto tmp = in.get(C::execution_sel_gas_calldata_copy) * (FF(1) - in.get(C::execution_sel_gas_calldata_copy));
487 tmp *= scaling_factor;
488 std::get<57>(evals) += typename Accumulator::View(tmp);
489 }
490 {
491 using Accumulator = typename std::tuple_element_t<58, ContainerOverSubrelations>;
492 auto tmp =
493 in.get(C::execution_sel_gas_returndata_copy) * (FF(1) - in.get(C::execution_sel_gas_returndata_copy));
494 tmp *= scaling_factor;
495 std::get<58>(evals) += typename Accumulator::View(tmp);
496 }
497 {
498 using Accumulator = typename std::tuple_element_t<59, ContainerOverSubrelations>;
499 auto tmp = in.get(C::execution_sel_gas_to_radix) * (FF(1) - in.get(C::execution_sel_gas_to_radix));
500 tmp *= scaling_factor;
501 std::get<59>(evals) += typename Accumulator::View(tmp);
502 }
503 {
504 using Accumulator = typename std::tuple_element_t<60, ContainerOverSubrelations>;
505 auto tmp = in.get(C::execution_sel_gas_bitwise) * (FF(1) - in.get(C::execution_sel_gas_bitwise));
506 tmp *= scaling_factor;
507 std::get<60>(evals) += typename Accumulator::View(tmp);
508 }
509 {
510 using Accumulator = typename std::tuple_element_t<61, ContainerOverSubrelations>;
511 auto tmp = in.get(C::execution_sel_gas_emit_unencrypted_log) *
512 (FF(1) - in.get(C::execution_sel_gas_emit_unencrypted_log));
513 tmp *= scaling_factor;
514 std::get<61>(evals) += typename Accumulator::View(tmp);
515 }
516 {
517 using Accumulator = typename std::tuple_element_t<62, ContainerOverSubrelations>;
518 auto tmp = in.get(C::execution_sel_gas_sstore) * (FF(1) - in.get(C::execution_sel_gas_sstore));
519 tmp *= scaling_factor;
520 std::get<62>(evals) += typename Accumulator::View(tmp);
521 }
522 { // DYN_GAS_ID_DECOMPOSITION
523 using Accumulator = typename std::tuple_element_t<63, ContainerOverSubrelations>;
524 auto tmp =
525 ((in.get(C::execution_sel_gas_calldata_copy) * constants_AVM_DYN_GAS_ID_CALLDATACOPY +
526 in.get(C::execution_sel_gas_returndata_copy) * constants_AVM_DYN_GAS_ID_RETURNDATACOPY +
527 in.get(C::execution_sel_gas_to_radix) * constants_AVM_DYN_GAS_ID_TORADIX +
528 in.get(C::execution_sel_gas_bitwise) * constants_AVM_DYN_GAS_ID_BITWISE +
529 in.get(C::execution_sel_gas_emit_unencrypted_log) * constants_AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG +
530 in.get(C::execution_sel_gas_sstore) * constants_AVM_DYN_GAS_ID_SSTORE) -
531 in.get(C::execution_sel_should_check_gas) * in.get(C::execution_sel) * in.get(C::execution_dyn_gas_id));
532 tmp *= scaling_factor;
533 std::get<63>(evals) += typename Accumulator::View(tmp);
534 }
535 {
536 using Accumulator = typename std::tuple_element_t<64, ContainerOverSubrelations>;
537 auto tmp = in.get(C::execution_sel_opcode_failure) * (FF(1) - in.get(C::execution_sel_opcode_failure));
538 tmp *= scaling_factor;
539 std::get<64>(evals) += typename Accumulator::View(tmp);
540 }
541 { // PC_NEXT_ROW_INT_CALL_JUMP
542 using Accumulator = typename std::tuple_element_t<65, ContainerOverSubrelations>;
543 auto tmp = execution_NOT_LAST_EXEC *
544 (in.get(C::execution_sel_execute_internal_call) + in.get(C::execution_sel_execute_jump)) *
545 (in.get(C::execution_pc_shift) - in.get(C::execution_rop_0_));
546 tmp *= scaling_factor;
547 std::get<65>(evals) += typename Accumulator::View(tmp);
548 }
549 { // PC_NEXT_ROW_JUMPI
550 using Accumulator = typename std::tuple_element_t<66, ContainerOverSubrelations>;
551 auto tmp = execution_NOT_LAST_EXEC * in.get(C::execution_sel_execute_jumpi) *
552 ((in.get(C::execution_register_0_) * (in.get(C::execution_rop_1_) - in.get(C::execution_next_pc)) +
553 in.get(C::execution_next_pc)) -
554 in.get(C::execution_pc_shift));
555 tmp *= scaling_factor;
556 std::get<66>(evals) += typename Accumulator::View(tmp);
557 }
558 { // MOV_SAME_VALUE
559 using Accumulator = typename std::tuple_element_t<67, ContainerOverSubrelations>;
560 auto tmp = in.get(C::execution_sel_execute_mov) *
561 (in.get(C::execution_register_0_) - in.get(C::execution_register_1_));
562 tmp *= scaling_factor;
563 std::get<67>(evals) += typename Accumulator::View(tmp);
564 }
565 { // MOV_SAME_TAG
566 using Accumulator = typename std::tuple_element_t<68, ContainerOverSubrelations>;
567 auto tmp = in.get(C::execution_sel_execute_mov) *
568 (in.get(C::execution_mem_tag_reg_0_) - in.get(C::execution_mem_tag_reg_1_));
569 tmp *= scaling_factor;
570 std::get<68>(evals) += typename Accumulator::View(tmp);
571 }
572 { // SUCCESS_COPY_WRITE_REG
573 using Accumulator = typename std::tuple_element_t<69, ContainerOverSubrelations>;
574 auto tmp = in.get(C::execution_sel_execute_success_copy) *
575 (in.get(C::execution_register_0_) - in.get(C::execution_last_child_success));
576 tmp *= scaling_factor;
577 std::get<69>(evals) += typename Accumulator::View(tmp);
578 }
579 { // SUCCESS_COPY_U1_TAG
580 using Accumulator = typename std::tuple_element_t<70, ContainerOverSubrelations>;
581 auto tmp = in.get(C::execution_sel_execute_success_copy) *
582 (in.get(C::execution_mem_tag_reg_0_) - constants_MEM_TAG_U1);
583 tmp *= scaling_factor;
584 std::get<70>(evals) += typename Accumulator::View(tmp);
585 }
586 { // RETURNDATA_SIZE_WRITE_REG
587 using Accumulator = typename std::tuple_element_t<71, ContainerOverSubrelations>;
588 auto tmp = in.get(C::execution_sel_execute_returndata_size) *
589 (in.get(C::execution_register_0_) - in.get(C::execution_last_child_returndata_size));
590 tmp *= scaling_factor;
591 std::get<71>(evals) += typename Accumulator::View(tmp);
592 }
593 { // RETURNDATA_SIZE_U32_TAG
594 using Accumulator = typename std::tuple_element_t<72, ContainerOverSubrelations>;
595 auto tmp = in.get(C::execution_sel_execute_returndata_size) *
596 (in.get(C::execution_mem_tag_reg_0_) - constants_MEM_TAG_U32);
597 tmp *= scaling_factor;
598 std::get<72>(evals) += typename Accumulator::View(tmp);
599 }
600 { // PUBLIC_DATA_TREE_ROOT_NOT_CHANGED
601 using Accumulator = typename std::tuple_element_t<73, ContainerOverSubrelations>;
602 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_sstore)) *
603 (in.get(C::execution_prev_public_data_tree_root) - in.get(C::execution_public_data_tree_root));
604 tmp *= scaling_factor;
605 std::get<73>(evals) += typename Accumulator::View(tmp);
606 }
607 { // PUBLIC_DATA_TREE_SIZE_NOT_CHANGED
608 using Accumulator = typename std::tuple_element_t<74, ContainerOverSubrelations>;
609 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_sstore)) *
610 (in.get(C::execution_prev_public_data_tree_size) - in.get(C::execution_public_data_tree_size));
611 tmp *= scaling_factor;
612 std::get<74>(evals) += typename Accumulator::View(tmp);
613 }
614 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_NOT_CHANGED
615 using Accumulator = typename std::tuple_element_t<75, ContainerOverSubrelations>;
616 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_sstore)) *
617 (in.get(C::execution_prev_written_public_data_slots_tree_root) -
618 in.get(C::execution_written_public_data_slots_tree_root));
619 tmp *= scaling_factor;
620 std::get<75>(evals) += typename Accumulator::View(tmp);
621 }
622 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_NOT_CHANGED
623 using Accumulator = typename std::tuple_element_t<76, ContainerOverSubrelations>;
624 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_sstore)) *
625 (in.get(C::execution_prev_written_public_data_slots_tree_size) -
626 in.get(C::execution_written_public_data_slots_tree_size));
627 tmp *= scaling_factor;
628 std::get<76>(evals) += typename Accumulator::View(tmp);
629 }
630 { // NOTE_HASH_TREE_ROOT_NOT_CHANGED
631 using Accumulator = typename std::tuple_element_t<77, ContainerOverSubrelations>;
632 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_notehash)) *
633 (in.get(C::execution_prev_note_hash_tree_root) - in.get(C::execution_note_hash_tree_root));
634 tmp *= scaling_factor;
635 std::get<77>(evals) += typename Accumulator::View(tmp);
636 }
637 { // NOTE_HASH_TREE_SIZE_NOT_CHANGED
638 using Accumulator = typename std::tuple_element_t<78, ContainerOverSubrelations>;
639 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_notehash)) *
640 (in.get(C::execution_prev_note_hash_tree_size) - in.get(C::execution_note_hash_tree_size));
641 tmp *= scaling_factor;
642 std::get<78>(evals) += typename Accumulator::View(tmp);
643 }
644 { // NUM_NOTE_HASHES_EMITTED_NOT_CHANGED
645 using Accumulator = typename std::tuple_element_t<79, ContainerOverSubrelations>;
646 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_notehash)) *
647 (in.get(C::execution_prev_num_note_hashes_emitted) - in.get(C::execution_num_note_hashes_emitted));
648 tmp *= scaling_factor;
649 std::get<79>(evals) += typename Accumulator::View(tmp);
650 }
651 { // NULLIFIER_TREE_ROOT_NOT_CHANGED
652 using Accumulator = typename std::tuple_element_t<80, ContainerOverSubrelations>;
653 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_nullifier)) *
654 (in.get(C::execution_prev_nullifier_tree_root) - in.get(C::execution_nullifier_tree_root));
655 tmp *= scaling_factor;
656 std::get<80>(evals) += typename Accumulator::View(tmp);
657 }
658 { // NULLIFIER_TREE_SIZE_NOT_CHANGED
659 using Accumulator = typename std::tuple_element_t<81, ContainerOverSubrelations>;
660 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_nullifier)) *
661 (in.get(C::execution_prev_nullifier_tree_size) - in.get(C::execution_nullifier_tree_size));
662 tmp *= scaling_factor;
663 std::get<81>(evals) += typename Accumulator::View(tmp);
664 }
665 { // NUM_NULLIFIERS_EMITTED_NOT_CHANGED
666 using Accumulator = typename std::tuple_element_t<82, ContainerOverSubrelations>;
667 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_nullifier)) *
668 (in.get(C::execution_prev_num_nullifiers_emitted) - in.get(C::execution_num_nullifiers_emitted));
669 tmp *= scaling_factor;
670 std::get<82>(evals) += typename Accumulator::View(tmp);
671 }
672 { // NUM_UNENCRYPTED_LOGS_NOT_CHANGED
673 using Accumulator = typename std::tuple_element_t<83, ContainerOverSubrelations>;
674 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_emit_unencrypted_log)) *
675 (in.get(C::execution_prev_num_unencrypted_logs) - in.get(C::execution_num_unencrypted_logs));
676 tmp *= scaling_factor;
677 std::get<83>(evals) += typename Accumulator::View(tmp);
678 }
679 { // NUM_L2_TO_L1_MESSAGES_NOT_CHANGED
680 using Accumulator = typename std::tuple_element_t<84, ContainerOverSubrelations>;
681 auto tmp = in.get(C::execution_sel) * (FF(1) - in.get(C::execution_sel_execute_send_l2_to_l1_msg)) *
682 (in.get(C::execution_prev_num_l2_to_l1_messages) - in.get(C::execution_num_l2_to_l1_messages));
683 tmp *= scaling_factor;
684 std::get<84>(evals) += typename Accumulator::View(tmp);
685 }
686 {
687 using Accumulator = typename std::tuple_element_t<85, ContainerOverSubrelations>;
688 auto tmp = (in.get(C::execution_sel_execute_mov) + in.get(C::execution_sel_execute_returndata_size) +
689 in.get(C::execution_sel_execute_jump) + in.get(C::execution_sel_execute_jumpi) +
690 in.get(C::execution_sel_execute_debug_log) + in.get(C::execution_sel_execute_success_copy) +
691 in.get(C::execution_sel_execute_call) + in.get(C::execution_sel_execute_static_call) +
692 in.get(C::execution_sel_execute_internal_call) + in.get(C::execution_sel_execute_return) +
693 in.get(C::execution_sel_execute_revert)) *
694 in.get(C::execution_sel_opcode_error);
695 tmp *= scaling_factor;
696 std::get<85>(evals) += typename Accumulator::View(tmp);
697 }
698 {
699 using Accumulator = typename std::tuple_element_t<86, ContainerOverSubrelations>;
700 auto tmp = (in.get(C::execution_sel_should_write_registers) -
701 in.get(C::execution_sel_should_execute_opcode) * (FF(1) - in.get(C::execution_sel_opcode_error)));
702 tmp *= scaling_factor;
703 std::get<86>(evals) += typename Accumulator::View(tmp);
704 }
705 {
706 using Accumulator = typename std::tuple_element_t<87, ContainerOverSubrelations>;
707 auto tmp = (in.get(C::execution_sel_error) -
708 (in.get(C::execution_sel_bytecode_retrieval_failure) +
709 in.get(C::execution_sel_instruction_fetching_failure) + in.get(C::execution_sel_addressing_error) +
710 in.get(C::execution_sel_register_read_error) + in.get(C::execution_sel_out_of_gas) +
711 in.get(C::execution_sel_opcode_error)));
712 tmp *= scaling_factor;
713 std::get<87>(evals) += typename Accumulator::View(tmp);
714 }
715}
716
717} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
ColumnAndShifts
Definition columns.hpp:35
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
#define PROFILE_THIS_NAME(name)
Definition op_count.hpp:16
Container for parameters used by the grand product (permutation, lookup) Honk relations.