Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: AggregationDependencyIntent should include full accumulator_indices #49

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions snark-verifier-sdk/src/halo2/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ use halo2_base::{
utils::fs::read_params,
};

use crate::{CircuitExt, Snark, SHPLONK};
use crate::{Snark, SHPLONK};

use super::{aggregation::AggregationCircuit, gen_dummy_snark_from_vk};

#[derive(Clone, Copy, Debug)]
pub struct AggregationDependencyIntent<'a> {
pub vk: &'a VerifyingKey<G1Affine>,
pub num_instance: &'a [usize],
pub is_aggregation: bool,
pub accumulator_indices: Option<&'a [(usize, usize)]>,
}

#[derive(Clone, Debug)]
pub struct AggregationDependencyIntentOwned {
pub vk: VerifyingKey<G1Affine>,
pub num_instance: Vec<usize>,
pub is_aggregation: bool,
pub accumulator_indices: Option<Vec<(usize, usize)>>,
}

/// This trait should be implemented on the minimal circuit configuration data necessary to
Expand Down Expand Up @@ -63,16 +63,14 @@ pub trait KeygenAggregationCircuitIntent {
let snarks = self
.intent_of_dependencies()
.into_iter()
.map(|AggregationDependencyIntent { vk, num_instance, is_aggregation }| {
.map(|AggregationDependencyIntent { vk, num_instance, accumulator_indices }| {
let k = vk.get_domain().k();
let params = read_params(k);
let accumulator_indices =
is_aggregation.then_some(AggregationCircuit::accumulator_indices().unwrap());
gen_dummy_snark_from_vk::<SHPLONK>(
&params,
vk,
num_instance.to_vec(),
accumulator_indices,
accumulator_indices.map(|v| v.to_vec()),
)
})
.collect();
Expand All @@ -85,7 +83,7 @@ impl<'a> From<&'a AggregationDependencyIntentOwned> for AggregationDependencyInt
Self {
vk: &intent.vk,
num_instance: &intent.num_instance,
is_aggregation: intent.is_aggregation,
accumulator_indices: intent.accumulator_indices.as_deref(),
}
}
}
Loading