Skip to content

Commit d3bf950

Browse files
authored
feat: merge-train/avm (#20419)
BEGIN_COMMIT_OVERRIDE fix(avm)!: Enshrine bytecode size in public bytecode commitment (#20254) fix(avm)!: pre-audit note-hash-tree-check (#20386) chore(avm)!: ff_gt pre-audit (#20442) fix(avm)!: rename unencrypted log to public log (#20344) chore: Pre audit L1ToL2MsgTreeCheck (#20443) chore(avm)!: Bytecode Decomposition pre-audit docs (#20120) END_COMMIT_OVERRIDE
2 parents 3fdb9af + 95c4340 commit d3bf950

File tree

166 files changed

+3167
-2284
lines changed

Some content is hidden

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

166 files changed

+3167
-2284
lines changed

avm-transpiler/src/opcodes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub enum AvmOpcode {
6363
EMITNULLIFIER,
6464
L1TOL2MSGEXISTS,
6565
GETCONTRACTINSTANCE,
66-
EMITUNENCRYPTEDLOG,
66+
EMITPUBLICLOG,
6767
SENDL2TOL1MSG,
6868
// External calls
6969
CALL,
@@ -155,7 +155,7 @@ impl AvmOpcode {
155155
AvmOpcode::L1TOL2MSGEXISTS => "L1TOL2MSGEXISTS", // Messages
156156

157157
// Accrued Substate
158-
AvmOpcode::EMITUNENCRYPTEDLOG => "EMITUNENCRYPTEDLOG",
158+
AvmOpcode::EMITPUBLICLOG => "EMITPUBLICLOG",
159159
AvmOpcode::SENDL2TOL1MSG => "SENDL2TOL1MSG",
160160
AvmOpcode::GETCONTRACTINSTANCE => "GETCONTRACTINSTANCE",
161161

avm-transpiler/src/transpile.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ fn handle_foreign_call(
542542
"avmOpcodeStaticCall" => {
543543
handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::STATICCALL);
544544
}
545-
"avmOpcodeEmitUnencryptedLog" => {
546-
handle_emit_unencrypted_log(avm_instrs, destinations, inputs);
545+
"avmOpcodeEmitPublicLog" => {
546+
handle_emit_public_log(avm_instrs, destinations, inputs);
547547
}
548548
"avmOpcodeNoteHashExists" => handle_note_hash_exists(avm_instrs, destinations, inputs),
549549
"avmOpcodeEmitNoteHash" | "avmOpcodeEmitNullifier" => handle_emit_note_hash_or_nullifier(
@@ -697,14 +697,14 @@ fn handle_note_hash_exists(
697697
});
698698
}
699699

700-
fn handle_emit_unencrypted_log(
700+
fn handle_emit_public_log(
701701
avm_instrs: &mut Vec<AvmInstruction>,
702702
destinations: &[ValueOrArray],
703703
inputs: &[ValueOrArray],
704704
) {
705705
if !destinations.is_empty() || inputs.len() != 2 {
706706
panic!(
707-
"Transpiler expects ForeignCall::EMITUNENCRYPTEDLOG to have 0 destinations and 2 inputs, got {} and {}",
707+
"Transpiler expects ForeignCall::EMITPUBLICLOG to have 0 destinations and 2 inputs, got {} and {}",
708708
destinations.len(),
709709
inputs.len()
710710
);
@@ -714,10 +714,10 @@ fn handle_emit_unencrypted_log(
714714
// The length field is redundant and we skipt it.
715715
let (message_offset, message_size_offset) = match &inputs[1] {
716716
ValueOrArray::HeapVector(vec) => (vec.pointer, vec.size),
717-
_ => panic!("Unexpected inputs for ForeignCall::EMITUNENCRYPTEDLOG: {:?}", inputs),
717+
_ => panic!("Unexpected inputs for ForeignCall::EMITPUBLICLOG: {:?}", inputs),
718718
};
719719
avm_instrs.push(AvmInstruction {
720-
opcode: AvmOpcode::EMITUNENCRYPTEDLOG,
720+
opcode: AvmOpcode::EMITPUBLICLOG,
721721
// The message array from Brillig is indirect (addressing mode).
722722
addressing_mode: Some(
723723
AddressingModeBuilder::default()

barretenberg/cpp/pil/vm2/bytecode/bc_decomposition.pil

Lines changed: 224 additions & 97 deletions
Large diffs are not rendered by default.

barretenberg/cpp/pil/vm2/bytecode/bc_hashing.pil

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,20 @@ namespace bc_hashing;
106106
// We need 3 packed fields to use as inputs for each poseidon round
107107
pol commit packed_fields_0, packed_fields_1, packed_fields_2;
108108

109-
// At the start of a new bytecode hash, the initial field has to be the separator, and we skip the lookup:
110-
#[START_IS_SEPARATOR]
111-
start * (packed_fields_0 - constants.DOM_SEP__PUBLIC_BYTECODE) = 0;
109+
// Only constrained at start for the prepended field:
110+
pol commit size_in_bytes;
111+
#[BYTECODE_LENGTH_BYTES]
112+
start { precomputed.zero, bytecode_id, size_in_bytes }
113+
is
114+
bc_decomposition.start { bc_decomposition.pc, bc_decomposition.id, bc_decomposition.bytes_remaining };
115+
116+
// At the start of a new bytecode hash, the initial field has to be the size appended to the separator, and we skip the lookup
117+
// fetching a field from decomposition. NOTE: size_in_bytes is constrained to be less than MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS (= 3000) * 31 at the contract registration
118+
// level, so the below should never overflow.
119+
pol FIRST_FIELD = constants.DOM_SEP__PUBLIC_BYTECODE + size_in_bytes * 2**32;
120+
121+
#[START_IS_FIRST_FIELD]
122+
start * (packed_fields_0 - FIRST_FIELD) = 0;
112123

113124
#[GET_PACKED_FIELD_0]
114125
sel_not_start { pc_index, bytecode_id, packed_fields_0 }
@@ -222,12 +233,12 @@ namespace bc_hashing;
222233
sel_not_padding_2 * pc_index_2 // no padding ==> pc_at_final_field = pc_index_2
223234
) = 0;
224235

225-
// The length of the hashed bytecode in fields, including the prepended separator. We use it to look up into poseidon_2 to ensure that
236+
// The length of the hashed bytecode in fields, including the prepended field. We use it to look up into poseidon_2 to ensure that
226237
// the hashed IV matches our bytecode length.
227238
// Note: this is constrained at the final row (latch) by linking it to the pc_at_final_field (see above lookups/relations).
228239
pol commit input_len;
229240

230-
// Minus one for the separator field not present in bc_decomposition, and one to include the final field (pc_at_final_field marks the beginning of the last field).
241+
// Minus one for the initial field not present in bc_decomposition, and one to include the final field (pc_at_final_field marks the beginning of the last field).
231242
// Note: this shouldn't underflow as we don't handle empty bytecode.
232243
#[BYTECODE_LENGTH_FIELDS]
233244
latch * (31 * (input_len - 2) - pc_at_final_field) = 0;
@@ -268,7 +279,7 @@ namespace bc_hashing;
268279
// a row with latch == 1 before we meet start == 1 when we go up. This shows that bytecode_id,
269280
// pc_index, and incremental_hash evolution did not deviate from the happy path.
270281
// When we reach a row with start == 1 (we know we must reach one thanks to #[START_AFTER_LATCH]
271-
// enforces it on the second row.), then #[START_IS_SEPARATOR] implies that pc_index and packed_fields
282+
// enforces it on the second row.), then #[START_IS_FIRST_FIELD] implies that pc_index and packed_fields
272283
// are correctly initialized. Note also that thanks #[TRACE_CONTINUITY] and #[GET_PACKED_FIELD_i]
273284
// we retrieved packed_field_i at the right pc_index_i from bc_decomposition sub-trace.
274285
// We remark that before reaching another latch, a prover might add additional rows without

barretenberg/cpp/pil/vm2/constants_gen.pil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace constants;
5454
pol AVM_SUBTRACE_ID_RETURNDATA_COPY = 32;
5555
pol AVM_SUBTRACE_ID_SET = 64;
5656
pol AVM_SUBTRACE_ID_GETCONTRACTINSTANCE = 128;
57-
pol AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG = 256;
57+
pol AVM_SUBTRACE_ID_EMITPUBLICLOG = 256;
5858
pol AVM_SUBTRACE_ID_POSEIDON2_PERM = 512;
5959
pol AVM_SUBTRACE_ID_SHA256_COMPRESSION = 1024;
6060
pol AVM_SUBTRACE_ID_KECCAKF1600 = 2048;
@@ -64,7 +64,7 @@ namespace constants;
6464
pol AVM_DYN_GAS_ID_RETURNDATACOPY = 2;
6565
pol AVM_DYN_GAS_ID_TORADIX = 4;
6666
pol AVM_DYN_GAS_ID_BITWISE = 8;
67-
pol AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG = 16;
67+
pol AVM_DYN_GAS_ID_EMITPUBLICLOG = 16;
6868
pol AVM_DYN_GAS_ID_SSTORE = 32;
6969
pol AVM_EXEC_OP_ID_GETENVVAR = 1;
7070
pol AVM_EXEC_OP_ID_MOV = 2;

barretenberg/cpp/pil/vm2/context.pil

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ namespace execution;
111111
pol commit retrieved_bytecodes_tree_size;
112112

113113
// Prev side effects state
114-
pol commit prev_num_unencrypted_log_fields;
114+
pol commit prev_num_public_log_fields;
115115
pol commit prev_num_l2_to_l1_messages;
116116

117117
// Next side effects state
118-
pol commit num_unencrypted_log_fields;
118+
pol commit num_public_log_fields;
119119
pol commit num_l2_to_l1_messages;
120120

121121
// ==== Helper columns ====
@@ -662,7 +662,7 @@ namespace execution;
662662
written_public_data_slots_tree_root,
663663
written_public_data_slots_tree_size,
664664
// Retrieved bytecodes tree is not commited and restored, since it's a tx global state.
665-
num_unencrypted_log_fields,
665+
num_public_log_fields,
666666
num_l2_to_l1_messages
667667
} is // Crucial to be a permutation to prevent malicious insertions in the context stack.
668668
context_stack.sel {
@@ -693,7 +693,7 @@ namespace execution;
693693
context_stack.public_data_tree_size,
694694
context_stack.written_public_data_slots_tree_root,
695695
context_stack.written_public_data_slots_tree_size,
696-
context_stack.num_unencrypted_log_fields,
696+
context_stack.num_public_log_fields,
697697
context_stack.num_l2_to_l1_messages
698698
};
699699

@@ -731,7 +731,7 @@ namespace execution;
731731
prev_public_data_tree_size',
732732
prev_written_public_data_slots_tree_root',
733733
prev_written_public_data_slots_tree_size',
734-
prev_num_unencrypted_log_fields',
734+
prev_num_public_log_fields',
735735
prev_num_l2_to_l1_messages'
736736
} in // Lookup is fine during a pop/read operation. (permutation would not work because not every context is rolled back.)
737737
context_stack.sel {
@@ -762,7 +762,7 @@ namespace execution;
762762
context_stack.public_data_tree_size,
763763
context_stack.written_public_data_slots_tree_root,
764764
context_stack.written_public_data_slots_tree_size,
765-
context_stack.num_unencrypted_log_fields,
765+
context_stack.num_public_log_fields,
766766
context_stack.num_l2_to_l1_messages
767767
};
768768

@@ -896,8 +896,8 @@ namespace execution;
896896
NOT_LAST_NOT_FAILURE_NOT_ENQ_END * (written_public_data_slots_tree_root - prev_written_public_data_slots_tree_root') = 0;
897897
#[WRITTEN_PUBLIC_DATA_SLOTS_TREE_SIZE_CONTINUITY]
898898
NOT_LAST_NOT_FAILURE_NOT_ENQ_END * (written_public_data_slots_tree_size - prev_written_public_data_slots_tree_size') = 0;
899-
#[NUM_UNENCRYPTED_LOGS_CONTINUITY]
900-
NOT_LAST_NOT_FAILURE_NOT_ENQ_END * (num_unencrypted_log_fields - prev_num_unencrypted_log_fields') = 0;
899+
#[NUM_PUBLIC_LOGS_CONTINUITY]
900+
NOT_LAST_NOT_FAILURE_NOT_ENQ_END * (num_public_log_fields - prev_num_public_log_fields') = 0;
901901
#[NUM_L2_TO_L1_MESSAGES_CONTINUITY]
902902
NOT_LAST_NOT_FAILURE_NOT_ENQ_END * (num_l2_to_l1_messages - prev_num_l2_to_l1_messages') = 0;
903903

barretenberg/cpp/pil/vm2/context_stack.pil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ namespace context_stack;
5757
pol commit written_public_data_slots_tree_size;
5858

5959
// Side effects state
60-
pol commit num_unencrypted_log_fields;
60+
pol commit num_public_log_fields;
6161
pol commit num_l2_to_l1_messages;

barretenberg/cpp/pil/vm2/execution.pil

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ include "opcodes/emit_notehash.pil";
4949
include "opcodes/l1_to_l2_message_exists.pil";
5050
include "opcodes/nullifier_exists.pil";
5151
include "opcodes/emit_nullifier.pil";
52-
include "opcodes/emit_unencrypted_log.pil";
52+
include "opcodes/emit_public_log.pil";
5353
include "opcodes/send_l2_to_l1_msg.pil";
5454

5555
/**
@@ -430,23 +430,23 @@ pol commit sel_gas_calldata_copy; // @boolean
430430
pol commit sel_gas_returndata_copy; // @boolean
431431
pol commit sel_gas_to_radix; // @boolean
432432
pol commit sel_gas_bitwise; // @boolean
433-
pol commit sel_gas_emit_unencrypted_log; // @boolean
433+
pol commit sel_gas_emit_public_log; // @boolean
434434
pol commit sel_gas_sstore; // @boolean
435435

436436
// Bolean constraints
437437
sel_gas_calldata_copy * (1 - sel_gas_calldata_copy) = 0;
438438
sel_gas_returndata_copy * (1 - sel_gas_returndata_copy) = 0;
439439
sel_gas_to_radix * (1 - sel_gas_to_radix) = 0;
440440
sel_gas_bitwise * (1 - sel_gas_bitwise) = 0;
441-
sel_gas_emit_unencrypted_log * (1 - sel_gas_emit_unencrypted_log) = 0;
441+
sel_gas_emit_public_log * (1 - sel_gas_emit_public_log) = 0;
442442
sel_gas_sstore * (1 - sel_gas_sstore) = 0;
443443

444444
#[DYN_GAS_ID_DECOMPOSITION]
445445
sel_gas_calldata_copy * constants.AVM_DYN_GAS_ID_CALLDATACOPY +
446446
sel_gas_returndata_copy * constants.AVM_DYN_GAS_ID_RETURNDATACOPY +
447447
sel_gas_to_radix * constants.AVM_DYN_GAS_ID_TORADIX +
448448
sel_gas_bitwise * constants.AVM_DYN_GAS_ID_BITWISE +
449-
sel_gas_emit_unencrypted_log * constants.AVM_DYN_GAS_ID_EMITUNENCRYPTEDLOG +
449+
sel_gas_emit_public_log * constants.AVM_DYN_GAS_ID_EMITPUBLICLOG +
450450
sel_gas_sstore * constants.AVM_DYN_GAS_ID_SSTORE
451451
// We force the selectors to be 0 if we failed before gas checks
452452
// or when we are not in the execution subtrace.
@@ -535,26 +535,26 @@ sel_gas_sstore {
535535
};
536536

537537
///////////////////////////////////////////////////////////////////////////////
538-
// EMITUNENCRYPTEDLOG, CALLDATACOPY, RETURNDATACOPY, Dynamic Gas Calculation
538+
// EMITPUBLICLOG, CALLDATACOPY, RETURNDATACOPY, Dynamic Gas Calculation
539539
///////////////////////////////////////////////////////////////////////////////
540540

541541
// #[DYN_GAS_ID_DECOMPOSITION] ensures that the gas selectors are mutually exclusive.
542-
// register[0] is the log size for emit_unencrypted_log, the calldata/returndata size for call_data_copy/returndata_copy.
543-
(sel_gas_emit_unencrypted_log + sel_gas_calldata_copy + sel_gas_returndata_copy) * (register[0] - dynamic_l2_gas_factor) = 0;
542+
// register[0] is the log size for emit_public_log, the calldata/returndata size for call_data_copy/returndata_copy.
543+
(sel_gas_emit_public_log + sel_gas_calldata_copy + sel_gas_returndata_copy) * (register[0] - dynamic_l2_gas_factor) = 0;
544544

545-
sel_gas_emit_unencrypted_log * (/*log_size=*/ register[0] - dynamic_da_gas_factor) = 0;
545+
sel_gas_emit_public_log * (/*log_size=*/ register[0] - dynamic_da_gas_factor) = 0;
546546

547547
///////////////////////////////////////////////////////////////////////////////
548548
// Dynamic L2/DA Gas Calculation is ZERO for all other cases
549549
///////////////////////////////////////////////////////////////////////////////
550550

551-
// Except SSTORE, EMITUNENCRYPTEDLOG, all opcodes have a zero dynamic da gas.
551+
// Except SSTORE, EMITPUBLICLOG, all opcodes have a zero dynamic da gas.
552552
#[DYN_DA_GAS_IS_ZERO]
553-
(1 - sel_gas_sstore - sel_gas_emit_unencrypted_log) * dynamic_da_gas_factor = 0;
553+
(1 - sel_gas_sstore - sel_gas_emit_public_log) * dynamic_da_gas_factor = 0;
554554

555-
// Except BITWISE, TORADIX, EMITUNENCRYPTEDLOG, CALLDATACOPY, RETURNDATACOPY, all opcodes have a zero dynamic l2 gas.
555+
// Except BITWISE, TORADIX, EMITPUBLICLOG, CALLDATACOPY, RETURNDATACOPY, all opcodes have a zero dynamic l2 gas.
556556
#[DYN_L2_GAS_IS_ZERO]
557-
(1 - sel_gas_bitwise - sel_gas_to_radix - sel_gas_emit_unencrypted_log - sel_gas_calldata_copy - sel_gas_returndata_copy) * dynamic_l2_gas_factor = 0;
557+
(1 - sel_gas_bitwise - sel_gas_to_radix - sel_gas_emit_public_log - sel_gas_calldata_copy - sel_gas_returndata_copy) * dynamic_l2_gas_factor = 0;
558558

559559
/**************************************************************************************************
560560
* Temporality group 5: Opcode execution
@@ -582,7 +582,7 @@ pol commit sel_exec_dispatch_calldata_copy; // @boolean
582582
pol commit sel_exec_dispatch_returndata_copy; // @boolean
583583
pol commit sel_exec_dispatch_set; // @boolean
584584
pol commit sel_exec_dispatch_get_contract_instance; // @boolean
585-
pol commit sel_exec_dispatch_emit_unencrypted_log; // @boolean
585+
pol commit sel_exec_dispatch_emit_public_log; // @boolean
586586
pol commit sel_exec_dispatch_poseidon2_perm; // @boolean
587587
pol commit sel_exec_dispatch_sha256_compression; // @boolean
588588
pol commit sel_exec_dispatch_keccakf1600; // @boolean
@@ -598,7 +598,7 @@ sel_exec_dispatch_calldata_copy * (1 - sel_exec_dispatch_calldata_copy) = 0;
598598
sel_exec_dispatch_returndata_copy * (1 - sel_exec_dispatch_returndata_copy) = 0;
599599
sel_exec_dispatch_set * (1 - sel_exec_dispatch_set) = 0;
600600
sel_exec_dispatch_get_contract_instance * (1 - sel_exec_dispatch_get_contract_instance) = 0;
601-
sel_exec_dispatch_emit_unencrypted_log * (1 - sel_exec_dispatch_emit_unencrypted_log) = 0;
601+
sel_exec_dispatch_emit_public_log * (1 - sel_exec_dispatch_emit_public_log) = 0;
602602
sel_exec_dispatch_poseidon2_perm * (1 - sel_exec_dispatch_poseidon2_perm) = 0;
603603
sel_exec_dispatch_sha256_compression * (1 - sel_exec_dispatch_sha256_compression) = 0;
604604
sel_exec_dispatch_keccakf1600 * (1 - sel_exec_dispatch_keccakf1600) = 0;
@@ -615,7 +615,7 @@ sel_exec_dispatch_calldata_copy * constants.AVM_SUBTRACE_ID_CALLDATA_COPY +
615615
sel_exec_dispatch_returndata_copy * constants.AVM_SUBTRACE_ID_RETURNDATA_COPY +
616616
sel_exec_dispatch_set * constants.AVM_SUBTRACE_ID_SET +
617617
sel_exec_dispatch_get_contract_instance * constants.AVM_SUBTRACE_ID_GETCONTRACTINSTANCE +
618-
sel_exec_dispatch_emit_unencrypted_log * constants.AVM_SUBTRACE_ID_EMITUNENCRYPTEDLOG +
618+
sel_exec_dispatch_emit_public_log * constants.AVM_SUBTRACE_ID_EMITPUBLICLOG +
619619
sel_exec_dispatch_poseidon2_perm * constants.AVM_SUBTRACE_ID_POSEIDON2_PERM +
620620
sel_exec_dispatch_sha256_compression * constants.AVM_SUBTRACE_ID_SHA256_COMPRESSION +
621621
sel_exec_dispatch_keccakf1600 * constants.AVM_SUBTRACE_ID_KECCAKF1600 +
@@ -765,8 +765,8 @@ sel_execute_returndata_size * (mem_tag_reg[0] - constants.MEM_TAG_U32) = 0; // W
765765
(1 - sel_execute_emit_nullifier) * (prev_nullifier_tree_size - nullifier_tree_size) = 0;
766766
#[NUM_NULLIFIERS_EMITTED_NOT_CHANGED]
767767
(1 - sel_execute_emit_nullifier) * (prev_num_nullifiers_emitted - num_nullifiers_emitted) = 0;
768-
#[NUM_UNENCRYPTED_LOGS_NOT_CHANGED]
769-
(1 - sel_exec_dispatch_emit_unencrypted_log) * (prev_num_unencrypted_log_fields - num_unencrypted_log_fields) = 0;
768+
#[NUM_PUBLIC_LOGS_NOT_CHANGED]
769+
(1 - sel_exec_dispatch_emit_public_log) * (prev_num_public_log_fields - num_public_log_fields) = 0;
770770
#[NUM_L2_TO_L1_MESSAGES_NOT_CHANGED]
771771
(1 - sel_execute_send_l2_to_l1_msg) * (prev_num_l2_to_l1_messages - num_l2_to_l1_messages) = 0;
772772
// Retrieved bytecodes tree state can only change in the first row of a new context
@@ -808,7 +808,7 @@ sel_opcode_error * (1 - sel_opcode_error) = 0;
808808
// - RETURNDATA_COPY: #[DISPATCH_TO_RD_COPY]
809809
// - SET: #[DISPATCH_TO_SET]
810810
// - GET_CONTRACT_INSTANCE: #[DISPATCH_TO_GET_CONTRACT_INSTANCE]
811-
// - EMIT_UNENCRYPTED_LOG: #[DISPATCH_TO_EMIT_UNENCRYPTED_LOG]
811+
// - EMIT_PUBLIC_LOG: #[DISPATCH_TO_EMIT_PUBLIC_LOG]
812812
// - POSEIDON2_PERM: #[DISPATCH_TO_POSEIDON2_PERM]
813813
// - SHA256_COMPRESSION: #[DISPATCH_TO_SHA256_COMPRESSION]
814814
// - KECCAKF1600: #[DISPATCH_TO_KECCAKF1600]
@@ -996,8 +996,8 @@ sel_exec_dispatch_get_contract_instance {
996996
get_contract_instance.sel_error
997997
};
998998

999-
#[DISPATCH_TO_EMIT_UNENCRYPTED_LOG]
1000-
sel_exec_dispatch_emit_unencrypted_log {
999+
#[DISPATCH_TO_EMIT_PUBLIC_LOG]
1000+
sel_exec_dispatch_emit_public_log {
10011001
clk,
10021002
context_id,
10031003
// Message offset
@@ -1006,23 +1006,23 @@ sel_exec_dispatch_emit_unencrypted_log {
10061006
register[0],
10071007
contract_address,
10081008
// Context
1009-
prev_num_unencrypted_log_fields,
1010-
num_unencrypted_log_fields,
1009+
prev_num_public_log_fields,
1010+
num_public_log_fields,
10111011
is_static,
10121012
// Error
10131013
sel_opcode_error,
10141014
discard
1015-
} is emit_unencrypted_log.start {
1016-
emit_unencrypted_log.execution_clk,
1017-
emit_unencrypted_log.space_id,
1018-
emit_unencrypted_log.log_address,
1019-
emit_unencrypted_log.log_size,
1020-
emit_unencrypted_log.contract_address,
1021-
emit_unencrypted_log.prev_num_unencrypted_log_fields,
1022-
emit_unencrypted_log.next_num_unencrypted_log_fields,
1023-
emit_unencrypted_log.is_static,
1024-
emit_unencrypted_log.error,
1025-
emit_unencrypted_log.discard
1015+
} is emit_public_log.start {
1016+
emit_public_log.execution_clk,
1017+
emit_public_log.space_id,
1018+
emit_public_log.log_address,
1019+
emit_public_log.log_size,
1020+
emit_public_log.contract_address,
1021+
emit_public_log.prev_num_public_log_fields,
1022+
emit_public_log.next_num_public_log_fields,
1023+
emit_public_log.is_static,
1024+
emit_public_log.error,
1025+
emit_public_log.discard
10261026
};
10271027

10281028
#[DISPATCH_TO_POSEIDON2_PERM]

barretenberg/cpp/pil/vm2/execution/gas.pil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace execution;
7373
// gt gadget requires both inputs to be bounded by 2^128.
7474
// prev_l2_gas_used is bounded by l2_gas_limit < 2^32
7575
// BASE_L2_GAS < 2^17
76-
// dynamic_l2_gas_factor < 2^32 (for unencrypted logs and to_radix, 32-bit register)
76+
// dynamic_l2_gas_factor < 2^32 (for public logs and to_radix, 32-bit register)
7777
// dynamic_l2_gas < 2^16
7878
// Then total_gas_l2 = prev_l2_gas_used + BASE_L2_GAS + dynamic_l2_gas_factor * dynamic_da_gas < 2^49
7979
// l2_gas_limit is 32 bits (see at the top of this file).

0 commit comments

Comments
 (0)