Skip to content

Commit

Permalink
fix: issue with run_nargo_fmt.sh + minor yellow paper naming improv…
Browse files Browse the repository at this point in the history
…ements (#3833)

When input param was not set (which is expected when we want to apply
the changes) the script failed with

> ./run_nargo_fmt.sh: line 31: $1: unbound variable

I decided to solve this by allowing for unbound vars.

Other than this I sneaked in a few changes I discussed with Lasse:

1. Renamed content hash as body hash because we have a struct called
body and the hash is hash of body so it makes it a bit more clear of
what the hash is.
2. Renamed `l1_to_l2_message_tree` as `l1_to_l2_messages_tree` in the
yellow paper to make it consistent with our codebase.
  • Loading branch information
superstar0402 committed Jan 7, 2024
1 parent 6d01fda commit 97afc53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aztec/src/context.nr
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl PrivateContext {
)
// docs:end:context_consume_l1_to_l2_message
{
let nullifier = process_l1_to_l2_message(self.block_header.l1_to_l2_messages_tree_root, self.this_address(), self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret);
let nullifier = process_l1_to_l2_message(self.block_header.l1_to_l2_message_tree_root, self.this_address(), self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret);

// Push nullifier (and the "commitment" corresponding to this can be "empty")
self.push_new_nullifier(nullifier, 0)
Expand Down Expand Up @@ -310,7 +310,7 @@ impl PrivateContext {
note_hash_tree_root : reader.read(),
nullifier_tree_root : reader.read(),
contract_tree_root : reader.read(),
l1_to_l2_messages_tree_root : reader.read(),
l1_to_l2_message_tree_root : reader.read(),
archive_root : reader.read(),
public_data_tree_root: reader.read(),
global_variables_hash: reader.read(),
Expand Down Expand Up @@ -579,7 +579,7 @@ impl PublicContext {
// Note this returns self to get around an issue where mutable structs do not maintain mutations unless reassigned
pub fn consume_l1_to_l2_message(&mut self, msg_key: Field, content: Field, secret: Field) {
let this = (*self).this_address();
let nullifier = process_l1_to_l2_message(self.block_header.l1_to_l2_messages_tree_root, this, self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret);
let nullifier = process_l1_to_l2_message(self.block_header.l1_to_l2_message_tree_root, this, self.this_portal_address(), self.chain_id(), self.version(), msg_key, content, secret);

// Push nullifier (and the "commitment" corresponding to this can be "empty")
self.push_new_nullifier(nullifier, 0)
Expand Down

0 comments on commit 97afc53

Please sign in to comment.