pub async fn get_previous_storage_values(
        &mut self,
        hashed_keys: &[H256],
        next_l1_batch: L1BatchNumber,
    ) -> DalResult<HashMap<H256, Option<H256>>> {
        let (l2_block_number, _) = self
            .storage
            .blocks_dal()
            .get_l2_block_range_of_l1_batch(next_l1_batch)
            .await?
            .unwrap();

        if l2_block_number == L2BlockNumber(0) {
            Ok(hashed_keys.iter().copied().map(|key| (key, None)).collect())
        } else {
            self.get_storage_values(hashed_keys, l2_block_number - 1)
                .await
        }
    }
Gets previous values for the specified storage keys before the specified L1 batch number.

# Return value

The returned map is guaranteed to contain all unique keys from `hashed_keys`.

# Performance

This DB query is slow, especially when used with large `hashed_keys` slices. Prefer using alternatives
wherever possible.
core/lib/dal/src/storage_logs_dal.rs