async fn poll_for_inclusion(&self) -> anyhow::Result<()> {
        if self.config.inclusion_verification_transition_enabled {
            if let Some(l2_da_validator) = self.transitional_l2_da_validator_address {
                // Setting dummy inclusion data to the batches with the old L2 DA validator is necessary
                // for the transition process. We want to avoid the situation when the batch was sealed
                // but not dispatched to DA layer before transition, and then it will have an inclusion
                // data that is meant to be used with the new L2 DA validator. This will cause the
                // mismatch during the CommitBatches transaction. To avoid that we need to commit that
                // batch with dummy inclusion data during transition.
                let mut conn = self.pool.connection_tagged("da_dispatcher").await?;
                conn.data_availability_dal()
                    .set_dummy_inclusion_data_for_old_batches(l2_da_validator)
                    .await?;
            }

            return Ok(());
        }

        let mut conn = self.pool.connection_tagged("da_dispatcher").await?;
        let blob_info = conn
            .data_availability_dal()
            .get_first_da_blob_awaiting_inclusion()
            .await?;
        drop(conn);

        let Some(blob_info) = blob_info else {
            return Ok(());
        };

        let inclusion_data = if self.config.use_dummy_inclusion_data {
            Some(InclusionData { data: vec![] })
        } else {
            let Some(blob_id) = blob_info.blob_id else {
                anyhow::bail!(
                    "Blob ID is not set for batch_number: {}",
                    blob_info.l1_batch_number
                );
            };

            self.client
                .get_inclusion_data(blob_id.as_str())
                .await
                .with_context(|| {
                    format!(
                        "failed to get inclusion data for blob_id: {}, batch_number: {}",
                        blob_id, blob_info.l1_batch_number
                    )
                })?
        };

        let Some(inclusion_data) = inclusion_data else {
            return Ok(());
        };

        let mut conn = self.pool.connection_tagged("da_dispatcher").await?;
        conn.data_availability_dal()
            .save_l1_batch_inclusion_data(
                L1BatchNumber(blob_info.l1_batch_number.0),
                inclusion_data.data.as_slice(),
            )
            .await?;
        drop(conn);

        let inclusion_latency = Utc::now().signed_duration_since(blob_info.sent_at);
        if let Ok(latency) = inclusion_latency.to_std() {
            METRICS.inclusion_latency.observe(latency);
        }
        METRICS
            .last_included_l1_batch
            .set(blob_info.l1_batch_number.0 as usize);

        tracing::info!(
            "Received an inclusion data for a batch_number: {}, inclusion_latency_seconds: {}",
            blob_info.l1_batch_number,
            inclusion_latency.num_seconds()
        );

        Ok(())
    }
Polls the data availability layer for inclusion data, and saves it in the database.
core/node/da_dispatcher/src/da_dispatcher.rs