Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tx_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 txImpl<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/tx");
18
19 const auto constants_MAX_NOTE_HASHES_PER_TX = FF(64);
20 const auto constants_MAX_NULLIFIERS_PER_TX = FF(64);
21 const auto constants_MAX_L2_TO_L1_MSGS_PER_TX = FF(8);
22 const auto constants_FEE_JUICE_ADDRESS = FF(5);
23 const auto constants_FEE_JUICE_BALANCES_SLOT = FF(1);
24 const auto constants_AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX = FF(18);
25 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX = FF(503);
26 const auto constants_AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX = FF(679);
27 const auto tx_NOT_LAST = in.get(C::tx_sel_shift) * in.get(C::tx_sel);
28 const auto tx_NOT_PHASE_END = tx_NOT_LAST * (FF(1) - in.get(C::tx_end_phase));
29 const auto tx_REM_COUNT_MINUS_1 = (in.get(C::tx_remaining_phase_counter) - FF(1));
30 const auto tx_IS_ONE_SHOT_PHASE =
31 in.get(C::tx_is_collect_fee) + in.get(C::tx_is_tree_padding) + in.get(C::tx_is_cleanup);
32 const auto tx_REMAINING_NOTE_HASH_WRITES =
33 (constants_MAX_NOTE_HASHES_PER_TX - in.get(C::tx_prev_num_note_hashes_emitted));
34 const auto tx_NULLIFIER_LIMIT_ERROR = (FF(1) - in.get(C::tx_should_nullifier_append));
35 const auto tx_REMAINING_NULLIFIER_WRITES =
36 (constants_MAX_NULLIFIERS_PER_TX - in.get(C::tx_prev_num_nullifiers_emitted));
37 const auto tx_REMAINING_L2_TO_L1_MSG_WRITES =
38 (constants_MAX_L2_TO_L1_MSGS_PER_TX - in.get(C::tx_prev_num_l2_to_l1_messages));
39
40 {
41 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
42 auto tmp = in.get(C::tx_sel) * (FF(1) - in.get(C::tx_sel));
43 tmp *= scaling_factor;
44 std::get<0>(evals) += typename Accumulator::View(tmp);
45 }
46 { // NO_EXTRANEOUS_ROWS
47 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
48 auto tmp = (FF(1) - in.get(C::tx_sel)) * in.get(C::tx_sel_shift) * (FF(1) - in.get(C::precomputed_first_row));
49 tmp *= scaling_factor;
50 std::get<1>(evals) += typename Accumulator::View(tmp);
51 }
52 { // SEL_ON_FIRST_ROW
53 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
54 auto tmp = in.get(C::precomputed_first_row) * (FF(1) - in.get(C::tx_sel_shift));
55 tmp *= scaling_factor;
56 std::get<2>(evals) += typename Accumulator::View(tmp);
57 }
58 { // NO_EARLY_END
59 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
60 auto tmp = in.get(C::tx_sel) * (FF(1) - in.get(C::tx_sel_shift)) * (FF(1) - in.get(C::tx_is_cleanup));
61 tmp *= scaling_factor;
62 std::get<3>(evals) += typename Accumulator::View(tmp);
63 }
64 { // START_WITH_SEL
65 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
66 auto tmp = (in.get(C::tx_start_tx_shift) - (FF(1) - in.get(C::tx_sel)) * in.get(C::tx_sel_shift));
67 tmp *= scaling_factor;
68 std::get<4>(evals) += typename Accumulator::View(tmp);
69 }
70 {
71 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
72 auto tmp = in.get(C::tx_is_padded) * (FF(1) - in.get(C::tx_is_padded));
73 tmp *= scaling_factor;
74 std::get<5>(evals) += typename Accumulator::View(tmp);
75 }
76 {
77 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
78 auto tmp = in.get(C::tx_is_padded) * in.get(C::tx_reverted);
79 tmp *= scaling_factor;
80 std::get<6>(evals) += typename Accumulator::View(tmp);
81 }
82 {
83 using Accumulator = typename std::tuple_element_t<7, ContainerOverSubrelations>;
84 auto tmp = in.get(C::tx_start_phase) * (FF(1) - in.get(C::tx_start_phase));
85 tmp *= scaling_factor;
86 std::get<7>(evals) += typename Accumulator::View(tmp);
87 }
88 {
89 using Accumulator = typename std::tuple_element_t<8, ContainerOverSubrelations>;
90 auto tmp = in.get(C::tx_end_phase) * (FF(1) - in.get(C::tx_end_phase));
91 tmp *= scaling_factor;
92 std::get<8>(evals) += typename Accumulator::View(tmp);
93 }
94 { // START_FOLLOWS_END
95 using Accumulator = typename std::tuple_element_t<9, ContainerOverSubrelations>;
96 auto tmp = tx_NOT_LAST *
97 (in.get(C::tx_start_phase_shift) - (in.get(C::tx_end_phase) + in.get(C::precomputed_first_row)));
98 tmp *= scaling_factor;
99 std::get<9>(evals) += typename Accumulator::View(tmp);
100 }
101 { // PHASE_VALUE_CONTINUITY
102 using Accumulator = typename std::tuple_element_t<10, ContainerOverSubrelations>;
103 auto tmp = tx_NOT_PHASE_END * (FF(1) - in.get(C::tx_reverted)) * (FF(1) - in.get(C::precomputed_first_row)) *
104 (in.get(C::tx_phase_value_shift) - in.get(C::tx_phase_value));
105 tmp *= scaling_factor;
106 std::get<10>(evals) += typename Accumulator::View(tmp);
107 }
108 { // INCR_PHASE_VALUE_ON_END
109 using Accumulator = typename std::tuple_element_t<11, ContainerOverSubrelations>;
110 auto tmp = tx_NOT_LAST * (FF(1) - in.get(C::tx_reverted)) * in.get(C::tx_end_phase) *
111 (in.get(C::tx_phase_value_shift) - (in.get(C::tx_phase_value) + FF(1)));
112 tmp *= scaling_factor;
113 std::get<11>(evals) += typename Accumulator::View(tmp);
114 }
115 {
116 using Accumulator = typename std::tuple_element_t<12, ContainerOverSubrelations>;
117 auto tmp = in.get(C::tx_reverted) * (FF(1) - in.get(C::tx_is_revertible));
118 tmp *= scaling_factor;
119 std::get<12>(evals) += typename Accumulator::View(tmp);
120 }
121 { // REM_COUNT_IS_ZERO
122 using Accumulator = typename std::tuple_element_t<13, ContainerOverSubrelations>;
123 auto tmp = in.get(C::tx_sel) * ((in.get(C::tx_remaining_phase_counter) *
124 (in.get(C::tx_is_padded) * (FF(1) - in.get(C::tx_remaining_phase_inv)) +
125 in.get(C::tx_remaining_phase_inv)) -
126 FF(1)) +
127 in.get(C::tx_is_padded));
128 tmp *= scaling_factor;
129 std::get<13>(evals) += typename Accumulator::View(tmp);
130 }
131 { // REM_COUNT_IS_ONE
132 using Accumulator = typename std::tuple_element_t<14, ContainerOverSubrelations>;
133 auto tmp =
134 in.get(C::tx_sel) * (FF(1) - in.get(C::tx_is_padded)) *
135 ((tx_REM_COUNT_MINUS_1 * (in.get(C::tx_end_phase) * (FF(1) - in.get(C::tx_remaining_phase_minus_one_inv)) +
136 in.get(C::tx_remaining_phase_minus_one_inv)) -
137 FF(1)) +
138 in.get(C::tx_end_phase));
139 tmp *= scaling_factor;
140 std::get<14>(evals) += typename Accumulator::View(tmp);
141 }
142 { // READ_PI_LENGTH_SEL
143 using Accumulator = typename std::tuple_element_t<15, ContainerOverSubrelations>;
144 auto tmp = in.get(C::tx_sel) *
145 (in.get(C::tx_sel_read_phase_length) - in.get(C::tx_start_phase) * (FF(1) - tx_IS_ONE_SHOT_PHASE));
146 tmp *= scaling_factor;
147 std::get<15>(evals) += typename Accumulator::View(tmp);
148 }
149 { // ONE_SHOT_REMAINING_PHASE_COUNTER_ONE
150 using Accumulator = typename std::tuple_element_t<16, ContainerOverSubrelations>;
151 auto tmp = tx_IS_ONE_SHOT_PHASE * (in.get(C::tx_remaining_phase_counter) - FF(1));
152 tmp *= scaling_factor;
153 std::get<16>(evals) += typename Accumulator::View(tmp);
154 }
155 { // DECR_REM_PHASE_EVENTS
156 using Accumulator = typename std::tuple_element_t<17, ContainerOverSubrelations>;
157 auto tmp = (FF(1) - in.get(C::precomputed_first_row)) * tx_NOT_PHASE_END *
158 (in.get(C::tx_remaining_phase_counter_shift) - (in.get(C::tx_remaining_phase_counter) - FF(1)));
159 tmp *= scaling_factor;
160 std::get<17>(evals) += typename Accumulator::View(tmp);
161 }
162 { // INCR_READ_PI_OFFSET
163 using Accumulator = typename std::tuple_element_t<18, ContainerOverSubrelations>;
164 auto tmp = (FF(1) - in.get(C::precomputed_first_row)) * tx_NOT_PHASE_END *
165 (in.get(C::tx_read_pi_offset_shift) - (in.get(C::tx_read_pi_offset) + FF(1)));
166 tmp *= scaling_factor;
167 std::get<18>(evals) += typename Accumulator::View(tmp);
168 }
169 {
170 using Accumulator = typename std::tuple_element_t<19, ContainerOverSubrelations>;
171 auto tmp = (in.get(C::tx_should_process_call_request) -
172 in.get(C::tx_is_public_call_request) * (FF(1) - in.get(C::tx_is_padded)));
173 tmp *= scaling_factor;
174 std::get<19>(evals) += typename Accumulator::View(tmp);
175 }
176 {
177 using Accumulator = typename std::tuple_element_t<20, ContainerOverSubrelations>;
178 auto tmp = in.get(C::tx_is_teardown_phase) * (FF(1) - in.get(C::tx_is_teardown_phase));
179 tmp *= scaling_factor;
180 std::get<20>(evals) += typename Accumulator::View(tmp);
181 }
182 {
183 using Accumulator = typename std::tuple_element_t<21, ContainerOverSubrelations>;
184 auto tmp = in.get(C::tx_should_process_call_request) *
185 (((FF(0) - in.get(C::tx_prev_l2_gas_used)) * in.get(C::tx_is_teardown_phase) +
186 in.get(C::tx_prev_l2_gas_used)) -
187 in.get(C::tx_prev_l2_gas_used_sent_to_enqueued_call));
188 tmp *= scaling_factor;
189 std::get<21>(evals) += typename Accumulator::View(tmp);
190 }
191 {
192 using Accumulator = typename std::tuple_element_t<22, ContainerOverSubrelations>;
193 auto tmp = in.get(C::tx_should_process_call_request) *
194 (((FF(0) - in.get(C::tx_prev_da_gas_used)) * in.get(C::tx_is_teardown_phase) +
195 in.get(C::tx_prev_da_gas_used)) -
196 in.get(C::tx_prev_da_gas_used_sent_to_enqueued_call));
197 tmp *= scaling_factor;
198 std::get<22>(evals) += typename Accumulator::View(tmp);
199 }
200 {
201 using Accumulator = typename std::tuple_element_t<23, ContainerOverSubrelations>;
202 auto tmp = in.get(C::tx_should_process_call_request) *
203 (((in.get(C::tx_prev_l2_gas_used) - in.get(C::tx_next_l2_gas_used_sent_to_enqueued_call)) *
204 in.get(C::tx_is_teardown_phase) +
205 in.get(C::tx_next_l2_gas_used_sent_to_enqueued_call)) -
206 in.get(C::tx_next_l2_gas_used));
207 tmp *= scaling_factor;
208 std::get<23>(evals) += typename Accumulator::View(tmp);
209 }
210 {
211 using Accumulator = typename std::tuple_element_t<24, ContainerOverSubrelations>;
212 auto tmp = in.get(C::tx_should_process_call_request) *
213 (((in.get(C::tx_prev_da_gas_used) - in.get(C::tx_next_da_gas_used_sent_to_enqueued_call)) *
214 in.get(C::tx_is_teardown_phase) +
215 in.get(C::tx_next_da_gas_used_sent_to_enqueued_call)) -
216 in.get(C::tx_next_da_gas_used));
217 tmp *= scaling_factor;
218 std::get<24>(evals) += typename Accumulator::View(tmp);
219 }
220 {
221 using Accumulator = typename std::tuple_element_t<25, ContainerOverSubrelations>;
222 auto tmp =
223 (in.get(C::tx_is_tree_insert_phase) -
224 (in.get(C::tx_sel_revertible_append_note_hash) + in.get(C::tx_sel_non_revertible_append_note_hash) +
225 in.get(C::tx_sel_revertible_append_nullifier) + in.get(C::tx_sel_non_revertible_append_nullifier)));
226 tmp *= scaling_factor;
227 std::get<25>(evals) += typename Accumulator::View(tmp);
228 }
229 {
230 using Accumulator = typename std::tuple_element_t<26, ContainerOverSubrelations>;
231 auto tmp =
232 (in.get(C::tx_should_try_note_hash_append) -
233 in.get(C::tx_sel) * (FF(1) - in.get(C::tx_is_padded)) *
234 (in.get(C::tx_sel_revertible_append_note_hash) + in.get(C::tx_sel_non_revertible_append_note_hash)));
235 tmp *= scaling_factor;
236 std::get<26>(evals) += typename Accumulator::View(tmp);
237 }
238 { // MAX_NOTE_HASH_WRITES_REACHED
239 using Accumulator = typename std::tuple_element_t<27, ContainerOverSubrelations>;
240 auto tmp = in.get(C::tx_should_try_note_hash_append) *
241 ((tx_REMAINING_NOTE_HASH_WRITES *
242 (in.get(C::tx_reverted) * (FF(1) - in.get(C::tx_remaining_side_effects_inv)) +
243 in.get(C::tx_remaining_side_effects_inv)) -
244 FF(1)) +
245 in.get(C::tx_reverted));
246 tmp *= scaling_factor;
247 std::get<27>(evals) += typename Accumulator::View(tmp);
248 }
249 {
250 using Accumulator = typename std::tuple_element_t<28, ContainerOverSubrelations>;
251 auto tmp = in.get(C::tx_should_try_note_hash_append) *
252 ((FF(1) - in.get(C::tx_reverted)) - in.get(C::tx_should_note_hash_append));
253 tmp *= scaling_factor;
254 std::get<28>(evals) += typename Accumulator::View(tmp);
255 }
256 {
257 using Accumulator = typename std::tuple_element_t<29, ContainerOverSubrelations>;
258 auto tmp = in.get(C::tx_should_note_hash_append) *
259 ((in.get(C::tx_prev_note_hash_tree_size) + FF(1)) - in.get(C::tx_next_note_hash_tree_size));
260 tmp *= scaling_factor;
261 std::get<29>(evals) += typename Accumulator::View(tmp);
262 }
263 {
264 using Accumulator = typename std::tuple_element_t<30, ContainerOverSubrelations>;
265 auto tmp = in.get(C::tx_should_note_hash_append) *
266 ((in.get(C::tx_prev_num_note_hashes_emitted) + FF(1)) - in.get(C::tx_next_num_note_hashes_emitted));
267 tmp *= scaling_factor;
268 std::get<30>(evals) += typename Accumulator::View(tmp);
269 }
270 {
271 using Accumulator = typename std::tuple_element_t<31, ContainerOverSubrelations>;
272 auto tmp =
273 (in.get(C::tx_should_try_nullifier_append) -
274 in.get(C::tx_sel) * (FF(1) - in.get(C::tx_is_padded)) *
275 (in.get(C::tx_sel_revertible_append_nullifier) + in.get(C::tx_sel_non_revertible_append_nullifier)));
276 tmp *= scaling_factor;
277 std::get<31>(evals) += typename Accumulator::View(tmp);
278 }
279 { // MAX_NULLIFIER_WRITES_REACHED
280 using Accumulator = typename std::tuple_element_t<32, ContainerOverSubrelations>;
281 auto tmp = in.get(C::tx_should_try_nullifier_append) *
282 ((tx_REMAINING_NULLIFIER_WRITES *
283 (tx_NULLIFIER_LIMIT_ERROR * (FF(1) - in.get(C::tx_remaining_side_effects_inv)) +
284 in.get(C::tx_remaining_side_effects_inv)) -
285 FF(1)) +
286 tx_NULLIFIER_LIMIT_ERROR);
287 tmp *= scaling_factor;
288 std::get<32>(evals) += typename Accumulator::View(tmp);
289 }
290 {
291 using Accumulator = typename std::tuple_element_t<33, ContainerOverSubrelations>;
292 auto tmp =
293 in.get(C::tx_should_try_nullifier_append) * tx_NULLIFIER_LIMIT_ERROR * (FF(1) - in.get(C::tx_reverted));
294 tmp *= scaling_factor;
295 std::get<33>(evals) += typename Accumulator::View(tmp);
296 }
297 {
298 using Accumulator = typename std::tuple_element_t<34, ContainerOverSubrelations>;
299 auto tmp = in.get(C::tx_should_nullifier_append) * (FF(1) - in.get(C::tx_reverted)) *
300 ((in.get(C::tx_prev_nullifier_tree_size) + FF(1)) - in.get(C::tx_next_nullifier_tree_size));
301 tmp *= scaling_factor;
302 std::get<34>(evals) += typename Accumulator::View(tmp);
303 }
304 {
305 using Accumulator = typename std::tuple_element_t<35, ContainerOverSubrelations>;
306 auto tmp = in.get(C::tx_should_nullifier_append) * (FF(1) - in.get(C::tx_reverted)) *
307 ((in.get(C::tx_prev_num_nullifiers_emitted) + FF(1)) - in.get(C::tx_next_num_nullifiers_emitted));
308 tmp *= scaling_factor;
309 std::get<35>(evals) += typename Accumulator::View(tmp);
310 }
311 {
312 using Accumulator = typename std::tuple_element_t<36, ContainerOverSubrelations>;
313 auto tmp =
314 (in.get(C::tx_should_try_l2_l1_msg_append) -
315 in.get(C::tx_sel) * (FF(1) - in.get(C::tx_is_padded)) *
316 (in.get(C::tx_sel_revertible_append_l2_l1_msg) + in.get(C::tx_sel_non_revertible_append_l2_l1_msg)));
317 tmp *= scaling_factor;
318 std::get<36>(evals) += typename Accumulator::View(tmp);
319 }
320 { // MAX_L2_L1_MSG_WRITES_REACHED
321 using Accumulator = typename std::tuple_element_t<37, ContainerOverSubrelations>;
322 auto tmp = in.get(C::tx_should_try_l2_l1_msg_append) * (FF(1) - in.get(C::tx_is_padded)) *
323 ((tx_REMAINING_L2_TO_L1_MSG_WRITES *
324 (in.get(C::tx_reverted) * (FF(1) - in.get(C::tx_remaining_side_effects_inv)) +
325 in.get(C::tx_remaining_side_effects_inv)) -
326 FF(1)) +
327 in.get(C::tx_reverted));
328 tmp *= scaling_factor;
329 std::get<37>(evals) += typename Accumulator::View(tmp);
330 }
331 {
332 using Accumulator = typename std::tuple_element_t<38, ContainerOverSubrelations>;
333 auto tmp = in.get(C::tx_should_try_l2_l1_msg_append) *
334 ((FF(1) - in.get(C::tx_reverted)) * (FF(1) - in.get(C::tx_discard)) -
335 in.get(C::tx_should_l2_l1_msg_append));
336 tmp *= scaling_factor;
337 std::get<38>(evals) += typename Accumulator::View(tmp);
338 }
339 {
340 using Accumulator = typename std::tuple_element_t<39, ContainerOverSubrelations>;
341 auto tmp = in.get(C::tx_should_l2_l1_msg_append) *
342 ((constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX +
343 in.get(C::tx_prev_num_l2_to_l1_messages)) -
344 in.get(C::tx_write_pi_offset));
345 tmp *= scaling_factor;
346 std::get<39>(evals) += typename Accumulator::View(tmp);
347 }
348 { // UPDATE_NUM_L2_TO_L1_MSGS
349 using Accumulator = typename std::tuple_element_t<40, ContainerOverSubrelations>;
350 auto tmp = in.get(C::tx_should_try_l2_l1_msg_append) * (FF(1) - in.get(C::tx_reverted)) *
351 ((in.get(C::tx_prev_num_l2_to_l1_messages) + FF(1)) - in.get(C::tx_next_num_l2_to_l1_messages));
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 = (in.get(C::tx_fee_payer_pi_offset) -
358 in.get(C::tx_is_collect_fee) * constants_AVM_PUBLIC_INPUTS_FEE_PAYER_ROW_IDX);
359 tmp *= scaling_factor;
360 std::get<41>(evals) += typename Accumulator::View(tmp);
361 }
362 { // COMPUTE_FEE
363 using Accumulator = typename std::tuple_element_t<42, ContainerOverSubrelations>;
364 auto tmp =
365 in.get(C::tx_is_collect_fee) * ((in.get(C::tx_effective_fee_per_da_gas) * in.get(C::tx_prev_da_gas_used) +
366 in.get(C::tx_effective_fee_per_l2_gas) * in.get(C::tx_prev_l2_gas_used)) -
367 in.get(C::tx_fee));
368 tmp *= scaling_factor;
369 std::get<42>(evals) += typename Accumulator::View(tmp);
370 }
371 { // TEARDOWN_GETS_FEE
372 using Accumulator = typename std::tuple_element_t<43, ContainerOverSubrelations>;
373 auto tmp = in.get(C::tx_is_teardown_phase) * (FF(1) - in.get(C::tx_is_padded)) *
374 (in.get(C::tx_fee_shift) - in.get(C::tx_fee));
375 tmp *= scaling_factor;
376 std::get<43>(evals) += typename Accumulator::View(tmp);
377 }
378 { // FEE_ZERO_UNLESS_COLLECT_FEE_OR_TEARDOWN
379 using Accumulator = typename std::tuple_element_t<44, ContainerOverSubrelations>;
380 auto tmp =
381 (FF(1) - in.get(C::tx_is_collect_fee)) * (FF(1) - in.get(C::tx_is_teardown_phase)) * in.get(C::tx_fee);
382 tmp *= scaling_factor;
383 std::get<44>(evals) += typename Accumulator::View(tmp);
384 }
385 {
386 using Accumulator = typename std::tuple_element_t<45, ContainerOverSubrelations>;
387 auto tmp =
388 in.get(C::tx_is_collect_fee) * (constants_FEE_JUICE_ADDRESS - in.get(C::tx_fee_juice_contract_address));
389 tmp *= scaling_factor;
390 std::get<45>(evals) += typename Accumulator::View(tmp);
391 }
392 {
393 using Accumulator = typename std::tuple_element_t<46, ContainerOverSubrelations>;
394 auto tmp =
395 in.get(C::tx_is_collect_fee) * (constants_FEE_JUICE_BALANCES_SLOT - in.get(C::tx_fee_juice_balances_slot));
396 tmp *= scaling_factor;
397 std::get<46>(evals) += typename Accumulator::View(tmp);
398 }
399 {
400 using Accumulator = typename std::tuple_element_t<47, ContainerOverSubrelations>;
401 auto tmp = in.get(C::tx_is_collect_fee) *
402 ((in.get(C::tx_fee_payer_balance) - in.get(C::tx_fee)) - in.get(C::tx_fee_payer_new_balance));
403 tmp *= scaling_factor;
404 std::get<47>(evals) += typename Accumulator::View(tmp);
405 }
406 {
407 using Accumulator = typename std::tuple_element_t<48, ContainerOverSubrelations>;
408 auto tmp = in.get(C::tx_is_collect_fee) * (in.get(C::tx_uint32_max) - FF(4294967295UL));
409 tmp *= scaling_factor;
410 std::get<48>(evals) += typename Accumulator::View(tmp);
411 }
412 {
413 using Accumulator = typename std::tuple_element_t<49, ContainerOverSubrelations>;
414 auto tmp = in.get(C::tx_is_collect_fee) *
415 (constants_AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX - in.get(C::tx_write_pi_offset));
416 tmp *= scaling_factor;
417 std::get<49>(evals) += typename Accumulator::View(tmp);
418 }
419 { // NOTE_HASH_TREE_ROOT_IMMUTABLE_IN_PADDING
420 using Accumulator = typename std::tuple_element_t<50, ContainerOverSubrelations>;
421 auto tmp = in.get(C::tx_is_tree_padding) *
422 (in.get(C::tx_prev_note_hash_tree_root) - in.get(C::tx_next_note_hash_tree_root));
423 tmp *= scaling_factor;
424 std::get<50>(evals) += typename Accumulator::View(tmp);
425 }
426 { // PAD_NOTE_HASH_TREE
427 using Accumulator = typename std::tuple_element_t<51, ContainerOverSubrelations>;
428 auto tmp = in.get(C::tx_is_tree_padding) *
429 (((in.get(C::tx_prev_note_hash_tree_size) + constants_MAX_NOTE_HASHES_PER_TX) -
430 in.get(C::tx_prev_num_note_hashes_emitted)) -
431 in.get(C::tx_next_note_hash_tree_size));
432 tmp *= scaling_factor;
433 std::get<51>(evals) += typename Accumulator::View(tmp);
434 }
435 { // NOTE_HASHES_EMITTED_IMMUTABLE_IN_PADDING
436 using Accumulator = typename std::tuple_element_t<52, ContainerOverSubrelations>;
437 auto tmp = in.get(C::tx_is_tree_padding) *
438 (in.get(C::tx_prev_num_note_hashes_emitted) - in.get(C::tx_next_num_note_hashes_emitted));
439 tmp *= scaling_factor;
440 std::get<52>(evals) += typename Accumulator::View(tmp);
441 }
442 { // NULLIFIER_TREE_ROOT_IMMUTABLE_IN_PADDING
443 using Accumulator = typename std::tuple_element_t<53, ContainerOverSubrelations>;
444 auto tmp = in.get(C::tx_is_tree_padding) *
445 (in.get(C::tx_prev_nullifier_tree_root) - in.get(C::tx_next_nullifier_tree_root));
446 tmp *= scaling_factor;
447 std::get<53>(evals) += typename Accumulator::View(tmp);
448 }
449 { // PAD_NULLIFIER_TREE
450 using Accumulator = typename std::tuple_element_t<54, ContainerOverSubrelations>;
451 auto tmp = in.get(C::tx_is_tree_padding) *
452 (((in.get(C::tx_prev_nullifier_tree_size) + constants_MAX_NULLIFIERS_PER_TX) -
453 in.get(C::tx_prev_num_nullifiers_emitted)) -
454 in.get(C::tx_next_nullifier_tree_size));
455 tmp *= scaling_factor;
456 std::get<54>(evals) += typename Accumulator::View(tmp);
457 }
458 { // NULLIFIERS_EMITTED_IMMUTABLE_IN_PADDING
459 using Accumulator = typename std::tuple_element_t<55, ContainerOverSubrelations>;
460 auto tmp = in.get(C::tx_is_tree_padding) *
461 (in.get(C::tx_prev_num_nullifiers_emitted) - in.get(C::tx_next_num_nullifiers_emitted));
462 tmp *= scaling_factor;
463 std::get<55>(evals) += typename Accumulator::View(tmp);
464 }
465}
466
467} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
Definition tx_impl.hpp:10
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.