async fn ensure_not_pruned(
        storage: &mut Connection<'_, Core>,
        l1_batch_number: L1BatchNumber,
    ) -> anyhow::Result<()> {
        let pruning_info = storage.pruning_dal().get_pruning_info().await?;
        anyhow::ensure!(
            pruning_info.last_soft_pruned.is_none_or(|info| info.l1_batch < l1_batch_number),
            "L1 batch #{l1_batch_number}, next to be processed by the tree, is pruned; the tree cannot continue operating"
        );
        Ok(())
    }
Checks whether the requested L1 batch was pruned. Right now, the tree cannot recover from this situation,
so we exit with an error if this happens.
core/node/metadata_calculator/src/updater.rs