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