pub async fn insert_initial_writes_for_batch(
    connection: &mut Connection<'_, Core>,
    l1_batch_number: L1BatchNumber,
) {
    let mut written_non_zero_slots: Vec<_> = connection
        .storage_logs_dal()
        .get_touched_slots_for_executed_l1_batch(l1_batch_number)
        .await
        .unwrap()
        .into_iter()
        .filter_map(|(key, value)| (!value.is_zero()).then_some(key))
        .collect();
    written_non_zero_slots.sort_unstable();

    let hashed_keys: Vec<_> = written_non_zero_slots
        .iter()
        .map(|key| key.hashed_key())
        .collect();
    let pre_written_slots = connection
        .storage_logs_dedup_dal()
        .filter_written_slots(&hashed_keys)
        .await
        .unwrap();

    let keys_to_insert: Vec<_> = written_non_zero_slots
        .into_iter()
        .filter(|key| !pre_written_slots.contains(&key.hashed_key()))
        .map(|key| key.hashed_key())
        .collect();
    connection
        .storage_logs_dedup_dal()
        .insert_initial_writes(l1_batch_number, &keys_to_insert)
        .await
        .unwrap();
}
Inserts initial writes for the specified L1 batch based on storage logs.
core/node/test_utils/src/lib.rs