Skip to content

Commit d16e696

Browse files
author
AztecBot
committed
Merge branch 'next' into merge-train/spartan
2 parents 704b8d5 + a6bfb30 commit d16e696

File tree

143 files changed

+10438
-2725
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+10438
-2725
lines changed

avm-transpiler/src/transpile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,13 @@ fn handle_emit_unencrypted_log(
718718
// The message array from Brillig is indirect.
719719
indirect: Some(
720720
AddressingModeBuilder::default()
721-
.indirect_operand(&message_offset)
722721
.direct_operand(&message_size_offset)
722+
.indirect_operand(&message_offset)
723723
.build(),
724724
),
725725
operands: vec![
726-
AvmOperand::U16 { value: message_offset.to_usize() as u16 },
727726
AvmOperand::U16 { value: message_size_offset.to_usize() as u16 },
727+
AvmOperand::U16 { value: message_offset.to_usize() as u16 },
728728
],
729729
..Default::default()
730730
});

barretenberg/cpp/pil/vm2/constants_gen.pil

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace constants;
1313
pol MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 64;
1414
pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 63;
1515
pol MAX_L2_TO_L1_MSGS_PER_TX = 8;
16-
pol MAX_PUBLIC_LOGS_PER_TX = 8;
1716
pol MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS = 3000;
1817
pol CANONICAL_AUTH_REGISTRY_ADDRESS = 1;
1918
pol CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS = 2;
@@ -24,7 +23,10 @@ namespace constants;
2423
pol MAX_PROTOCOL_CONTRACT_ADDRESS = 6;
2524
pol FEE_JUICE_BALANCES_SLOT = 1;
2625
pol UPDATED_CLASS_IDS_SLOT = 1;
27-
pol PUBLIC_LOG_SIZE_IN_FIELDS = 13;
26+
pol FLAT_PUBLIC_LOGS_HEADER_LENGTH = 1;
27+
pol FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH = 4096;
28+
pol PUBLIC_LOGS_LENGTH = 4097;
29+
pol PUBLIC_LOG_HEADER_LENGTH = 2;
2830
pol MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS = 21;
2931
pol MEM_TAG_FF = 0;
3032
pol MEM_TAG_U1 = 1;
@@ -135,19 +137,18 @@ namespace constants;
135137
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NOTE_HASHES_ROW_IDX = 371;
136138
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_NULLIFIERS_ROW_IDX = 372;
137139
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_L2_TO_L1_MSGS_ROW_IDX = 373;
138-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_LOGS_ROW_IDX = 374;
139-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX = 375;
140-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX = 376;
141-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX = 376;
142-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX = 440;
143-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX = 504;
144-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX = 512;
145-
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX = 616;
146-
pol AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX = 680;
147-
pol AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX = 681;
148-
pol AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH = 682;
140+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ARRAY_LENGTHS_PUBLIC_DATA_WRITES_ROW_IDX = 374;
141+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_ROW_IDX = 375;
142+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NOTE_HASHES_ROW_IDX = 375;
143+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_NULLIFIERS_ROW_IDX = 439;
144+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_L2_TO_L1_MSGS_ROW_IDX = 503;
145+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_LOGS_ROW_IDX = 511;
146+
pol AVM_PUBLIC_INPUTS_AVM_ACCUMULATED_DATA_PUBLIC_DATA_WRITES_ROW_IDX = 4608;
147+
pol AVM_PUBLIC_INPUTS_TRANSACTION_FEE_ROW_IDX = 4672;
148+
pol AVM_PUBLIC_INPUTS_REVERTED_ROW_IDX = 4673;
149+
pol AVM_PUBLIC_INPUTS_COLUMNS_MAX_LENGTH = 4674;
149150
pol AVM_NUM_PUBLIC_INPUT_COLUMNS = 4;
150-
pol AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH = 2728;
151+
pol AVM_PUBLIC_INPUTS_COLUMNS_COMBINED_LENGTH = 18696;
151152
pol AVM_PC_SIZE_IN_BITS = 32;
152153
pol AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_HEIGHT = 6;
153154
pol AVM_WRITTEN_PUBLIC_DATA_SLOTS_TREE_INITIAL_ROOT = 18291678969210913367302010540259942201271604198321103848479209155223586227821;

barretenberg/cpp/pil/vm2/context.pil

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ namespace execution;
105105
pol commit retrieved_bytecodes_tree_size;
106106

107107
// Prev side effects state
108-
pol commit prev_num_unencrypted_logs;
108+
pol commit prev_num_unencrypted_log_fields;
109109
pol commit prev_num_l2_to_l1_messages;
110110

111111
// Next side effects state
112-
pol commit num_unencrypted_logs;
112+
pol commit num_unencrypted_log_fields;
113113
pol commit num_l2_to_l1_messages;
114114

115115
// ==== Helper columns ====
@@ -347,7 +347,7 @@ namespace execution;
347347
written_public_data_slots_tree_root,
348348
written_public_data_slots_tree_size,
349349
// Retrieved bytecodes tree is not commited and restored, since it's a tx global state.
350-
num_unencrypted_logs,
350+
num_unencrypted_log_fields,
351351
num_l2_to_l1_messages
352352
} in
353353
context_stack.sel {
@@ -375,7 +375,7 @@ namespace execution;
375375
context_stack.public_data_tree_size,
376376
context_stack.written_public_data_slots_tree_root,
377377
context_stack.written_public_data_slots_tree_size,
378-
context_stack.num_unencrypted_logs,
378+
context_stack.num_unencrypted_log_fields,
379379
context_stack.num_l2_to_l1_messages
380380
};
381381

@@ -412,7 +412,7 @@ namespace execution;
412412
prev_public_data_tree_size',
413413
prev_written_public_data_slots_tree_root',
414414
prev_written_public_data_slots_tree_size',
415-
prev_num_unencrypted_logs',
415+
prev_num_unencrypted_log_fields',
416416
prev_num_l2_to_l1_messages'
417417
} in
418418
context_stack.sel {
@@ -440,7 +440,7 @@ namespace execution;
440440
context_stack.public_data_tree_size,
441441
context_stack.written_public_data_slots_tree_root,
442442
context_stack.written_public_data_slots_tree_size,
443-
context_stack.num_unencrypted_logs,
443+
context_stack.num_unencrypted_log_fields,
444444
context_stack.num_l2_to_l1_messages
445445
};
446446

@@ -532,6 +532,6 @@ namespace execution;
532532
NOT_LAST_EXEC * (l1_l2_tree_root - l1_l2_tree_root') = 0;
533533

534534
#[NUM_UNENCRYPTED_LOGS_CONTINUITY]
535-
NOT_LAST_EXEC * DEFAULT_OR_NESTED_RETURN * (num_unencrypted_logs - prev_num_unencrypted_logs') = 0;
535+
NOT_LAST_EXEC * DEFAULT_OR_NESTED_RETURN * (num_unencrypted_log_fields - prev_num_unencrypted_log_fields') = 0;
536536
#[NUM_L2_TO_L1_MESSAGES_CONTINUITY]
537537
NOT_LAST_EXEC * DEFAULT_OR_NESTED_RETURN * (num_l2_to_l1_messages - prev_num_l2_to_l1_messages') = 0;

barretenberg/cpp/pil/vm2/context_stack.pil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ namespace context_stack;
4444
pol commit written_public_data_slots_tree_size;
4545

4646
// Side effects state
47-
pol commit num_unencrypted_logs;
47+
pol commit num_unencrypted_log_fields;
4848
pol commit num_l2_to_l1_messages;

barretenberg/cpp/pil/vm2/execution.pil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ sel_gas_sstore {
387387
#[SSTORE_DYN_L2_GAS_IS_ZERO]
388388
sel_execute_sstore * dynamic_l2_gas_factor = 0;
389389

390-
sel_gas_emit_unencrypted_log * dynamic_l2_gas_factor = 0;
391-
sel_gas_emit_unencrypted_log * (/*log_size=*/ register[1] - dynamic_da_gas_factor) = 0;
390+
sel_gas_emit_unencrypted_log * (/*log_size=*/ register[0] - dynamic_l2_gas_factor) = 0;
391+
sel_gas_emit_unencrypted_log * (/*log_size=*/ register[0] - dynamic_da_gas_factor) = 0;
392392

393393
/**************************************************************************************************
394394
* Temporality group 5: Opcode execution
@@ -647,7 +647,7 @@ sel * (1 - sel_execute_emit_nullifier) * (prev_nullifier_tree_size - nullifier_t
647647
#[NUM_NULLIFIERS_EMITTED_NOT_CHANGED]
648648
sel * (1 - sel_execute_emit_nullifier) * (prev_num_nullifiers_emitted - num_nullifiers_emitted) = 0;
649649
#[NUM_UNENCRYPTED_LOGS_NOT_CHANGED]
650-
sel * (1 - sel_execute_emit_unencrypted_log) * (prev_num_unencrypted_logs - num_unencrypted_logs) = 0;
650+
sel * (1 - sel_execute_emit_unencrypted_log) * (prev_num_unencrypted_log_fields - num_unencrypted_log_fields) = 0;
651651
#[NUM_L2_TO_L1_MESSAGES_NOT_CHANGED]
652652
sel * (1 - sel_execute_send_l2_to_l1_msg) * (prev_num_l2_to_l1_messages - num_l2_to_l1_messages) = 0;
653653
// Retrieved bytecodes tree state can only change in the first row of a new context

0 commit comments

Comments
 (0)