pub async fn run(self, stop_receiver: watch::Receiver<bool>) -> anyhow::Result<()> {
        let decision = self.decision().await?;

        // Make sure that we have state to work with.
        match decision {
            InitDecision::Genesis => {
                tracing::info!("Performing genesis initialization");
                try_stoppable!(
                    self.strategy
                        .genesis
                        .initialize_storage(stop_receiver.clone())
                        .await
                );
            }
            InitDecision::SnapshotRecovery => {
                tracing::info!("Performing snapshot recovery initialization");
                if let Some(recovery) = &self.strategy.snapshot_recovery {
                    try_stoppable!(recovery.initialize_storage(stop_receiver.clone()).await);
                } else {
                    anyhow::bail!(
                        "Snapshot recovery should be performed, but the strategy is not provided. \
                        In most of the cases this error means that the node was first started \
                        with snapshots recovery enabled, but then it was disabled. \
                        To get rid of this error and have the node sync from genesis \
                        please clear the Node's database"
                    );
                }
            }
        }

        // Now we may check whether we're in the invalid state and should perform a rollback.
        if let Some(reverter) = &self.strategy.block_reverter {
            if let Some(to_batch) =
                try_stoppable!(reverter.last_correct_batch_for_reorg(stop_receiver).await)
            {
                tracing::info!(l1_batch = %to_batch, "State must be rolled back to L1 batch");
                tracing::info!("Performing the rollback");
                reverter.revert_storage(to_batch).await?;
            }
        }

        Ok(())
    }
Initializes the storage for the node.
After the initialization, the node can safely start operating.
core/node/node_storage_init/src/lib.rs