pub async fn resolve_l1_batch_number_of_l2_block(
        &mut self,
        l2_block_number: L2BlockNumber,
    ) -> DalResult<ResolvedL1BatchForL2Block> {
        let row = sqlx::query!(
            r#"
            SELECT
                (
                    SELECT
                        l1_batch_number
                    FROM
                        miniblocks
                    WHERE
                        number = $1
                ) AS "block_batch?",
                COALESCE(
                    (
                        SELECT
                            MAX(number) + 1
                        FROM
                            l1_batches
                        WHERE
                            is_sealed
                    ),
                    (
                        SELECT
                            MAX(l1_batch_number) + 1
                        FROM
                            snapshot_recovery
                    ),
                    0
                ) AS "pending_batch!"
            "#,
            i64::from(l2_block_number.0)
        )
        .instrument("resolve_l1_batch_number_of_l2_block")
        .with_arg("l2_block_number", &l2_block_number)
        .fetch_one(self.storage)
        .await?;

        Ok(ResolvedL1BatchForL2Block {
            block_l1_batch: row.block_batch.map(|n| L1BatchNumber(n as u32)),
            pending_l1_batch: L1BatchNumber(row.pending_batch as u32),
        })
    }
Provides information about the L1 batch that the specified L2 block is a part of.
Assumes that the L2 block is present in the DB; this is not checked, and if this is false,
the returned value will be meaningless.
core/lib/dal/src/storage_web3_dal.rs