Skip to content

Commit

Permalink
feat(witness-generator): add logs to leaf aggregation job (#542)
Browse files Browse the repository at this point in the history
## What ❔

Add some log lines to leaf aggreagtion prover job

## Why ❔

It doesn't save anything to the database and I want to understand why
  • Loading branch information
RomanBrodetski authored Nov 25, 2023
1 parent 9ced921 commit 7e95a3a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions prover/witness_generator/src/leaf_aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ impl JobProcessor for LeafAggregationWitnessGenerator {
let block_number = artifacts.block_number;
let circuit_id = artifacts.circuit_id;
let blob_urls = save_artifacts(artifacts, &*self.object_store).await;
tracing::info!(
"Saved leaf aggregation artifacts for block {} with circuit {}",
block_number.0,
circuit_id,
);
update_database(
&self.prover_connection_pool,
started_at,
Expand Down Expand Up @@ -266,13 +271,26 @@ async fn update_database(
blob_urls: BlobUrls,
circuit_id: u8,
) {
tracing::info!(
"Updating database for job_id {}, block {} with circuit id {}",
job_id,
block_number.0,
circuit_id,
);
let mut prover_connection = prover_connection_pool.access_storage().await.unwrap();
let mut transaction = prover_connection.start_transaction().await.unwrap();
let number_of_dependent_jobs = blob_urls.circuit_ids_and_urls.len();
let protocol_version_id = transaction
.fri_witness_generator_dal()
.protocol_version_for_l1_batch(block_number)
.await;
tracing::info!(
"Inserting {} prover jobs for job_id {}, block {} with circuit id {}",
blob_urls.circuit_ids_and_urls.len(),
job_id,
block_number.0,
circuit_id,
);
transaction
.fri_prover_jobs_dal()
.insert_prover_jobs(
Expand All @@ -283,6 +301,12 @@ async fn update_database(
protocol_version_id,
)
.await;
tracing::info!(
"Updating node aggregation jobs url for job_id {}, block {} with circuit id {}",
job_id,
block_number.0,
circuit_id,
);
transaction
.fri_witness_generator_dal()
.update_node_aggregation_jobs_url(
Expand All @@ -293,11 +317,23 @@ async fn update_database(
blob_urls.aggregations_urls,
)
.await;
tracing::info!(
"Marking leaf aggregation job as successful for job id {}, block {} with circuit id {}",
job_id,
block_number.0,
circuit_id,
);
transaction
.fri_witness_generator_dal()
.mark_leaf_aggregation_as_successful(job_id, started_at.elapsed())
.await;

tracing::info!(
"Committing transaction for job_id {}, block {} with circuit id {}",
job_id,
block_number.0,
circuit_id,
);
transaction.commit().await.unwrap();
}

Expand Down

0 comments on commit 7e95a3a

Please sign in to comment.