Skip to content

Commit

Permalink
fix: max_note_len computation (#10438)
Browse files Browse the repository at this point in the history
We were simply adding all note lengths instead of finding the largest
one, resulting in an unncessarily large array. I couldn't think of a
simple and robust way to write a test for this so I just didn't, but I
did check manually that it does what you'd expect.
  • Loading branch information
nventuro authored Jan 9, 2025
1 parent acbfad4 commit 099c17b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion noir-projects/aztec-nr/aztec/src/macros/mod.nr
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ comptime fn generate_compute_note_hash_and_optionally_a_nullifier() -> Quoted {
max_note_length = notes.fold(
0,
|acc, (_, (_, len, _, _)): (Type, (StructDefinition, u32, Field, [(Quoted, u32, bool)]))| {
acc + len
if len > acc {
len
} else {
acc
}
},
);

Expand Down

0 comments on commit 099c17b

Please sign in to comment.