Skip to content

Commit

Permalink
refactor: messaging naming fixes (#5383)
Browse files Browse the repository at this point in the history
Some naming fixes we discussed in our team chat and which Lasse
[disliked](AztecProtocol/aztec-packages#5206 (comment))
in my purge PR a few days ago.
\+ nuked some stale stuff from contracts.
  • Loading branch information
benesjan authored and AztecBot committed Mar 23, 2024
1 parent 7e3b067 commit de5f7b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions aztec/src/messaging.nr
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ pub fn process_l1_to_l2_message(
content,
secret
);
let entry_key = msg.hash();
let message_hash = msg.hash();

let returned_message = get_l1_to_l2_membership_witness(entry_key);
let returned_message = get_l1_to_l2_membership_witness(message_hash);
let leaf_index = returned_message[0];
let sibling_path = arr_copy_slice(returned_message, [0; L1_TO_L2_MSG_TREE_HEIGHT], 1);

// Check that the message is in the tree
// This is implicitly checking that the values of the message are correct
let root = compute_merkle_root(entry_key, leaf_index, sibling_path);
let root = compute_merkle_root(message_hash, leaf_index, sibling_path);
assert(root == l1_to_l2_root, "Message not in state");

msg.compute_nullifier()
Expand Down
8 changes: 4 additions & 4 deletions aztec/src/oracle/get_l1_to_l2_membership_witness.nr
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use dep::protocol_types::constants::L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH;

// Checks if a msg is within the l1ToL2Msg tree
// Obtains membership witness (index and sibling path) for a message in the L1 to L2 message tree.
#[oracle(getL1ToL2MembershipWitness)]
fn get_l1_to_l2_membership_witness_oracle(_entry_key: Field) -> [Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] {}
fn get_l1_to_l2_membership_witness_oracle(_message_hash: Field) -> [Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] {}

unconstrained pub fn get_l1_to_l2_membership_witness(entry_key: Field) -> [Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] {
get_l1_to_l2_membership_witness_oracle(entry_key)
unconstrained pub fn get_l1_to_l2_membership_witness(message_hash: Field) -> [Field; L1_TO_L2_MESSAGE_ORACLE_CALL_LENGTH] {
get_l1_to_l2_membership_witness_oracle(message_hash)
}

0 comments on commit de5f7b8

Please sign in to comment.