Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit f12d26c

Browse files
lispckunxian-xia
andauthored
remove num_of_chunks in aggregation circuit's instance column (#704)
Co-authored-by: kunxian xia <[email protected]>
1 parent dc5ffa0 commit f12d26c

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

aggregator/src/aggregation/circuit.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub struct AggregationCircuit {
4949
// the public instance for this circuit consists of
5050
// - an accumulator (12 elements)
5151
// - the batch's public_input_hash (32 elements)
52-
// - the number of snarks that is aggregated (1 element)
5352
pub flattened_instances: Vec<Fr>,
5453
// accumulation scheme proof, private input
5554
pub as_proof: Value<Vec<u8>>,
@@ -107,13 +106,8 @@ impl AggregationCircuit {
107106
// the public instance for this circuit consists of
108107
// - an accumulator (12 elements)
109108
// - the batch's public_input_hash (32 elements)
110-
// - the number of snarks that is aggregated (1 element)
111-
let flattened_instances: Vec<Fr> = [
112-
acc_instances.as_slice(),
113-
public_input_hash.as_slice(),
114-
&[Fr::from(batch_hash.number_of_valid_chunks as u64)],
115-
]
116-
.concat();
109+
let flattened_instances: Vec<Fr> =
110+
[acc_instances.as_slice(), public_input_hash.as_slice()].concat();
117111

118112
end_timer!(timer);
119113
Ok(Self {
@@ -379,12 +373,6 @@ impl Circuit<Fr> for AggregationCircuit {
379373

380374
log::trace!("number of valid snarks: {:?}", num_valid_snarks.value());
381375

382-
layouter.constrain_instance(
383-
num_valid_snarks.cell(),
384-
config.instance,
385-
DIGEST_LEN + ACC_LEN,
386-
)?;
387-
388376
end_timer!(witness_time);
389377
Ok(())
390378
}
@@ -394,13 +382,11 @@ impl CircuitExt<Fr> for AggregationCircuit {
394382
fn num_instance(&self) -> Vec<usize> {
395383
// 12 elements from accumulator
396384
// 32 elements from batch's public_input_hash
397-
// 1 element for # of valid chunks
398-
vec![ACC_LEN + DIGEST_LEN + 1]
385+
vec![ACC_LEN + DIGEST_LEN]
399386
}
400387

401388
// 12 elements from accumulator
402389
// 32 elements from batch's public_input_hash
403-
// 1 element for # of valid chunks
404390
fn instances(&self) -> Vec<Vec<Fr>> {
405391
vec![self.flattened_instances.clone()]
406392
}

0 commit comments

Comments
 (0)