Skip to content

Commit

Permalink
Post cherrypicking conflict resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilLuta committed May 12, 2024
1 parent 7fb20fe commit 6dd21bb
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 90 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions prover/prover_dal/src/fri_proof_compressor_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
65 changes: 0 additions & 65 deletions prover/prover_dal/src/fri_prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProverJobFriInfo> {
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()
}
}

0 comments on commit 6dd21bb

Please sign in to comment.