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