Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tx_context.test.cpp
Go to the documentation of this file.
1#include <gmock/gmock.h>
2#include <gtest/gtest.h>
3
4#include <cstdint>
5
20
21namespace bb::avm2::constraining {
22namespace {
23
24using testing::PublicInputsBuilder;
25using tracegen::PrecomputedTraceBuilder;
26using tracegen::PublicInputsTraceBuilder;
27using tracegen::TestTraceContainer;
28using tracegen::TxTraceBuilder;
29
31using C = Column;
32using tx = bb::avm2::tx<FF>;
33using tx_context = bb::avm2::tx_context<FF>;
34
35TEST(TxContextConstrainingTest, Continuity)
36{
37 TestTraceContainer trace({
38 {
39 // Row 0: end of setup
40 { C::tx_sel, 1 },
41 { C::tx_reverted, 0 },
42 { C::tx_next_note_hash_tree_root, 1 },
43 { C::tx_next_note_hash_tree_size, 2 },
44 { C::tx_next_num_note_hashes_emitted, 3 },
45 { C::tx_next_nullifier_tree_root, 4 },
46 { C::tx_next_nullifier_tree_size, 5 },
47 { C::tx_next_num_nullifiers_emitted, 6 },
48 { C::tx_next_public_data_tree_root, 7 },
49 { C::tx_next_public_data_tree_size, 8 },
50 { C::tx_next_written_public_data_slots_tree_root, 9 },
51 { C::tx_next_written_public_data_slots_tree_size, 10 },
52 { C::tx_l1_l2_tree_root, 11 },
53 { C::tx_next_retrieved_bytecodes_tree_root, 12 },
54 { C::tx_next_retrieved_bytecodes_tree_size, 13 },
55 { C::tx_next_num_unencrypted_log_fields, 14 },
56 { C::tx_next_num_l2_to_l1_messages, 15 },
57 },
58 {
59 // Row 1: app logic, reverts
60 { C::tx_sel, 1 },
61 { C::tx_reverted, 1 },
62 { C::tx_prev_note_hash_tree_root, 1 },
63 { C::tx_prev_note_hash_tree_size, 2 },
64 { C::tx_prev_num_note_hashes_emitted, 3 },
65 { C::tx_prev_nullifier_tree_root, 4 },
66 { C::tx_prev_nullifier_tree_size, 5 },
67 { C::tx_prev_num_nullifiers_emitted, 6 },
68 { C::tx_prev_public_data_tree_root, 7 },
69 { C::tx_prev_public_data_tree_size, 8 },
70 { C::tx_prev_written_public_data_slots_tree_root, 9 },
71 { C::tx_prev_written_public_data_slots_tree_size, 10 },
72 { C::tx_l1_l2_tree_root, 11 },
73 { C::tx_prev_retrieved_bytecodes_tree_root, 12 },
74 { C::tx_prev_retrieved_bytecodes_tree_size, 13 },
75 { C::tx_prev_num_unencrypted_log_fields, 14 },
76 { C::tx_prev_num_l2_to_l1_messages, 15 },
77 { C::tx_next_note_hash_tree_root, 10 },
78 { C::tx_next_note_hash_tree_size, 20 },
79 { C::tx_next_num_note_hashes_emitted, 30 },
80 { C::tx_next_nullifier_tree_root, 40 },
81 { C::tx_next_nullifier_tree_size, 50 },
82 { C::tx_next_num_nullifiers_emitted, 60 },
83 { C::tx_next_public_data_tree_root, 70 },
84 { C::tx_next_public_data_tree_size, 80 },
85 { C::tx_next_written_public_data_slots_tree_root, 90 },
86 { C::tx_next_written_public_data_slots_tree_size, 100 },
87 { C::tx_next_retrieved_bytecodes_tree_root, 120 },
88 { C::tx_next_retrieved_bytecodes_tree_size, 130 },
89 { C::tx_next_num_unencrypted_log_fields, 140 },
90 { C::tx_next_num_l2_to_l1_messages, 150 },
91 },
92 {
93 // Row 2: restored end of setup state
94 { C::tx_sel, 1 },
95 { C::tx_reverted, 0 },
96 { C::tx_prev_note_hash_tree_root, 1 },
97 { C::tx_prev_note_hash_tree_size, 2 },
98 { C::tx_prev_num_note_hashes_emitted, 3 },
99 { C::tx_prev_nullifier_tree_root, 4 },
100 { C::tx_prev_nullifier_tree_size, 5 },
101 { C::tx_prev_num_nullifiers_emitted, 6 },
102 { C::tx_prev_public_data_tree_root, 7 },
103 { C::tx_prev_public_data_tree_size, 8 },
104 { C::tx_prev_written_public_data_slots_tree_root, 9 },
105 { C::tx_prev_written_public_data_slots_tree_size, 10 },
106 { C::tx_l1_l2_tree_root, 11 },
107 { C::tx_prev_retrieved_bytecodes_tree_root, 120 },
108 { C::tx_prev_retrieved_bytecodes_tree_size, 130 },
109 { C::tx_prev_num_unencrypted_log_fields, 14 },
110 { C::tx_prev_num_l2_to_l1_messages, 15 },
111 },
112 });
113
114 check_relation<tx_context>(trace,
130
131 // Negative test: if not reverted, it shouldn't be able to rollback state from row 1 to row 2
132
133 trace.set(C::tx_reverted, 1, 0);
134
136 "NOTE_HASH_ROOT_CONTINUITY");
138 "NOTE_HASH_TREE_SIZE_CONTINUITY");
140 "NUM_NOTE_HASHES_EMITTED_CONTINUITY");
142 "NULLIFIER_TREE_ROOT_CONTINUITY");
144 "NULLIFIER_TREE_SIZE_CONTINUITY");
146 "NUM_NULLIFIERS_EMITTED_CONTINUITY");
148 "PUBLIC_DATA_TREE_ROOT_CONTINUITY");
150 "PUBLIC_DATA_TREE_SIZE_CONTINUITY");
153 "WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_CONTINUITY");
156 "WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_CONTINUITY");
158 "NUM_UNENCRYPTED_LOGS_CONTINUITY");
160 "NUM_L2_TO_L1_MESSAGES_CONTINUITY");
161
162 // Negative test: l1 to l2 root should not change
163
164 trace.set(C::tx_l1_l2_tree_root, 1, 20);
165
167 "L1_L2_TREE_ROOT_CONTINUITY");
168
169 // Negative test: even in reverts, retrieved bytecodes tree root and size should not change
170 trace.set(C::tx_prev_retrieved_bytecodes_tree_root, 2, 12);
171 trace.set(C::tx_prev_retrieved_bytecodes_tree_size, 2, 13);
172
175 "RETRIEVED_BYTECODES_TREE_ROOT_CONTINUITY");
178 "RETRIEVED_BYTECODES_TREE_SIZE_CONTINUITY");
179}
180
181TEST(TxContextConstrainingTest, StateMutability)
182{
183 TestTraceContainer trace({
184 {
185 { C::tx_sel, 1 },
186 { C::tx_sel_can_emit_note_hash, 1 },
187 { C::tx_sel_can_emit_nullifier, 1 },
188 { C::tx_sel_can_write_public_data, 1 },
189 { C::tx_sel_can_emit_unencrypted_log, 1 },
190 { C::tx_sel_can_emit_l2_l1_msg, 1 },
191 { C::tx_should_process_call_request, 1 },
192 { C::tx_prev_note_hash_tree_root, 1 },
193 { C::tx_prev_note_hash_tree_size, 2 },
194 { C::tx_prev_num_note_hashes_emitted, 3 },
195 { C::tx_prev_nullifier_tree_root, 4 },
196 { C::tx_prev_nullifier_tree_size, 5 },
197 { C::tx_prev_num_nullifiers_emitted, 6 },
198 { C::tx_prev_public_data_tree_root, 7 },
199 { C::tx_prev_public_data_tree_size, 8 },
200 { C::tx_prev_written_public_data_slots_tree_root, 9 },
201 { C::tx_prev_written_public_data_slots_tree_size, 10 },
202 { C::tx_l1_l2_tree_root, 11 },
203 { C::tx_prev_retrieved_bytecodes_tree_root, 12 },
204 { C::tx_prev_retrieved_bytecodes_tree_size, 13 },
205 { C::tx_prev_num_unencrypted_log_fields, 13 },
206 { C::tx_prev_num_l2_to_l1_messages, 14 },
207 { C::tx_next_note_hash_tree_root, 10 },
208 { C::tx_next_note_hash_tree_size, 20 },
209 { C::tx_next_num_note_hashes_emitted, 30 },
210 { C::tx_next_nullifier_tree_root, 40 },
211 { C::tx_next_nullifier_tree_size, 50 },
212 { C::tx_next_num_nullifiers_emitted, 60 },
213 { C::tx_next_public_data_tree_root, 70 },
214 { C::tx_next_public_data_tree_size, 80 },
215 { C::tx_next_written_public_data_slots_tree_root, 90 },
216 { C::tx_next_written_public_data_slots_tree_size, 100 },
217 { C::tx_l1_l2_tree_root, 110 },
218 { C::tx_next_retrieved_bytecodes_tree_root, 120 },
219 { C::tx_next_retrieved_bytecodes_tree_size, 130 },
220 { C::tx_next_num_unencrypted_log_fields, 140 },
221 { C::tx_next_num_l2_to_l1_messages, 150 },
222 },
223 });
224
225 check_relation<tx_context>(trace,
240
241 // Negative test: immutability check on note hashes
242 trace.set(C::tx_sel_can_emit_note_hash, 0, 0);
243
245 "NOTE_HASH_ROOT_IMMUTABILITY");
247 "NOTE_HASH_SIZE_IMMUTABILITY");
249 "NOTE_HASH_COUNT_IMMUTABILITY");
250
251 // Negative test: immutability check on nullifiers
252 trace.set(C::tx_sel_can_emit_nullifier, 0, 0);
253
255 "NULLIFIER_ROOT_IMMUTABILITY");
257 "NULLIFIER_SIZE_IMMUTABILITY");
259 "NULLIFIER_COUNT_IMMUTABILITY");
260
261 // Negative test: immutability check on public data
262 trace.set(C::tx_sel_can_write_public_data, 0, 0);
263
265 "PUBLIC_DATA_ROOT_IMMUTABILITY");
267 "PUBLIC_DATA_SIZE_IMMUTABILITY");
270 "WRITTEN_PUBLIC_DATA_SLOTS_ROOT_IMMUTABILITY");
273 "WRITTEN_PUBLIC_DATA_SLOTS_SIZE_IMMUTABILITY");
274
275 // Negative test: immutability check on unencrypted logs
276 trace.set(C::tx_sel_can_emit_unencrypted_log, 0, 0);
277
279 "UNENCRYPTED_LOG_COUNT_IMMUTABILITY");
280
281 // Negative test: immutability check on l2 to l1 messages
282 trace.set(C::tx_sel_can_emit_l2_l1_msg, 0, 0);
283
285 "L2_TO_L1_MESSAGE_COUNT_IMMUTABILITY");
286
287 // Negative test: immutability check on retrieved bytecodes tree
288 trace.set(C::tx_should_process_call_request, 0, 0);
289
292 "RETRIEVED_BYTECODES_TREE_ROOT_IMMUTABILITY");
295 "RETRIEVED_BYTECODES_TREE_SIZE_IMMUTABILITY");
296
297 // Negative test: selectors enabled but it's a padded row
298 trace.set(C::tx_sel_can_emit_note_hash, 0, 1);
299 trace.set(C::tx_sel_can_emit_nullifier, 0, 1);
300 trace.set(C::tx_sel_can_write_public_data, 0, 1);
301 trace.set(C::tx_sel_can_emit_unencrypted_log, 0, 1);
302 trace.set(C::tx_is_padded, 0, 1);
303
305 "NOTE_HASH_ROOT_PADDED_IMMUTABILITY");
307 "NOTE_HASH_SIZE_PADDED_IMMUTABILITY");
309 "NOTE_HASH_COUNT_PADDED_IMMUTABILITY");
310
312 "NULLIFIER_ROOT_PADDED_IMMUTABILITY");
314 "NULLIFIER_SIZE_PADDED_IMMUTABILITY");
316 "NULLIFIER_COUNT_PADDED_IMMUTABILITY");
317
319 "PUBLIC_DATA_ROOT_PADDED_IMMUTABILITY");
321 "PUBLIC_DATA_SIZE_PADDED_IMMUTABILITY");
324 "WRITTEN_PUBLIC_DATA_SLOTS_ROOT_PADDED_IMMUTABILITY");
327 "WRITTEN_PUBLIC_DATA_SLOTS_SIZE_PADDED_IMMUTABILITY");
328
331 "UNENCRYPTED_LOG_COUNT_PADDED_IMMUTABILITY");
332
335 "L2_TO_L1_MESSAGE_COUNT_PADDED_IMMUTABILITY");
336}
337
338TEST(TxContextConstrainingTest, InitialStateChecks)
339{
340 Gas start_gas_used = { 1, 2 };
341 Gas gas_limit = { 1000, 2000 };
342 GasSettings gas_settings = { .gasLimits = gas_limit };
343 TreeSnapshots tree_snapshots = { .l1ToL2MessageTree = { .root = 20, .nextAvailableLeafIndex = 19 },
344 .noteHashTree = { .root = 21, .nextAvailableLeafIndex = 20 },
345 .nullifierTree = { .root = 22, .nextAvailableLeafIndex = 21 },
346 .publicDataTree = { .root = 23, .nextAvailableLeafIndex = 22 } };
347 auto public_inputs = PublicInputsBuilder()
348 .with_start_gas_used(start_gas_used)
349 .with_gas_settings(gas_settings)
350 .with_start_tree_snapshots(tree_snapshots)
351 .build();
352
353 TestTraceContainer trace({
354 {
355 // Row 0
356 { C::precomputed_first_row, 1 },
357 },
358 {
359 // Row 1
360 { C::tx_sel, 1 },
361 { C::tx_start_tx, 1 },
362 { C::tx_prev_note_hash_tree_root, tree_snapshots.noteHashTree.root },
363 { C::tx_prev_note_hash_tree_size, tree_snapshots.noteHashTree.nextAvailableLeafIndex },
364 { C::tx_prev_nullifier_tree_root, tree_snapshots.nullifierTree.root },
365 { C::tx_prev_nullifier_tree_size, tree_snapshots.nullifierTree.nextAvailableLeafIndex },
366 { C::tx_prev_public_data_tree_root, tree_snapshots.publicDataTree.root },
367 { C::tx_prev_public_data_tree_size, tree_snapshots.publicDataTree.nextAvailableLeafIndex },
368 { C::tx_prev_written_public_data_slots_tree_root, FF(AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT) },
369 { C::tx_prev_written_public_data_slots_tree_size, FF(AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE) },
370 { C::tx_prev_retrieved_bytecodes_tree_root, FF(AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT) },
371 { C::tx_prev_retrieved_bytecodes_tree_size, FF(AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE) },
372 { C::tx_l1_l2_tree_root, tree_snapshots.l1ToL2MessageTree.root },
373 { C::tx_prev_l2_gas_used, start_gas_used.l2Gas },
374 { C::tx_prev_da_gas_used, start_gas_used.daGas },
375 { C::tx_l2_gas_limit, gas_limit.l2Gas },
376 { C::tx_da_gas_limit, gas_limit.daGas },
377 { C::tx_prev_num_unencrypted_log_fields, 0 },
378 { C::tx_prev_num_l2_to_l1_messages, 0 },
380 { C::tx_should_read_note_hash_tree, 1 },
382 { C::tx_should_read_nullifier_tree, 1 },
384 { C::tx_should_read_public_data_tree, 1 },
386 { C::tx_should_read_l1_l2_tree, 1 },
387 { C::tx_gas_used_pi_offset, FF(AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX) },
388 { C::tx_should_read_gas_used, 1 },
389 { C::tx_gas_limit_pi_offset, FF(AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX) },
390 { C::tx_should_read_gas_limit, 1 },
391 { C::tx_next_note_hash_tree_root, tree_snapshots.noteHashTree.root },
392 { C::tx_next_note_hash_tree_size, tree_snapshots.noteHashTree.nextAvailableLeafIndex },
393 { C::tx_next_nullifier_tree_root, tree_snapshots.nullifierTree.root },
394 { C::tx_next_nullifier_tree_size, tree_snapshots.nullifierTree.nextAvailableLeafIndex },
395 { C::tx_next_public_data_tree_root, tree_snapshots.publicDataTree.root },
396 { C::tx_next_public_data_tree_size, tree_snapshots.publicDataTree.nextAvailableLeafIndex },
397 { C::tx_next_written_public_data_slots_tree_root, FF(AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT) },
398 { C::tx_next_written_public_data_slots_tree_size, FF(AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE) },
399 { C::tx_next_retrieved_bytecodes_tree_root, FF(AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT) },
400 { C::tx_next_retrieved_bytecodes_tree_size, FF(AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE) },
401 { C::tx_next_l2_gas_used, start_gas_used.l2Gas },
402 { C::tx_next_da_gas_used, start_gas_used.daGas },
403 { C::tx_setup_phase_value, static_cast<uint8_t>(TransactionPhase::SETUP) },
404 { C::tx_next_context_id, 1 },
405 },
406 });
407
408 PublicInputsTraceBuilder public_inputs_builder;
409 public_inputs_builder.process_public_inputs(trace, public_inputs);
410 public_inputs_builder.process_public_inputs_aux_precomputed(trace);
411
412 PrecomputedTraceBuilder precomputed_builder;
414
415 check_relation<tx_context>(trace);
416 // All tx_context interactions
417 check_interaction<TxTraceBuilder,
429}
430
431TEST(TxContextConstrainingTest, EndStateChecks)
432{
433 Gas end_gas_used = { 1, 2 };
434 TreeSnapshots tree_snapshots = { .l1ToL2MessageTree = { .root = 20, .nextAvailableLeafIndex = 19 },
435 .noteHashTree = { .root = 21, .nextAvailableLeafIndex = 20 },
436 .nullifierTree = { .root = 22, .nextAvailableLeafIndex = 21 },
437 .publicDataTree = { .root = 23, .nextAvailableLeafIndex = 22 } };
438 AvmAccumulatedDataArrayLengths array_lengths = { .noteHashes = 10, .nullifiers = 11, .l2ToL1Msgs = 12 };
439
440 PublicLog log = {
441 .fields = { FF(4), FF(5) },
442 .contractAddress = 11223,
443 };
444 PublicLogs public_logs = {};
445 public_logs.add_log(log);
446 AvmAccumulatedData accumulated_data = { .publicLogs = public_logs };
447
448 auto public_inputs = PublicInputsBuilder()
449 .set_end_gas_used(end_gas_used)
450 .set_end_tree_snapshots(tree_snapshots)
451 .set_accumulated_data_array_lengths(array_lengths)
452 .set_accumulated_data(accumulated_data)
453 .build();
454
455 TestTraceContainer trace({
456 {
457 // Row 0
458 { C::precomputed_first_row, 1 },
459 },
460 {
461 // Row 1
462 { C::tx_sel, 1 },
463 { C::tx_is_cleanup, 1 },
464 { C::tx_prev_note_hash_tree_root, tree_snapshots.noteHashTree.root },
465 { C::tx_prev_note_hash_tree_size, tree_snapshots.noteHashTree.nextAvailableLeafIndex },
466 { C::tx_prev_num_note_hashes_emitted, array_lengths.noteHashes },
467 { C::tx_prev_nullifier_tree_root, tree_snapshots.nullifierTree.root },
468 { C::tx_prev_nullifier_tree_size, tree_snapshots.nullifierTree.nextAvailableLeafIndex },
469 { C::tx_prev_num_nullifiers_emitted, array_lengths.nullifiers },
470 { C::tx_prev_public_data_tree_root, tree_snapshots.publicDataTree.root },
471 { C::tx_prev_public_data_tree_size, tree_snapshots.publicDataTree.nextAvailableLeafIndex },
472 { C::tx_l1_l2_tree_root, tree_snapshots.l1ToL2MessageTree.root },
473 { C::tx_prev_l2_gas_used, end_gas_used.l2Gas },
474 { C::tx_prev_da_gas_used, end_gas_used.daGas },
475 { C::tx_prev_num_unencrypted_log_fields, public_logs.length },
476 { C::tx_prev_num_l2_to_l1_messages, array_lengths.l2ToL1Msgs },
478 { C::tx_should_read_note_hash_tree, 1 },
480 { C::tx_should_read_nullifier_tree, 1 },
482 { C::tx_should_read_public_data_tree, 1 },
484 { C::tx_should_read_l1_l2_tree, 1 },
485 { C::tx_gas_used_pi_offset, FF(AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX) },
486 { C::tx_should_read_gas_used, 1 },
487 { C::tx_array_length_note_hashes_pi_offset,
489 { C::tx_array_length_nullifiers_pi_offset,
491 { C::tx_array_length_l2_to_l1_messages_pi_offset,
493 { C::tx_fields_length_unencrypted_logs_pi_offset,
495 { C::tx_next_note_hash_tree_root, tree_snapshots.noteHashTree.root },
496 { C::tx_next_note_hash_tree_size, tree_snapshots.noteHashTree.nextAvailableLeafIndex },
497 { C::tx_next_num_note_hashes_emitted, array_lengths.noteHashes },
498 { C::tx_next_nullifier_tree_root, tree_snapshots.nullifierTree.root },
499 { C::tx_next_nullifier_tree_size, tree_snapshots.nullifierTree.nextAvailableLeafIndex },
500 { C::tx_next_num_nullifiers_emitted, array_lengths.nullifiers },
501 { C::tx_next_public_data_tree_root, tree_snapshots.publicDataTree.root },
502 { C::tx_next_public_data_tree_size, tree_snapshots.publicDataTree.nextAvailableLeafIndex },
503 { C::tx_next_l2_gas_used, end_gas_used.l2Gas },
504 { C::tx_next_da_gas_used, end_gas_used.daGas },
505 { C::tx_next_num_unencrypted_log_fields, public_logs.length },
506 { C::tx_next_num_l2_to_l1_messages, array_lengths.l2ToL1Msgs },
507 { C::tx_setup_phase_value, static_cast<uint8_t>(TransactionPhase::SETUP) },
508 },
509 });
510
511 PublicInputsTraceBuilder public_inputs_builder;
512 public_inputs_builder.process_public_inputs(trace, public_inputs);
513 public_inputs_builder.process_public_inputs_aux_precomputed(trace);
514
515 PrecomputedTraceBuilder precomputed_builder;
517
518 check_relation<tx_context>(trace);
519 // All tx_context interactions
520 check_interaction<TxTraceBuilder,
532}
533
534TEST(TxContextConstrainingTest, NegativeContextIdChecks)
535{
536 TestTraceContainer trace({
537 {
538 // Row 0
539 { C::precomputed_first_row, 1 },
540 },
541 {
542 // Row 1
543 { C::tx_sel, 1 },
544 { C::tx_start_tx, 1 },
545 { C::tx_next_context_id, 1 },
546 },
547 {
548 // Row 2
549 { C::tx_sel, 1 },
550 { C::tx_next_context_id, 1 },
551 { C::tx_should_process_call_request, 1 },
552 },
553 {
554 // Row 3
555 { C::tx_sel, 1 },
556 { C::tx_next_context_id, 5 },
557 },
558 });
559 check_relation<tx_context>(
561
562 // Negative test: initial context id should be 1
563 trace.set(C::tx_next_context_id, 1, 2);
565 "NEXT_CONTEXT_ID_INITIAL_VALUE");
566
567 // Negative test: continuity check
568 trace.set(C::tx_next_context_id, 2, 42);
570 "NEXT_CONTEXT_ID_CONTINUITY");
571}
572
573} // namespace
574} // namespace bb::avm2::constraining
#define AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX
#define AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX
#define AVM_RETRIEVED_BYTECODES_TREE_INITIAL_ROOT
#define AVM_RETRIEVED_BYTECODES_TREE_INITIAL_SIZE
#define AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX
#define AVM_PUBLIC_INPUTS_END_GAS_USED_ROW_IDX
#define AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX
#define AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_L1_TO_L2_MESSAGE_TREE_ROW_IDX
#define AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT
#define AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX
#define AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_NOTE_HASH_TREE_ROW_IDX
#define AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_SIZE
#define AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX
#define AVM_PUBLIC_INPUTS_START_TREE_SNAPSHOTS_NULLIFIER_TREE_ROW_IDX
#define AVM_PUBLIC_INPUTS_START_GAS_USED_ROW_IDX
#define AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX
#define AVM_PUBLIC_INPUTS_GAS_SETTINGS_GAS_LIMITS_ROW_IDX
#define AVM_PUBLIC_INPUTS_END_TREE_SNAPSHOTS_PUBLIC_DATA_TREE_ROW_IDX
void process_misc(TraceContainer &trace, const uint32_t num_rows=MAX_AVM_TRACE_SIZE)
void set(Column col, uint32_t row, const FF &value)
static constexpr size_t SR_NULLIFIER_SIZE_IMMUTABILITY
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_TREE_ROOT_CONTINUITY
static constexpr size_t SR_NULLIFIER_COUNT_PADDED_IMMUTABILITY
static constexpr size_t SR_NOTE_HASH_ROOT_PADDED_IMMUTABILITY
static constexpr size_t SR_NUM_UNENCRYPTED_LOGS_CONTINUITY
static constexpr size_t SR_NULLIFIER_COUNT_IMMUTABILITY
static constexpr size_t SR_NOTE_HASH_SIZE_PADDED_IMMUTABILITY
static constexpr size_t SR_NULLIFIER_SIZE_PADDED_IMMUTABILITY
static constexpr size_t SR_NUM_L2_TO_L1_MESSAGES_CONTINUITY
static constexpr size_t SR_NOTE_HASH_COUNT_PADDED_IMMUTABILITY
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_ROOT_IMMUTABILITY
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_ROOT_PADDED_IMMUTABILITY
static constexpr size_t SR_PUBLIC_DATA_SIZE_PADDED_IMMUTABILITY
static constexpr size_t SR_NULLIFIER_TREE_SIZE_CONTINUITY
static constexpr size_t SR_UNENCRYPTED_LOG_COUNT_IMMUTABILITY
static constexpr size_t SR_L2_TO_L1_MESSAGE_COUNT_IMMUTABILITY
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_SIZE_CONTINUITY
static constexpr size_t SR_PUBLIC_DATA_ROOT_PADDED_IMMUTABILITY
static constexpr size_t SR_PUBLIC_DATA_TREE_ROOT_CONTINUITY
static constexpr size_t SR_NOTE_HASH_ROOT_IMMUTABILITY
static constexpr size_t SR_NEXT_CONTEXT_ID_CONTINUITY
static constexpr size_t SR_NOTE_HASH_SIZE_IMMUTABILITY
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_SIZE_IMMUTABILITY
static constexpr size_t SR_NOTE_HASH_TREE_SIZE_CONTINUITY
static constexpr size_t SR_NULLIFIER_ROOT_PADDED_IMMUTABILITY
static constexpr size_t SR_UNENCRYPTED_LOG_COUNT_PADDED_IMMUTABILITY
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_CONTINUITY
static constexpr size_t SR_NULLIFIER_ROOT_IMMUTABILITY
static constexpr size_t SR_NOTE_HASH_ROOT_CONTINUITY
static constexpr size_t SR_RETRIEVED_BYTECODES_TREE_ROOT_CONTINUITY
static constexpr size_t SR_PUBLIC_DATA_ROOT_IMMUTABILITY
static constexpr size_t SR_NUM_NOTE_HASHES_EMITTED_CONTINUITY
static constexpr size_t SR_PUBLIC_DATA_SIZE_IMMUTABILITY
static constexpr size_t SR_NUM_NULLIFIERS_EMITTED_CONTINUITY
static constexpr size_t SR_NOTE_HASH_COUNT_IMMUTABILITY
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_SIZE_PADDED_IMMUTABILITY
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_SIZE_IMMUTABILITY
static constexpr size_t SR_L2_TO_L1_MESSAGE_COUNT_PADDED_IMMUTABILITY
static constexpr size_t SR_NEXT_CONTEXT_ID_INITIAL_VALUE
static constexpr size_t SR_WRITTEN_PUBLIC_DATA_SLOTS_ROOT_IMMUTABILITY
static constexpr size_t SR_L1_L2_TREE_ROOT_CONTINUITY
static constexpr size_t SR_NULLIFIER_TREE_ROOT_CONTINUITY
static constexpr size_t SR_PUBLIC_DATA_TREE_SIZE_CONTINUITY
PrecomputedTraceBuilder precomputed_builder
Definition alu.test.cpp:119
TestTraceContainer trace
#define EXPECT_THROW_WITH_MESSAGE(code, expectedMessage)
Definition macros.hpp:7
void check_interaction(tracegen::TestTraceContainer &trace)
TEST(TxExecutionConstrainingTest, WriteTreeValue)
Definition tx.test.cpp:402
lookup_settings< lookup_tx_context_public_inputs_write_l2_to_l1_message_count_settings_ > lookup_tx_context_public_inputs_write_l2_to_l1_message_count_settings
lookup_settings< lookup_tx_context_public_inputs_note_hash_tree_settings_ > lookup_tx_context_public_inputs_note_hash_tree_settings
lookup_settings< lookup_tx_context_public_inputs_nullifier_tree_settings_ > lookup_tx_context_public_inputs_nullifier_tree_settings
lookup_settings< lookup_tx_context_public_inputs_read_gas_limit_settings_ > lookup_tx_context_public_inputs_read_gas_limit_settings
lookup_settings< lookup_tx_context_public_inputs_public_data_tree_settings_ > lookup_tx_context_public_inputs_public_data_tree_settings
lookup_settings< lookup_tx_context_public_inputs_gas_used_settings_ > lookup_tx_context_public_inputs_gas_used_settings
lookup_settings< lookup_tx_context_public_inputs_l1_l2_tree_settings_ > lookup_tx_context_public_inputs_l1_l2_tree_settings
lookup_settings< lookup_tx_context_restore_state_on_revert_settings_ > lookup_tx_context_restore_state_on_revert_settings
lookup_settings< lookup_tx_context_public_inputs_write_nullifier_count_settings_ > lookup_tx_context_public_inputs_write_nullifier_count_settings
lookup_settings< lookup_tx_context_public_inputs_write_note_hash_count_settings_ > lookup_tx_context_public_inputs_write_note_hash_count_settings
lookup_settings< lookup_tx_context_public_inputs_write_unencrypted_log_count_settings_ > lookup_tx_context_public_inputs_write_unencrypted_log_count_settings
AvmFlavorSettings::FF FF
Definition field.hpp:10
typename Flavor::FF FF
tracegen::PublicInputsTraceBuilder public_inputs_builder
Definition tx.test.cpp:80