pub fn extend_with_reference(
        &mut self,
        entries: &[(u64, TreeEntry)],
    ) -> anyhow::Result<BatchOutput> {
        let (output, _) = self.extend_inner(entries, None)?;
        Ok(output)
    }
Same as [`Self::extend()`], but with a cross-check for the leaf indices of `entries`.

`reference_indices` must have the same length as `entries`. Note that because indices are *only* used for cross-checking,
entries (more specifically, new insertions) must still be correctly ordered!
core/lib/zk_os_merkle_tree/src/lib.rs