pub fn from_hashes(
        hasher: H,
        hashes: impl Iterator<Item = H256>,
        min_tree_size: Option<usize>,
    ) -> Self {
        let hashes: VecDeque<_> = hashes.collect();
        let mut binary_tree_size = hashes.len().next_power_of_two();
        if let Some(min_tree_size) = min_tree_size {
            assert!(
                min_tree_size.is_power_of_two(),
                "tree size must be a power of 2"
            );
            binary_tree_size = min_tree_size.max(binary_tree_size);
        }

        let depth = tree_depth_by_size(binary_tree_size);
        assert!(
            depth <= MAX_TREE_DEPTH,
            "Tree contains more than {} items; this is not supported",
            1u64 << MAX_TREE_DEPTH
        );

        Self {
            hasher,
            hashes,
            binary_tree_size,
            start_index: 0,
            cache: vec![None; depth],
            _leaf: PhantomData,
        }
    }
Creates a new Merkle tree from the supplied raw hashes. If `min_tree_size` is supplied and is larger than the
number of the supplied leaves, the leaves are padded to `min_tree_size` with zero-hash entries,
but are deemed empty.

# Panics

Panics if any of the following conditions applies:

- `min_tree_size` (if supplied) is not a power of 2.
- The number of leaves is greater than `2^32`.
core/lib/mini_merkle_tree/src/lib.rs