pub async fn get_optional_l1_batch_metadata(
        &mut self,
        number: L1BatchNumber,
    ) -> DalResult<Option<L1BatchWithOptionalMetadata>> {
        let Some(l1_batch) = self.get_storage_l1_batch(number).await? else {
            return Ok(None);
        };

        let l2_to_l1_logs = self
            .get_l2_to_l1_logs_for_batch::<UserL2ToL1Log>(number)
            .await?;
        Ok(Some(L1BatchWithOptionalMetadata {
            header: l1_batch
                .clone()
                .into_l1_batch_header_with_logs(l2_to_l1_logs),
            metadata: l1_batch.try_into(),
        }))
    }
Returns the header and optional metadata for an L1 batch with the specified number. If a batch exists
but does not have all metadata, it's possible to inspect which metadata is missing.
core/lib/dal/src/blocks_dal.rs