pub async fn get_next_basic_circuit_witness_job(
        &mut self,
        protocol_version: ProtocolSemanticVersion,
        picked_by: &str,
    ) -> Option<L1BatchId> {
        sqlx::query!(
            r#"
            UPDATE witness_inputs_fri
            SET
                status = 'in_progress',
                attempts = attempts + 1,
                updated_at = NOW(),
                processing_started_at = NOW(),
                picked_by = $2
            WHERE
                (l1_batch_number, chain_id) IN (
                    SELECT
                        l1_batch_number,
                        chain_id
                    FROM
                        witness_inputs_fri
                    WHERE
                        status = 'queued'
                        AND protocol_version = $1
                        AND protocol_version_patch = $3
                    ORDER BY
                        priority DESC,
                        batch_sealed_at ASC
                    LIMIT
                        1
                    FOR UPDATE
                    SKIP LOCKED
                )
            RETURNING
            witness_inputs_fri.l1_batch_number,
            witness_inputs_fri.chain_id
            "#,
            protocol_version.minor as i32,
            picked_by,
            protocol_version.patch.0 as i32,
        )
        .fetch_optional(self.storage.conn())
        .await
        .unwrap()
        .map(|row| L1BatchId::from_raw(row.chain_id as u64, row.l1_batch_number as u32))
    }
Gets the next job to be executed. Returns the batch number and its corresponding blobs.
The blobs arrive from core via prover gateway, as pubdata, this method loads the blobs.
prover/crates/lib/prover_dal/src/fri_witness_generator_dal/basic.rs