diff --git a/plonky2x/src/frontend/merkle/tendermint.rs b/plonky2x/src/frontend/merkle/tendermint.rs index 9893638aa..489b762fa 100644 --- a/plonky2x/src/frontend/merkle/tendermint.rs +++ b/plonky2x/src/frontend/merkle/tendermint.rs @@ -121,13 +121,14 @@ impl, const D: usize> CircuitBuilder { .collect_vec() } - // leaf_hashes and leaves_enabled should be of size NB_LEAVES. pub fn get_root_from_hashed_leaves( &mut self, leaf_hashes: Vec, leaves_enabled: Vec, ) -> Bytes32Variable { assert!(NB_LEAVES.is_power_of_two()); + assert!(leaf_hashes.len() == NB_LEAVES); + assert!(leaves_enabled.len() == NB_LEAVES); // Hash each of the validators to get their corresponding leaf hash. let mut current_nodes = leaf_hashes.clone();