pub(super) async fn write_storage_logs(pool: ConnectionPool<Core>, insert_protective_reads: bool) {
    let mut conn = pool.connection().await.unwrap();
    let sealed_batch = conn
        .blocks_dal()
        .get_sealed_l1_batch_number()
        .await
        .unwrap()
        .expect("No L1 batches in storage");
    drop(conn);
    let io = Arc::new(StorageWriterIo {
        last_processed_batch: Arc::new(watch::channel(L1BatchNumber(0)).0),
        last_processed_block: L2BlockNumber(0),
        pool: pool.clone(),
        insert_protective_reads,
    });
    let mut processed_batch = io.last_processed_batch.subscribe();

    let loader = PostgresLoader::new(pool.clone(), L2ChainId::default())
        .await
        .unwrap();
    let loader = Arc::new(loader);
    let batch_executor = MainBatchExecutorFactory::<()>::new(false);
    let vm_runner = VmRunner::new(pool, io.clone(), loader, io, Box::new(batch_executor));
    let (stop_sender, stop_receiver) = watch::channel(false);
    let vm_runner_handle = tokio::spawn(async move { vm_runner.run(&stop_receiver).await });

    let wait_result = processed_batch
        .wait_for(|&number| number >= sealed_batch)
        .await;
    if wait_result.is_err() {
        // If vm runner finished with error then panic with it.
        if vm_runner_handle.is_finished() {
            vm_runner_handle.await.unwrap().unwrap();
        }
        // Otherwise panic with wait error.
        wait_result.unwrap();
    } else {
        stop_sender.send_replace(true);
        vm_runner_handle.await.unwrap().unwrap();
    }
}
Writes missing storage logs into Postgres by executing all transactions from it. Useful both for testing `VmRunner`,
and to fill the storage for multi-batch tests for other components.
core/node/vm_runner/src/tests/storage_writer.rs