pub async fn save(&mut self) -> anyhow::Result<()> {
        let mut tree = self.inner.take().context(Self::INCONSISTENT_MSG)?;
        let span = tracing::Span::current();
        self.inner = Some(
            tokio::task::spawn_blocking(|| {
                let _entered_span = span.entered();
                let _guard = AllocationGuard::new("tree#save");
                tree.save()?;
                anyhow::Ok(tree)
            })
            .await
            .context("Merkle tree panicked during saving")??,
        );
        Ok(())
    }
Returned errors are unrecoverable; the tree must not be used after an error is returned.
core/node/metadata_calculator/src/helpers.rs