diff --git a/prover/prover_dal/.sqlx/query-2ab2f83b273c5aa88c1eefc8f70a8ea23052f714cd74c1d28ae1203ce8f0eaa9.json b/prover/prover_dal/.sqlx/query-c2c140d136df5303d7b3a66ccd0d34a5baece02812f8c950fc84d37eeebd33a4.json similarity index 57% rename from prover/prover_dal/.sqlx/query-2ab2f83b273c5aa88c1eefc8f70a8ea23052f714cd74c1d28ae1203ce8f0eaa9.json rename to prover/prover_dal/.sqlx/query-c2c140d136df5303d7b3a66ccd0d34a5baece02812f8c950fc84d37eeebd33a4.json index 529709763eb9..7ced88426e4d 100644 --- a/prover/prover_dal/.sqlx/query-2ab2f83b273c5aa88c1eefc8f70a8ea23052f714cd74c1d28ae1203ce8f0eaa9.json +++ b/prover/prover_dal/.sqlx/query-c2c140d136df5303d7b3a66ccd0d34a5baece02812f8c950fc84d37eeebd33a4.json @@ -1,88 +1,131 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n *\n FROM\n proof_compression_jobs_fri\n WHERE\n l1_batch_number = $1\n ", + "query": "\n SELECT\n *\n FROM\n prover_jobs_fri\n WHERE\n l1_batch_number = $1\n AND aggregation_round = $2\n ", "describe": { "columns": [ { "ordinal": 0, - "name": "l1_batch_number", + "name": "id", "type_info": "Int8" }, { "ordinal": 1, - "name": "attempts", - "type_info": "Int2" + "name": "l1_batch_number", + "type_info": "Int8" }, { "ordinal": 2, - "name": "status", - "type_info": "Text" + "name": "circuit_id", + "type_info": "Int2" }, { "ordinal": 3, - "name": "fri_proof_blob_url", + "name": "circuit_blob_url", "type_info": "Text" }, { "ordinal": 4, - "name": "l1_proof_blob_url", - "type_info": "Text" + "name": "aggregation_round", + "type_info": "Int2" }, { "ordinal": 5, - "name": "error", - "type_info": "Text" + "name": "sequence_number", + "type_info": "Int4" }, { "ordinal": 6, - "name": "created_at", - "type_info": "Timestamp" + "name": "status", + "type_info": "Text" }, { "ordinal": 7, - "name": "updated_at", - "type_info": "Timestamp" + "name": "error", + "type_info": "Text" }, { "ordinal": 8, + "name": "attempts", + "type_info": "Int2" + }, + { + "ordinal": 9, "name": "processing_started_at", "type_info": "Timestamp" }, { - "ordinal": 9, + "ordinal": 10, + "name": "created_at", + "type_info": "Timestamp" + }, + { + "ordinal": 11, + "name": "updated_at", + "type_info": "Timestamp" + }, + { + "ordinal": 12, "name": "time_taken", "type_info": "Time" }, { - "ordinal": 10, - "name": "picked_by", + "ordinal": 13, + "name": "is_blob_cleaned", + "type_info": "Bool" + }, + { + "ordinal": 14, + "name": "depth", + "type_info": "Int4" + }, + { + "ordinal": 15, + "name": "is_node_final_proof", + "type_info": "Bool" + }, + { + "ordinal": 16, + "name": "proof_blob_url", "type_info": "Text" }, { - "ordinal": 11, + "ordinal": 17, "name": "protocol_version", "type_info": "Int4" + }, + { + "ordinal": 18, + "name": "picked_by", + "type_info": "Text" } ], "parameters": { "Left": [ - "Int8" + "Int8", + "Int2" ] }, "nullable": [ + false, + false, + false, + false, false, false, false, true, - true, + false, true, false, false, true, true, + false, + false, + true, true, true ] }, - "hash": "2ab2f83b273c5aa88c1eefc8f70a8ea23052f714cd74c1d28ae1203ce8f0eaa9" + "hash": "c2c140d136df5303d7b3a66ccd0d34a5baece02812f8c950fc84d37eeebd33a4" } diff --git a/prover/prover_dal/src/fri_proof_compressor_dal.rs b/prover/prover_dal/src/fri_proof_compressor_dal.rs index dec01d202a8a..311ac83ddac2 100644 --- a/prover/prover_dal/src/fri_proof_compressor_dal.rs +++ b/prover/prover_dal/src/fri_proof_compressor_dal.rs @@ -5,9 +5,7 @@ use sqlx::Row; use strum::{Display, EnumString}; use zksync_basic_types::{ protocol_version::ProtocolVersionId, - prover_dal::{ - JobCountStatistics, ProofCompressionJobInfo, ProofCompressionJobStatus, StuckJobs, - }, + prover_dal::{JobCountStatistics, StuckJobs}, L1BatchNumber, }; use zksync_db_connection::connection::Connection; diff --git a/prover/prover_dal/src/fri_prover_dal.rs b/prover/prover_dal/src/fri_prover_dal.rs index cb31298bb448..3575dd267082 100644 --- a/prover/prover_dal/src/fri_prover_dal.rs +++ b/prover/prover_dal/src/fri_prover_dal.rs @@ -640,69 +640,4 @@ impl FriProverDal<'_, '_> { .map(|row| (row.circuit_id as u8, row.id as u32)) .collect() } - - pub async fn get_prover_jobs_stats_for_batch( - &mut self, - l1_batch_number: L1BatchNumber, - aggregation_round: AggregationRound, - ) -> Vec { - sqlx::query!( - r#" - SELECT - * - FROM - prover_jobs_fri - WHERE - l1_batch_number = $1 - AND aggregation_round = $2 - "#, - i64::from(l1_batch_number.0), - aggregation_round as i16 - ) - .fetch_all(self.storage.conn()) - .await - .unwrap() - .iter() - .map(|row| ProverJobFriInfo { - id: row.id as u32, - l1_batch_number, - circuit_id: row.circuit_id as u32, - circuit_blob_url: row.circuit_blob_url.clone(), - aggregation_round, - sequence_number: row.sequence_number as u32, - status: ProverJobStatus::from_str(&row.status).unwrap(), - error: row.error.clone(), - attempts: row.attempts as u8, - processing_started_at: row.processing_started_at, - created_at: row.created_at, - updated_at: row.updated_at, - time_taken: row.time_taken, - is_blob_cleaned: row.is_blob_cleaned, - depth: row.depth as u32, - is_node_final_proof: row.is_node_final_proof, - proof_blob_url: row.proof_blob_url.clone(), - protocol_version: row.protocol_version.map(|protocol_version| { - ProtocolVersionId::try_from(protocol_version as u16).unwrap() - }), - picked_by: row.picked_by.clone(), - }) - .collect() - } - - pub async fn protocol_version_for_job(&mut self, job_id: u32) -> ProtocolVersionId { - sqlx::query!( - r#" - SELECT protocol_version - FROM prover_jobs_fri - WHERE id = $1 - "#, - job_id as i32 - ) - .fetch_one(self.storage.conn()) - .await - .unwrap() - .protocol_version - .map(|id| ProtocolVersionId::try_from(id as u16).unwrap()) - .unwrap() - } }