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