Skip to content

Commit 7a1e04c

Browse files
committed
refactor: juli's comments
1 parent c90d9f4 commit 7a1e04c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

aggregation_mode/proof_aggregator/src/backend/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl Db {
2323
Ok(Self { pool })
2424
}
2525

26-
pub async fn get_pending_tasks_and_mark_them_as_processed(
26+
pub async fn get_pending_tasks_and_mark_them_as_processing(
2727
&self,
2828
proving_system_id: i64,
2929
limit: i64,

aggregation_mode/proof_aggregator/src/backend/fetcher.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ impl ProofsFetcher {
3030
) -> Result<(Vec<AlignedProof>, Vec<Uuid>), ProofsFetcherError> {
3131
let tasks = self
3232
.db
33-
.get_pending_tasks_and_mark_them_as_processed(engine.proving_system_id() as i64, limit)
33+
.get_pending_tasks_and_mark_them_as_processing(engine.proving_system_id() as i64, limit)
3434
.await
3535
.map_err(ProofsFetcherError::Query)?;
3636

37-
let (tasks_id, proofs_to_aggregate): (Vec<Uuid>, Vec<AlignedProof>) = match engine {
37+
let (proofs_to_aggregate, tasks_id): (Vec<Uuid>, Vec<AlignedProof>) = match engine {
3838
ZKVMEngine::SP1 => {
39-
let pairs: Vec<(Uuid, AlignedProof)> = tasks
39+
let pairs: Vec<(AlignedProof, Uuid)> = tasks
4040
.into_par_iter()
4141
.filter_map(|task| {
4242
let vk = bincode::deserialize(&task.program_commitment).ok()?;
4343
let proof_with_pub_values = bincode::deserialize(&task.proof).ok()?;
4444

4545
match SP1ProofWithPubValuesAndVk::new(proof_with_pub_values, vk) {
46-
Ok(proof) => Some((task.task_id, AlignedProof::SP1(proof.into()))),
46+
Ok(proof) => Some((AlignedProof::SP1(proof.into()), task.task_id)),
4747
Err(err) => {
4848
error!("Could not add proof, verification failed: {:?}", err);
4949
None
@@ -55,7 +55,7 @@ impl ProofsFetcher {
5555
pairs.into_iter().unzip()
5656
}
5757
ZKVMEngine::RISC0 => {
58-
let pairs: Vec<(Uuid, AlignedProof)> = tasks
58+
let pairs: Vec<(AlignedProof, Uuid)> = tasks
5959
.into_par_iter()
6060
.filter_map(|task| {
6161
let mut image_id = [0u8; 32];
@@ -66,7 +66,7 @@ impl ProofsFetcher {
6666
let risc0_proof = Risc0ProofReceiptAndImageId::new(image_id, receipt);
6767

6868
match risc0_proof {
69-
Ok(proof) => Some((task.task_id, AlignedProof::Risc0(proof.into()))),
69+
Ok(proof) => Some((AlignedProof::Risc0(proof.into()), task.task_id)),
7070
Err(err) => {
7171
error!("Could not add proof, verification failed: {:?}", err);
7272
None

0 commit comments

Comments
 (0)