Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tx_context_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 tx_contextImpl<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_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX = FF(19);
19 const auto constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX = FF(20);
20 const auto constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX = FF(21);
21 const auto constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX = FF(22);
22 const auto constants_AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX = FF(23);
23 const auto constants_AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX = FF(24);
24 const auto constants_AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX = FF(25);
25 const auto constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX = FF(377);
26 const auto constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX = FF(378);
27 const auto constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX = FF(379);
28 const auto constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX = FF(380);
29 const auto constants_AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX = FF(381);
30 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX = FF(382);
31 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX = FF(383);
32 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX = FF(384);
33 const auto constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX = FF(522);
34 const auto constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT =
35 FF(uint256_t{ 18071747219918308973UL, 16614632998898105071UL, 15723772623334795496UL, 2914032580688149866UL });
36 const auto constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE = FF(1);
37 const auto constants_AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT =
38 FF(uint256_t{ 17709766335633262877UL, 1850405195690305185UL, 13873207743118759083UL, 1156198508456480057UL });
39 const auto constants_AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE = FF(1);
40 const auto tx_NOT_LAST_ROW = in.get(C::tx_sel) * in.get(C::tx_sel_shift);
41 const auto tx_NOT_LAST = in.get(C::tx_sel_shift) * in.get(C::tx_sel);
42
43 {
44 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
45 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
46 (CView(constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX) -
47 static_cast<View>(in.get(C::tx_note_hash_pi_offset)));
48 std::get<0>(evals) += (tmp * scaling_factor);
49 }
50 {
51 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
52 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
53 (CView(constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX) -
54 static_cast<View>(in.get(C::tx_note_hash_pi_offset)));
55 std::get<1>(evals) += (tmp * scaling_factor);
56 }
57 {
58 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
59 auto tmp = (static_cast<View>(in.get(C::tx_should_read_note_hash_tree)) -
60 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_cleanup))));
61 std::get<2>(evals) += (tmp * scaling_factor);
62 }
63 {
64 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
65 auto tmp =
66 static_cast<View>(in.get(C::tx_start_tx)) * static_cast<View>(in.get(C::tx_prev_num_note_hashes_emitted));
67 std::get<3>(evals) += (tmp * scaling_factor);
68 }
69 {
70 using View = typename std::tuple_element_t<4, ContainerOverSubrelations>::View;
71 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
72 (CView(constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX) -
73 static_cast<View>(in.get(C::tx_nullifier_pi_offset)));
74 std::get<4>(evals) += (tmp * scaling_factor);
75 }
76 {
77 using View = typename std::tuple_element_t<5, ContainerOverSubrelations>::View;
78 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
79 (CView(constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX) -
80 static_cast<View>(in.get(C::tx_nullifier_pi_offset)));
81 std::get<5>(evals) += (tmp * scaling_factor);
82 }
83 {
84 using View = typename std::tuple_element_t<6, ContainerOverSubrelations>::View;
85 auto tmp = (static_cast<View>(in.get(C::tx_should_read_nullifier_tree)) -
86 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_cleanup))));
87 std::get<6>(evals) += (tmp * scaling_factor);
88 }
89 {
90 using View = typename std::tuple_element_t<7, ContainerOverSubrelations>::View;
91 auto tmp =
92 static_cast<View>(in.get(C::tx_start_tx)) * static_cast<View>(in.get(C::tx_prev_num_nullifiers_emitted));
93 std::get<7>(evals) += (tmp * scaling_factor);
94 }
95 {
96 using View = typename std::tuple_element_t<8, ContainerOverSubrelations>::View;
97 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
98 (CView(constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX) -
99 static_cast<View>(in.get(C::tx_public_data_pi_offset)));
100 std::get<8>(evals) += (tmp * scaling_factor);
101 }
102 {
103 using View = typename std::tuple_element_t<9, ContainerOverSubrelations>::View;
104 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
105 (CView(constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX) -
106 static_cast<View>(in.get(C::tx_public_data_pi_offset)));
107 std::get<9>(evals) += (tmp * scaling_factor);
108 }
109 {
110 using View = typename std::tuple_element_t<10, ContainerOverSubrelations>::View;
111 auto tmp = (static_cast<View>(in.get(C::tx_should_read_public_data_tree)) -
112 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_cleanup))));
113 std::get<10>(evals) += (tmp * scaling_factor);
114 }
115 {
116 using View = typename std::tuple_element_t<11, ContainerOverSubrelations>::View;
117 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
118 (CView(constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT) -
119 static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_root)));
120 std::get<11>(evals) += (tmp * scaling_factor);
121 }
122 {
123 using View = typename std::tuple_element_t<12, ContainerOverSubrelations>::View;
124 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
125 (CView(constants_AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE) -
126 static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_size)));
127 std::get<12>(evals) += (tmp * scaling_factor);
128 }
129 {
130 using View = typename std::tuple_element_t<13, ContainerOverSubrelations>::View;
131 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
132 (CView(constants_AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX) -
133 static_cast<View>(in.get(C::tx_l1_l2_pi_offset)));
134 std::get<13>(evals) += (tmp * scaling_factor);
135 }
136 {
137 using View = typename std::tuple_element_t<14, ContainerOverSubrelations>::View;
138 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
139 (CView(constants_AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX) -
140 static_cast<View>(in.get(C::tx_l1_l2_pi_offset)));
141 std::get<14>(evals) += (tmp * scaling_factor);
142 }
143 {
144 using View = typename std::tuple_element_t<15, ContainerOverSubrelations>::View;
145 auto tmp = (static_cast<View>(in.get(C::tx_should_read_l1_l2_tree)) -
146 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_cleanup))));
147 std::get<15>(evals) += (tmp * scaling_factor);
148 }
149 {
150 using View = typename std::tuple_element_t<16, ContainerOverSubrelations>::View;
151 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
152 (CView(constants_AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT) -
153 static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_root)));
154 std::get<16>(evals) += (tmp * scaling_factor);
155 }
156 {
157 using View = typename std::tuple_element_t<17, ContainerOverSubrelations>::View;
158 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
159 (CView(constants_AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE) -
160 static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_size)));
161 std::get<17>(evals) += (tmp * scaling_factor);
162 }
163 {
164 using View = typename std::tuple_element_t<18, ContainerOverSubrelations>::View;
165 auto tmp =
166 static_cast<View>(in.get(C::tx_start_tx)) * (CView(constants_AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX) -
167 static_cast<View>(in.get(C::tx_gas_used_pi_offset)));
168 std::get<18>(evals) += (tmp * scaling_factor);
169 }
170 {
171 using View = typename std::tuple_element_t<19, ContainerOverSubrelations>::View;
172 auto tmp =
173 static_cast<View>(in.get(C::tx_is_cleanup)) * (CView(constants_AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX) -
174 static_cast<View>(in.get(C::tx_gas_used_pi_offset)));
175 std::get<19>(evals) += (tmp * scaling_factor);
176 }
177 {
178 using View = typename std::tuple_element_t<20, ContainerOverSubrelations>::View;
179 auto tmp = (static_cast<View>(in.get(C::tx_should_read_gas_used)) -
180 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_cleanup))));
181 std::get<20>(evals) += (tmp * scaling_factor);
182 }
183 {
184 using View = typename std::tuple_element_t<21, ContainerOverSubrelations>::View;
185 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
186 (CView(constants_AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX) -
187 static_cast<View>(in.get(C::tx_gas_limit_pi_offset)));
188 std::get<21>(evals) += (tmp * scaling_factor);
189 }
190 {
191 using View = typename std::tuple_element_t<22, ContainerOverSubrelations>::View;
192 auto tmp = static_cast<View>(in.get(C::tx_is_teardown_phase)) *
193 (CView(constants_AVM_PUBLIC_INPUTS_GAS_SETTINGS_TEARDOWN_GAS_LIMITS_ROW_IDX) -
194 static_cast<View>(in.get(C::tx_gas_limit_pi_offset)));
195 std::get<22>(evals) += (tmp * scaling_factor);
196 }
197 {
198 using View = typename std::tuple_element_t<23, ContainerOverSubrelations>::View;
199 auto tmp = (static_cast<View>(in.get(C::tx_should_read_gas_limit)) -
200 (static_cast<View>(in.get(C::tx_start_tx)) + static_cast<View>(in.get(C::tx_is_teardown_phase))));
201 std::get<23>(evals) += (tmp * scaling_factor);
202 }
203 {
204 using View = typename std::tuple_element_t<24, ContainerOverSubrelations>::View;
205 auto tmp = static_cast<View>(in.get(C::tx_start_tx)) *
206 static_cast<View>(in.get(C::tx_prev_num_unencrypted_log_fields));
207 std::get<24>(evals) += (tmp * scaling_factor);
208 }
209 {
210 using View = typename std::tuple_element_t<25, ContainerOverSubrelations>::View;
211 auto tmp =
212 static_cast<View>(in.get(C::tx_start_tx)) * static_cast<View>(in.get(C::tx_prev_num_l2_to_l1_messages));
213 std::get<25>(evals) += (tmp * scaling_factor);
214 }
215 { // NOTE_HASH_ROOT_CONTINUITY
216 using View = typename std::tuple_element_t<26, ContainerOverSubrelations>::View;
217 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
218 (static_cast<View>(in.get(C::tx_next_note_hash_tree_root)) -
219 static_cast<View>(in.get(C::tx_prev_note_hash_tree_root_shift)));
220 std::get<26>(evals) += (tmp * scaling_factor);
221 }
222 { // NOTE_HASH_TREE_SIZE_CONTINUITY
223 using View = typename std::tuple_element_t<27, ContainerOverSubrelations>::View;
224 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
225 (static_cast<View>(in.get(C::tx_next_note_hash_tree_size)) -
226 static_cast<View>(in.get(C::tx_prev_note_hash_tree_size_shift)));
227 std::get<27>(evals) += (tmp * scaling_factor);
228 }
229 { // NUM_NOTE_HASHES_EMITTED_CONTINUITY
230 using View = typename std::tuple_element_t<28, ContainerOverSubrelations>::View;
231 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
232 (static_cast<View>(in.get(C::tx_next_num_note_hashes_emitted)) -
233 static_cast<View>(in.get(C::tx_prev_num_note_hashes_emitted_shift)));
234 std::get<28>(evals) += (tmp * scaling_factor);
235 }
236 { // NULLIFIER_TREE_ROOT_CONTINUITY
237 using View = typename std::tuple_element_t<29, ContainerOverSubrelations>::View;
238 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
239 (static_cast<View>(in.get(C::tx_next_nullifier_tree_root)) -
240 static_cast<View>(in.get(C::tx_prev_nullifier_tree_root_shift)));
241 std::get<29>(evals) += (tmp * scaling_factor);
242 }
243 { // NULLIFIER_TREE_SIZE_CONTINUITY
244 using View = typename std::tuple_element_t<30, ContainerOverSubrelations>::View;
245 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
246 (static_cast<View>(in.get(C::tx_next_nullifier_tree_size)) -
247 static_cast<View>(in.get(C::tx_prev_nullifier_tree_size_shift)));
248 std::get<30>(evals) += (tmp * scaling_factor);
249 }
250 { // NUM_NULLIFIERS_EMITTED_CONTINUITY
251 using View = typename std::tuple_element_t<31, ContainerOverSubrelations>::View;
252 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
253 (static_cast<View>(in.get(C::tx_next_num_nullifiers_emitted)) -
254 static_cast<View>(in.get(C::tx_prev_num_nullifiers_emitted_shift)));
255 std::get<31>(evals) += (tmp * scaling_factor);
256 }
257 { // PUBLIC_DATA_TREE_ROOT_CONTINUITY
258 using View = typename std::tuple_element_t<32, ContainerOverSubrelations>::View;
259 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
260 (static_cast<View>(in.get(C::tx_next_public_data_tree_root)) -
261 static_cast<View>(in.get(C::tx_prev_public_data_tree_root_shift)));
262 std::get<32>(evals) += (tmp * scaling_factor);
263 }
264 { // PUBLIC_DATA_TREE_SIZE_CONTINUITY
265 using View = typename std::tuple_element_t<33, ContainerOverSubrelations>::View;
266 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
267 (static_cast<View>(in.get(C::tx_next_public_data_tree_size)) -
268 static_cast<View>(in.get(C::tx_prev_public_data_tree_size_shift)));
269 std::get<33>(evals) += (tmp * scaling_factor);
270 }
271 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_CONTINUITY
272 using View = typename std::tuple_element_t<34, ContainerOverSubrelations>::View;
273 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
274 (static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_root)) -
275 static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_root_shift)));
276 std::get<34>(evals) += (tmp * scaling_factor);
277 }
278 { // WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_CONTINUITY
279 using View = typename std::tuple_element_t<35, ContainerOverSubrelations>::View;
280 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
281 (static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_size)) -
282 static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_size_shift)));
283 std::get<35>(evals) += (tmp * scaling_factor);
284 }
285 { // L1_L2_TREE_ROOT_CONTINUITY
286 using View = typename std::tuple_element_t<36, ContainerOverSubrelations>::View;
287 auto tmp = CView(tx_NOT_LAST_ROW) * (static_cast<View>(in.get(C::tx_l1_l2_tree_root)) -
288 static_cast<View>(in.get(C::tx_l1_l2_tree_root_shift)));
289 std::get<36>(evals) += (tmp * scaling_factor);
290 }
291 { // RETRIEVED_BYTECODES_TREE_ROOT_CONTINUITY
292 using View = typename std::tuple_element_t<37, ContainerOverSubrelations>::View;
293 auto tmp = CView(tx_NOT_LAST_ROW) * (static_cast<View>(in.get(C::tx_next_retrieved_bytecodes_tree_root)) -
294 static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_root_shift)));
295 std::get<37>(evals) += (tmp * scaling_factor);
296 }
297 { // RETRIEVED_BYTECODES_TREE_SIZE_CONTINUITY
298 using View = typename std::tuple_element_t<38, ContainerOverSubrelations>::View;
299 auto tmp = CView(tx_NOT_LAST_ROW) * (static_cast<View>(in.get(C::tx_next_retrieved_bytecodes_tree_size)) -
300 static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_size_shift)));
301 std::get<38>(evals) += (tmp * scaling_factor);
302 }
303 { // NUM_UNENCRYPTED_LOGS_CONTINUITY
304 using View = typename std::tuple_element_t<39, ContainerOverSubrelations>::View;
305 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
306 (static_cast<View>(in.get(C::tx_next_num_unencrypted_log_fields)) -
307 static_cast<View>(in.get(C::tx_prev_num_unencrypted_log_fields_shift)));
308 std::get<39>(evals) += (tmp * scaling_factor);
309 }
310 { // NUM_L2_TO_L1_MESSAGES_CONTINUITY
311 using View = typename std::tuple_element_t<40, ContainerOverSubrelations>::View;
312 auto tmp = CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_reverted))) *
313 (static_cast<View>(in.get(C::tx_next_num_l2_to_l1_messages)) -
314 static_cast<View>(in.get(C::tx_prev_num_l2_to_l1_messages_shift)));
315 std::get<40>(evals) += (tmp * scaling_factor);
316 }
317 {
318 using View = typename std::tuple_element_t<41, ContainerOverSubrelations>::View;
319 auto tmp = static_cast<View>(in.get(C::tx_sel)) * (FF(4) - static_cast<View>(in.get(C::tx_setup_phase_value)));
320 std::get<41>(evals) += (tmp * scaling_factor);
321 }
322 { // PROPAGATE_L2_GAS_USED
323 using View = typename std::tuple_element_t<42, ContainerOverSubrelations>::View;
324 auto tmp = CView(tx_NOT_LAST_ROW) * (static_cast<View>(in.get(C::tx_next_l2_gas_used)) -
325 static_cast<View>(in.get(C::tx_prev_l2_gas_used_shift)));
326 std::get<42>(evals) += (tmp * scaling_factor);
327 }
328 { // PROPAGATE_DA_GAS_USED
329 using View = typename std::tuple_element_t<43, ContainerOverSubrelations>::View;
330 auto tmp = CView(tx_NOT_LAST_ROW) * (static_cast<View>(in.get(C::tx_next_da_gas_used)) -
331 static_cast<View>(in.get(C::tx_prev_da_gas_used_shift)));
332 std::get<43>(evals) += (tmp * scaling_factor);
333 }
334 { // PROPAGATE_L2_GAS_LIMIT
335 using View = typename std::tuple_element_t<44, ContainerOverSubrelations>::View;
336 auto tmp =
337 CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_is_teardown_phase_shift))) *
338 (static_cast<View>(in.get(C::tx_l2_gas_limit)) - static_cast<View>(in.get(C::tx_l2_gas_limit_shift)));
339 std::get<44>(evals) += (tmp * scaling_factor);
340 }
341 { // PROPAGATE_DA_GAS_LIMIT
342 using View = typename std::tuple_element_t<45, ContainerOverSubrelations>::View;
343 auto tmp =
344 CView(tx_NOT_LAST_ROW) * (FF(1) - static_cast<View>(in.get(C::tx_is_teardown_phase_shift))) *
345 (static_cast<View>(in.get(C::tx_da_gas_limit)) - static_cast<View>(in.get(C::tx_da_gas_limit_shift)));
346 std::get<45>(evals) += (tmp * scaling_factor);
347 }
348 { // NOTE_HASH_ROOT_IMMUTABILITY
349 using View = typename std::tuple_element_t<46, ContainerOverSubrelations>::View;
350 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
351 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_note_hash))) *
352 (static_cast<View>(in.get(C::tx_prev_note_hash_tree_root)) -
353 static_cast<View>(in.get(C::tx_next_note_hash_tree_root)));
354 std::get<46>(evals) += (tmp * scaling_factor);
355 }
356 { // NOTE_HASH_SIZE_IMMUTABILITY
357 using View = typename std::tuple_element_t<47, ContainerOverSubrelations>::View;
358 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
359 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_note_hash))) *
360 (static_cast<View>(in.get(C::tx_prev_note_hash_tree_size)) -
361 static_cast<View>(in.get(C::tx_next_note_hash_tree_size)));
362 std::get<47>(evals) += (tmp * scaling_factor);
363 }
364 { // NOTE_HASH_COUNT_IMMUTABILITY
365 using View = typename std::tuple_element_t<48, ContainerOverSubrelations>::View;
366 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
367 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_note_hash))) *
368 (static_cast<View>(in.get(C::tx_prev_num_note_hashes_emitted)) -
369 static_cast<View>(in.get(C::tx_next_num_note_hashes_emitted)));
370 std::get<48>(evals) += (tmp * scaling_factor);
371 }
372 { // NULLIFIER_ROOT_IMMUTABILITY
373 using View = typename std::tuple_element_t<49, ContainerOverSubrelations>::View;
374 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
375 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_nullifier))) *
376 (static_cast<View>(in.get(C::tx_prev_nullifier_tree_root)) -
377 static_cast<View>(in.get(C::tx_next_nullifier_tree_root)));
378 std::get<49>(evals) += (tmp * scaling_factor);
379 }
380 { // NULLIFIER_SIZE_IMMUTABILITY
381 using View = typename std::tuple_element_t<50, ContainerOverSubrelations>::View;
382 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
383 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_nullifier))) *
384 (static_cast<View>(in.get(C::tx_prev_nullifier_tree_size)) -
385 static_cast<View>(in.get(C::tx_next_nullifier_tree_size)));
386 std::get<50>(evals) += (tmp * scaling_factor);
387 }
388 { // NULLIFIER_COUNT_IMMUTABILITY
389 using View = typename std::tuple_element_t<51, ContainerOverSubrelations>::View;
390 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
391 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_nullifier))) *
392 (static_cast<View>(in.get(C::tx_prev_num_nullifiers_emitted)) -
393 static_cast<View>(in.get(C::tx_next_num_nullifiers_emitted)));
394 std::get<51>(evals) += (tmp * scaling_factor);
395 }
396 { // PUBLIC_DATA_ROOT_IMMUTABILITY
397 using View = typename std::tuple_element_t<52, ContainerOverSubrelations>::View;
398 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
399 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_write_public_data))) *
400 (static_cast<View>(in.get(C::tx_prev_public_data_tree_root)) -
401 static_cast<View>(in.get(C::tx_next_public_data_tree_root)));
402 std::get<52>(evals) += (tmp * scaling_factor);
403 }
404 { // PUBLIC_DATA_SIZE_IMMUTABILITY
405 using View = typename std::tuple_element_t<53, ContainerOverSubrelations>::View;
406 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
407 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_write_public_data))) *
408 (static_cast<View>(in.get(C::tx_prev_public_data_tree_size)) -
409 static_cast<View>(in.get(C::tx_next_public_data_tree_size)));
410 std::get<53>(evals) += (tmp * scaling_factor);
411 }
412 { // WRITTEN_PUBLIC_DATA_SLOTS_ROOT_IMMUTABILITY
413 using View = typename std::tuple_element_t<54, ContainerOverSubrelations>::View;
414 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
415 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_write_public_data))) *
416 (static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_root)) -
417 static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_root)));
418 std::get<54>(evals) += (tmp * scaling_factor);
419 }
420 { // WRITTEN_PUBLIC_DATA_SLOTS_SIZE_IMMUTABILITY
421 using View = typename std::tuple_element_t<55, ContainerOverSubrelations>::View;
422 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
423 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_write_public_data))) *
424 (static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_size)) -
425 static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_size)));
426 std::get<55>(evals) += (tmp * scaling_factor);
427 }
428 { // UNENCRYPTED_LOG_COUNT_IMMUTABILITY
429 using View = typename std::tuple_element_t<56, ContainerOverSubrelations>::View;
430 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
431 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_unencrypted_log))) *
432 (static_cast<View>(in.get(C::tx_prev_num_unencrypted_log_fields)) -
433 static_cast<View>(in.get(C::tx_next_num_unencrypted_log_fields)));
434 std::get<56>(evals) += (tmp * scaling_factor);
435 }
436 { // L2_TO_L1_MESSAGE_COUNT_IMMUTABILITY
437 using View = typename std::tuple_element_t<57, ContainerOverSubrelations>::View;
438 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
439 (FF(1) - static_cast<View>(in.get(C::tx_sel_can_emit_l2_l1_msg))) *
440 (static_cast<View>(in.get(C::tx_prev_num_l2_to_l1_messages)) -
441 static_cast<View>(in.get(C::tx_next_num_l2_to_l1_messages)));
442 std::get<57>(evals) += (tmp * scaling_factor);
443 }
444 { // RETRIEVED_BYTECODES_TREE_ROOT_IMMUTABILITY
445 using View = typename std::tuple_element_t<58, ContainerOverSubrelations>::View;
446 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
447 (FF(1) - static_cast<View>(in.get(C::tx_should_process_call_request))) *
448 (static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_root)) -
449 static_cast<View>(in.get(C::tx_next_retrieved_bytecodes_tree_root)));
450 std::get<58>(evals) += (tmp * scaling_factor);
451 }
452 { // RETRIEVED_BYTECODES_TREE_SIZE_IMMUTABILITY
453 using View = typename std::tuple_element_t<59, ContainerOverSubrelations>::View;
454 auto tmp = static_cast<View>(in.get(C::tx_sel)) *
455 (FF(1) - static_cast<View>(in.get(C::tx_should_process_call_request))) *
456 (static_cast<View>(in.get(C::tx_prev_retrieved_bytecodes_tree_size)) -
457 static_cast<View>(in.get(C::tx_next_retrieved_bytecodes_tree_size)));
458 std::get<59>(evals) += (tmp * scaling_factor);
459 }
460 { // NOTE_HASH_ROOT_PADDED_IMMUTABILITY
461 using View = typename std::tuple_element_t<60, ContainerOverSubrelations>::View;
462 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
463 (static_cast<View>(in.get(C::tx_prev_note_hash_tree_root)) -
464 static_cast<View>(in.get(C::tx_next_note_hash_tree_root)));
465 std::get<60>(evals) += (tmp * scaling_factor);
466 }
467 { // NOTE_HASH_SIZE_PADDED_IMMUTABILITY
468 using View = typename std::tuple_element_t<61, ContainerOverSubrelations>::View;
469 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
470 (static_cast<View>(in.get(C::tx_prev_note_hash_tree_size)) -
471 static_cast<View>(in.get(C::tx_next_note_hash_tree_size)));
472 std::get<61>(evals) += (tmp * scaling_factor);
473 }
474 { // NOTE_HASH_COUNT_PADDED_IMMUTABILITY
475 using View = typename std::tuple_element_t<62, ContainerOverSubrelations>::View;
476 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
477 (static_cast<View>(in.get(C::tx_prev_num_note_hashes_emitted)) -
478 static_cast<View>(in.get(C::tx_next_num_note_hashes_emitted)));
479 std::get<62>(evals) += (tmp * scaling_factor);
480 }
481 { // NULLIFIER_ROOT_PADDED_IMMUTABILITY
482 using View = typename std::tuple_element_t<63, ContainerOverSubrelations>::View;
483 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
484 (static_cast<View>(in.get(C::tx_prev_nullifier_tree_root)) -
485 static_cast<View>(in.get(C::tx_next_nullifier_tree_root)));
486 std::get<63>(evals) += (tmp * scaling_factor);
487 }
488 { // NULLIFIER_SIZE_PADDED_IMMUTABILITY
489 using View = typename std::tuple_element_t<64, ContainerOverSubrelations>::View;
490 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
491 (static_cast<View>(in.get(C::tx_prev_nullifier_tree_size)) -
492 static_cast<View>(in.get(C::tx_next_nullifier_tree_size)));
493 std::get<64>(evals) += (tmp * scaling_factor);
494 }
495 { // NULLIFIER_COUNT_PADDED_IMMUTABILITY
496 using View = typename std::tuple_element_t<65, ContainerOverSubrelations>::View;
497 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
498 (static_cast<View>(in.get(C::tx_prev_num_nullifiers_emitted)) -
499 static_cast<View>(in.get(C::tx_next_num_nullifiers_emitted)));
500 std::get<65>(evals) += (tmp * scaling_factor);
501 }
502 { // PUBLIC_DATA_ROOT_PADDED_IMMUTABILITY
503 using View = typename std::tuple_element_t<66, ContainerOverSubrelations>::View;
504 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
505 (static_cast<View>(in.get(C::tx_prev_public_data_tree_root)) -
506 static_cast<View>(in.get(C::tx_next_public_data_tree_root)));
507 std::get<66>(evals) += (tmp * scaling_factor);
508 }
509 { // PUBLIC_DATA_SIZE_PADDED_IMMUTABILITY
510 using View = typename std::tuple_element_t<67, ContainerOverSubrelations>::View;
511 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
512 (static_cast<View>(in.get(C::tx_prev_public_data_tree_size)) -
513 static_cast<View>(in.get(C::tx_next_public_data_tree_size)));
514 std::get<67>(evals) += (tmp * scaling_factor);
515 }
516 { // WRITTEN_PUBLIC_DATA_SLOTS_ROOT_PADDED_IMMUTABILITY
517 using View = typename std::tuple_element_t<68, ContainerOverSubrelations>::View;
518 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
519 (static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_root)) -
520 static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_root)));
521 std::get<68>(evals) += (tmp * scaling_factor);
522 }
523 { // WRITTEN_PUBLIC_DATA_SLOTS_SIZE_PADDED_IMMUTABILITY
524 using View = typename std::tuple_element_t<69, ContainerOverSubrelations>::View;
525 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
526 (static_cast<View>(in.get(C::tx_prev_written_public_data_slots_tree_size)) -
527 static_cast<View>(in.get(C::tx_next_written_public_data_slots_tree_size)));
528 std::get<69>(evals) += (tmp * scaling_factor);
529 }
530 { // UNENCRYPTED_LOG_COUNT_PADDED_IMMUTABILITY
531 using View = typename std::tuple_element_t<70, ContainerOverSubrelations>::View;
532 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
533 (static_cast<View>(in.get(C::tx_prev_num_unencrypted_log_fields)) -
534 static_cast<View>(in.get(C::tx_next_num_unencrypted_log_fields)));
535 std::get<70>(evals) += (tmp * scaling_factor);
536 }
537 { // L2_TO_L1_MESSAGE_COUNT_PADDED_IMMUTABILITY
538 using View = typename std::tuple_element_t<71, ContainerOverSubrelations>::View;
539 auto tmp = static_cast<View>(in.get(C::tx_sel)) * static_cast<View>(in.get(C::tx_is_padded)) *
540 (static_cast<View>(in.get(C::tx_prev_num_l2_to_l1_messages)) -
541 static_cast<View>(in.get(C::tx_next_num_l2_to_l1_messages)));
542 std::get<71>(evals) += (tmp * scaling_factor);
543 }
544 { // L2_GAS_USED_IMMUTABILITY
545 using View = typename std::tuple_element_t<72, ContainerOverSubrelations>::View;
546 auto tmp =
547 static_cast<View>(in.get(C::tx_sel)) *
548 (FF(1) - static_cast<View>(in.get(C::tx_should_process_call_request))) *
549 (static_cast<View>(in.get(C::tx_prev_l2_gas_used)) - static_cast<View>(in.get(C::tx_next_l2_gas_used)));
550 std::get<72>(evals) += (tmp * scaling_factor);
551 }
552 { // DA_GAS_USED_IMMUTABILITY
553 using View = typename std::tuple_element_t<73, ContainerOverSubrelations>::View;
554 auto tmp =
555 static_cast<View>(in.get(C::tx_sel)) *
556 (FF(1) - static_cast<View>(in.get(C::tx_should_process_call_request))) *
557 (static_cast<View>(in.get(C::tx_prev_da_gas_used)) - static_cast<View>(in.get(C::tx_next_da_gas_used)));
558 std::get<73>(evals) += (tmp * scaling_factor);
559 }
560 {
561 using View = typename std::tuple_element_t<74, ContainerOverSubrelations>::View;
562 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
563 (CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX) -
564 static_cast<View>(in.get(C::tx_array_length_note_hashes_pi_offset)));
565 std::get<74>(evals) += (tmp * scaling_factor);
566 }
567 {
568 using View = typename std::tuple_element_t<75, ContainerOverSubrelations>::View;
569 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
570 (CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX) -
571 static_cast<View>(in.get(C::tx_array_length_nullifiers_pi_offset)));
572 std::get<75>(evals) += (tmp * scaling_factor);
573 }
574 {
575 using View = typename std::tuple_element_t<76, ContainerOverSubrelations>::View;
576 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
577 (CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX) -
578 static_cast<View>(in.get(C::tx_array_length_l2_to_l1_messages_pi_offset)));
579 std::get<76>(evals) += (tmp * scaling_factor);
580 }
581 {
582 using View = typename std::tuple_element_t<77, ContainerOverSubrelations>::View;
583 auto tmp = static_cast<View>(in.get(C::tx_is_cleanup)) *
584 (CView(constants_AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX) -
585 static_cast<View>(in.get(C::tx_fields_length_unencrypted_logs_pi_offset)));
586 std::get<77>(evals) += (tmp * scaling_factor);
587 }
588 { // NEXT_CONTEXT_ID_INITIAL_VALUE
589 using View = typename std::tuple_element_t<78, ContainerOverSubrelations>::View;
590 auto tmp =
591 static_cast<View>(in.get(C::tx_start_tx)) * (FF(1) - static_cast<View>(in.get(C::tx_next_context_id)));
592 std::get<78>(evals) += (tmp * scaling_factor);
593 }
594 { // NEXT_CONTEXT_ID_CONTINUITY
595 using View = typename std::tuple_element_t<79, ContainerOverSubrelations>::View;
596 auto tmp =
597 CView(tx_NOT_LAST) * (FF(1) - static_cast<View>(in.get(C::tx_should_process_call_request))) *
598 (static_cast<View>(in.get(C::tx_next_context_id_shift)) - static_cast<View>(in.get(C::tx_next_context_id)));
599 std::get<79>(evals) += (tmp * scaling_factor);
600 }
601}
602
603} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
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.