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