@@ -287,11 +287,29 @@ impl<const N_SNARKS: usize> Circuit<Fr> for BatchCircuit<N_SNARKS> {
287
287
& self . snarks_with_padding ,
288
288
self . as_proof ( ) ,
289
289
) ;
290
- let mut ctx = Rc :: into_inner ( loader) . unwrap ( ) . into_ctx ( ) ;
290
+
291
+ // extract the following cells for later constraints
292
+ // - the accumulators
293
+ // - the public inputs from each snark
294
+ accumulator_instances. extend ( flatten_accumulator ( acc) . iter ( ) . copied ( ) ) ;
295
+ // the snark is not a fresh one, assigned_instances already contains an
296
+ // accumulator so we want to skip the first 12 elements from the public
297
+ // input
298
+ snark_inputs. extend (
299
+ assigned_aggregation_instances
300
+ . iter ( )
301
+ . flat_map ( |instance_column| instance_column. iter ( ) . skip ( ACC_LEN ) ) ,
302
+ ) ;
291
303
for ( i, e) in assigned_aggregation_instances[ 0 ] . iter ( ) . enumerate ( ) {
292
304
log:: trace!( "{}-th instance: {:?}" , i, e. value)
293
305
}
294
306
307
+ loader
308
+ . ctx_mut ( )
309
+ . print_stats ( & [ "snark aggregation" ] ) ;
310
+
311
+ let mut ctx = Rc :: into_inner ( loader) . unwrap ( ) . into_ctx ( ) ;
312
+
295
313
// We must ensure that the commitments to preprocessed polynomial and initial
296
314
// state of transcripts for every SNARK that is being aggregated belongs to the
297
315
// fixed set of values expected.
@@ -402,20 +420,7 @@ impl<const N_SNARKS: usize> Circuit<Fr> for BatchCircuit<N_SNARKS> {
402
420
. assert_is_const ( & mut ctx, & transcript_check, Fr :: ONE ) ;
403
421
}
404
422
405
- // extract the following cells for later constraints
406
- // - the accumulators
407
- // - the public inputs from each snark
408
- accumulator_instances. extend ( flatten_accumulator ( acc) . iter ( ) . copied ( ) ) ;
409
- // the snark is not a fresh one, assigned_instances already contains an
410
- // accumulator so we want to skip the first 12 elements from the public
411
- // input
412
- snark_inputs. extend (
413
- assigned_aggregation_instances
414
- . iter ( )
415
- . flat_map ( |instance_column| instance_column. iter ( ) . skip ( ACC_LEN ) ) ,
416
- ) ;
417
-
418
- ctx. print_stats ( & [ "snark aggregation [chunks -> batch]" ] ) ;
423
+ ctx. print_stats ( & [ "protocol check" ] ) ;
419
424
420
425
log:: debug!( "batching: assigning barycentric" ) ;
421
426
let barycentric = config. barycentric . assign (
0 commit comments