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