pub fn with_hasher(db: DB, hasher: P::Hasher) -> anyhow::Result<Self> {
        let maybe_manifest = db.try_manifest().context("failed reading tree manifest")?;
        if let Some(manifest) = &maybe_manifest {
            manifest.tags.ensure_consistency::<P>(&hasher)?;
        }

        let info = MerkleTreeInfo {
            hasher: hasher.name(),
            depth: P::TREE_DEPTH.into(),
            internal_node_depth: P::INTERNAL_NODE_DEPTH.into(),
        };
        tracing::debug!(?info, manifest = ?maybe_manifest, "initialized Merkle tree");
        METRICS.info.set(info).ok();

        Ok(Self { db, hasher })
    }
Loads a tree with the specified hasher.

# Errors

Errors if the hasher or basic tree parameters (e.g., the tree depth)
do not match those of the tree loaded from the database.
core/lib/zk_os_merkle_tree/src/lib.rs