Skip to content

Commit a6bbc3e

Browse files
committed
Address comment.
1 parent 450d47b commit a6bbc3e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

noir-projects/noir-protocol-circuits/crates/rollup-lib/src/root/utils/compute_epoch_out_hash.nr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ use types::{
2525
/// By using a fixed unbalanced tree structure, the positions (leaf ids) of existing checkpoints remain stable even as
2626
/// more checkpoints are appended.
2727
pub fn compute_epoch_out_hash(out_hashes: [Field; AZTEC_MAX_EPOCH_DURATION]) -> Field {
28+
std::static_assert(
29+
AZTEC_MAX_EPOCH_DURATION == 48,
30+
"Remember to update these constants of 32 and 16",
31+
);
2832
let left_subtree_out_hashes: [Field; 32] = subarray(out_hashes, 0);
2933
let right_subtree_out_hashes: [Field; 16] = subarray(out_hashes, 32);
3034
let left_subtree_root = MerkleTree::new_sha(left_subtree_out_hashes).get_root();
@@ -47,9 +51,6 @@ mod tests {
4751

4852
#[test]
4953
fn full_epoch_matches_ts() {
50-
// If the constant's changed, update `compute_epoch_out_hash` to work with the new tree size.
51-
assert_eq(AZTEC_MAX_EPOCH_DURATION, 48);
52-
5354
let mut out_hashes = [0; AZTEC_MAX_EPOCH_DURATION];
5455
for i in 0..AZTEC_MAX_EPOCH_DURATION {
5556
out_hashes[i] = 123 + i as Field;

0 commit comments

Comments
 (0)