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

Commit 8319ade

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

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

aggregator/src/aggregation/circuit.rs

+3-17
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 {
@@ -381,12 +375,6 @@ impl Circuit<Fr> for AggregationCircuit {
381375

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

384-
layouter.constrain_instance(
385-
num_valid_snarks.cell(),
386-
config.instance,
387-
DIGEST_LEN + ACC_LEN,
388-
)?;
389-
390378
end_timer!(witness_time);
391379
Ok(())
392380
}
@@ -396,13 +384,11 @@ impl CircuitExt<Fr> for AggregationCircuit {
396384
fn num_instance(&self) -> Vec<usize> {
397385
// 12 elements from accumulator
398386
// 32 elements from batch's public_input_hash
399-
// 1 element for # of valid chunks
400-
vec![ACC_LEN + DIGEST_LEN + 1]
387+
vec![ACC_LEN + DIGEST_LEN]
401388
}
402389

403390
// 12 elements from accumulator
404391
// 32 elements from batch's public_input_hash
405-
// 1 element for # of valid chunks
406392
fn instances(&self) -> Vec<Vec<Fr>> {
407393
vec![self.flattened_instances.clone()]
408394
}

0 commit comments

Comments
 (0)