Skip to content

Commit e957da2

Browse files
committed
chore: add tracing for chunk aggregation
1 parent eae61ba commit e957da2

File tree

1 file changed

+15
-3
lines changed
  • aggregation_mode/src/aggregators

1 file changed

+15
-3
lines changed

aggregation_mode/src/aggregators/mod.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use risc0_aggregator::{
99
use sp1_aggregator::{
1010
AlignedSP1VerificationError, SP1AggregationError, SP1ProofWithPubValuesAndElf,
1111
};
12+
use tracing::info;
1213

1314
const MAX_PROOFS_PER_AGGREGATION: usize = 512;
1415

@@ -78,16 +79,21 @@ impl ZKVMEngine {
7879
})
7980
.collect();
8081

82+
info!("Total proofs to aggregate {}", proofs.len());
8183
let mut agg_proof = if proofs.len() > MAX_PROOFS_PER_AGGREGATION {
8284
let chunks = proofs.chunks(MAX_PROOFS_PER_AGGREGATION);
8385
let mut agg_proofs: Vec<SP1ProofWithPubValuesAndElf> = vec![];
84-
for chunk in chunks {
86+
87+
info!("Proofs length is higher than {}, aggregation will be performed in {} chunks", MAX_PROOFS_PER_AGGREGATION, chunks.len());
88+
for (i, chunk) in chunks.enumerate() {
8589
let agg_proof = sp1_aggregator::aggregate_proofs(chunk, false, false)
8690
.map_err(ProofAggregationError::SP1Aggregation)?;
87-
8891
agg_proofs.push(agg_proof);
92+
93+
info!("Chunk number {} has been aggregated", i);
8994
}
9095

96+
info!("All chunks have been aggregated, performing last aggregation...");
9197
sp1_aggregator::aggregate_proofs(&agg_proofs, true, true)
9298
.map_err(ProofAggregationError::SP1Aggregation)?
9399
} else {
@@ -111,15 +117,21 @@ impl ZKVMEngine {
111117
})
112118
.collect();
113119

120+
info!("Total proofs to aggregate {}", proofs.len());
114121
let agg_proof = if proofs.len() > MAX_PROOFS_PER_AGGREGATION {
115122
let chunks = proofs.chunks(MAX_PROOFS_PER_AGGREGATION);
116123
let mut agg_proofs: Vec<Risc0ProofReceiptAndImageId> = vec![];
117-
for chunk in chunks {
124+
125+
info!("Proofs length is higher than {}, aggregation will be performed in {} chunks", MAX_PROOFS_PER_AGGREGATION, chunks.len());
126+
for (i, chunk) in chunks.enumerate() {
118127
let agg_proof = risc0_aggregator::aggregate_proofs(chunk, false, false)
119128
.map_err(ProofAggregationError::Risc0Aggregation)?;
120129
agg_proofs.push(agg_proof);
130+
131+
info!("Chunk number {} has been aggregated", i);
121132
}
122133

134+
info!("All chunks have been aggregated, performing last aggregation...");
123135
risc0_aggregator::aggregate_proofs(&agg_proofs, true, true)
124136
.map_err(ProofAggregationError::Risc0Aggregation)?
125137
} else {

0 commit comments

Comments
 (0)