async fn roll_back_storage_cache(
        &self,
        last_l1_batch_to_keep: L1BatchNumber,
        storage_cache_path: &Path,
    ) -> anyhow::Result<()> {
        tracing::info!("Opening DB with storage cache at `{storage_cache_path:?}`");
        let sk_cache = RocksdbStorage::builder(storage_cache_path)
            .await
            .context("failed initializing storage cache")?;
        let Some(mut sk_cache) = sk_cache.get().await else {
            tracing::info!(
                "Storage cache at `{storage_cache_path:?}` is not initialized; nothing to do"
            );
            return Ok(());
        };

        if sk_cache.next_l1_batch_number().await > last_l1_batch_to_keep + 1 {
            let mut storage = self
                .connection_pool
                .connection_tagged("block_reverter")
                .await?;
            tracing::info!("Rolling back storage cache");
            sk_cache
                .roll_back(&mut storage, last_l1_batch_to_keep)
                .await
                .context("failed rolling back storage cache")?;
        } else {
            tracing::info!("Nothing to roll back in storage cache");
        }
        Ok(())
    }
Rolls back changes in the storage cache.
core/node/block_reverter/src/lib.rs