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