Skip to content

Commit 41bd978

Browse files
committed
comp fixes
1 parent 838fdce commit 41bd978

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

noir-projects/aztec-nr/aztec/src/context/private_context.nr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,10 @@ impl PrivateContext {
929929
let log_to_emit: [Field; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS] =
930930
log.concat([0; CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - N]);
931931
// Note: the length is not always N, it is the number of fields we want to broadcast, omitting trailing zeros
932-
// to save blob space. Safety: The below length is constrained in the base rollup, which will make sure that
933-
// all the fields beyond length are zero. However, it won't be able to check that we didn't add extra padding
934-
// (trailing zeroes) or that we cut trailing zeroes from the end.
932+
// to save blob space.
933+
// Safety: The below length is constrained in the base rollup, which will make sure that all the fields beyond
934+
// length are zero. However, it won't be able to check that we didn't add extra padding (trailing zeroes) or
935+
// that we cut trailing zeroes from the end.
935936
let length = unsafe { trimmed_array_length_hint(log_to_emit) };
936937
// We hash the entire padded log to ensure a user cannot pass a shorter length and so emit incorrect shorter
937938
// bytecode.

noir-projects/aztec-nr/aztec/src/context/public_context.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ impl PublicContext {
436436
/// * Used internally for function dispatch in the AVM
437437
///
438438
pub fn selector(_self: Self) -> FunctionSelector {
439-
// The selector is the first element of the calldata when calling a public function through dispatch. Safety:
440-
// AVM opcodes are constrained by the AVM itself
439+
// The selector is the first element of the calldata when calling a public function through dispatch.
440+
// Safety: AVM opcodes are constrained by the AVM itself.
441441
let raw_selector: [Field; 1] = unsafe { avm::calldata_copy(0, 1) };
442442
FunctionSelector::from_field(raw_selector[0])
443443
}

noir-projects/aztec-nr/aztec/src/history/nullifier.nr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ mod test;
3333
/// is typically cheaper. Note that there are semantic differences though, as that function also considers _pending_
3434
/// nullifiers.
3535
pub fn assert_nullifier_existed_by(block_header: BlockHeader, siloed_nullifier: Field) {
36-
// 1) Get the membership witness of the nullifier Safety: The witness is only used as a "magical value" that makes
37-
// the proof below pass. Hence it's safe.
36+
// 1) Get the membership witness of the nullifier.
37+
// Safety: The witness is only used as a "magical value" that makes the proof below pass. Hence it's safe.
3838
let witness = unsafe { get_nullifier_membership_witness(block_header, siloed_nullifier) };
3939

4040
// 2) First we prove that the tree leaf in the witness is present in the nullifier tree. This is expected to be the
@@ -84,8 +84,8 @@ pub fn assert_nullifier_existed_by(block_header: BlockHeader, siloed_nullifier:
8484
///
8585
/// This function performs a full merkle tree inclusion proof, which is in the order of 4k gates.
8686
pub fn assert_nullifier_did_not_exist_by(block_header: BlockHeader, siloed_nullifier: Field) {
87-
// 1) Get the membership witness of a low nullifier of the nullifier Safety: The witness is only used as a "magical
88-
// value" that makes the proof below pass. Hence it's safe.
87+
// 1) Get the membership witness of a low nullifier of the nullifier.
88+
// Safety: The witness is only used as a "magical value" that makes the proof below pass. Hence it's safe.
8989
let witness = unsafe { get_low_nullifier_membership_witness(block_header, siloed_nullifier) };
9090

9191
// 2) Check that the leaf preimage is not empty. An empty leaf preimage would pass validation as a low leaf.

noir-projects/aztec-nr/aztec/src/history/storage.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pub fn public_storage_historical_read(
2121
DOM_SEP__PUBLIC_LEAF_INDEX,
2222
);
2323

24-
// 2) Get the membership witness for the tree index. Safety: The witness is only used as a "magical value" that
25-
// makes the proof below pass. Hence it's safe.
24+
// 2) Get the membership witness for the tree index.
25+
// Safety: The witness is only used as a "magical value" that makes the proof below pass. Hence it's safe.
2626
let witness = unsafe { get_public_data_witness(block_header, public_data_tree_index) };
2727

2828
public_data_storage_read(

noir-projects/aztec-nr/aztec/src/messaging.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ pub fn process_l1_to_l2_message(
2727
);
2828

2929
// We prove that `message_hash` is in the tree by showing the derivation of the tree root, using a merkle path we
30-
// get from an oracle. Safety: The witness is only used as a "magical value" that makes the merkle proof below
31-
// pass. Hence it's safe.
30+
// get from an oracle.
31+
// Safety: The witness is only used as a "magical value" that makes the merkle proof below pass. Hence it's safe.
3232
let (_leaf_index, sibling_path) =
3333
unsafe { get_l1_to_l2_membership_witness(contract_address, message_hash, secret) };
3434

noir-projects/aztec-nr/aztec/src/oracle/block_header.nr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ pub fn get_block_header_at(block_number: u32, context: PrivateContext) -> BlockH
3333
"Last archive block number is smaller than the block number we want to prove against",
3434
);
3535

36-
// 3) Get the header hint of a given block from an oracle Safety: The header is constrained to be in the
37-
// archive tree below.
36+
// 3) Get the header hint of a given block from an oracle.
37+
// Safety: The header is constrained to be in the archive tree below.
3838
let header = unsafe { get_block_header_at_internal(block_number) };
3939

4040
// 4) We make sure that the header hint we received from the oracle exists in the state tree and is the actual
@@ -54,8 +54,8 @@ fn constrain_get_block_header_at_internal(
5454
// 1) Compute the block hash from the block header
5555
let block_hash = header_hint.hash();
5656

57-
// 2) Get the membership witness of the block in the archive tree Safety: The witness is only used as a "magical
58-
// value" that makes the merkle proof below pass. Hence it's safe.
57+
// 2) Get the membership witness of the block in the archive tree.
58+
// Safety: The witness is only used as a "magical value" that makes the merkle proof below pass. Hence it's safe.
5959
let witness = unsafe { get_archive_membership_witness(anchor_block_header, block_hash) };
6060

6161
// 3) Check that the block is in the archive (i.e. the witness is valid)

0 commit comments

Comments
 (0)