pub async fn get_blob_data_by_blob_id(
        &mut self,
        blob_id: &str,
    ) -> DalResult<Option<L1BatchDA>> {
        let row = sqlx::query!(
            r#"
            SELECT
                number,
                pubdata_input,
                system_logs,
                sealed_at
            FROM
                l1_batches
            LEFT JOIN
                data_availability
                ON data_availability.l1_batch_number = l1_batches.number
            WHERE
                number != 0
                AND data_availability.blob_id = $1
            ORDER BY
                number
            LIMIT
                1
            "#,
            blob_id,
        )
        .instrument("get_blob_data_by_blob_id")
        .with_arg("blob_id", &blob_id)
        .fetch_optional(self.storage)
        .await?
        .map(|row| L1BatchDA {
            // `unwrap` is safe here because we have a `WHERE` clause that filters out `NULL` values
            pubdata: row.pubdata_input.unwrap(),
            l1_batch_number: L1BatchNumber(row.number as u32),
            sealed_at: row.sealed_at.unwrap().and_utc(),
            system_logs: row
                .system_logs
                .into_iter()
                .map(|raw_log| L2ToL1Log::from_slice(&raw_log))
                .collect(),
        });

        Ok(row)
    }
Fetches the pubdata for the L1 batch with a given blob id.
core/lib/dal/src/data_availability_dal.rs