Skip to content

Commit

Permalink
refactor: Tidying up changes after #677 (#690)
Browse files Browse the repository at this point in the history
That PR was on auto-merge.
  • Loading branch information
huitseeker authored Sep 20, 2023
1 parent fe65ab4 commit ee2f0f4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
40 changes: 15 additions & 25 deletions src/circuit/circuit_frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,19 @@ impl<'a, F: LurkField, C: Coprocessor<F>> CircuitFrame<'a, F, C> {

impl<'a, F: LurkField, C: Coprocessor<F>> MultiFrame<'a, F, C> {
pub fn blank(folding_config: Arc<FoldingConfig<F, C>>, meta: Meta<F>) -> Self {
match meta {
Meta::Lurk => Self {
store: None,
input: None,
output: None,
frames: None,
cached_witness: None,
count: folding_config.reduction_count(),
folding_config,
meta,
},
Meta::Coprocessor(_z_ptr) => Self {
store: None,
input: None,
output: None,
frames: None,
cached_witness: None,
count: 1,
folding_config,
meta,
},
let count = match meta {
Meta::Lurk => folding_config.reduction_count(),
Meta::Coprocessor(_zptr) => 1,
};
Self {
store: None,
input: None,
output: None,
frames: None,
cached_witness: None,
count,
folding_config,
meta,
}
}

Expand Down Expand Up @@ -141,9 +133,7 @@ impl<'a, F: LurkField, C: Coprocessor<F>> MultiFrame<'a, F, C> {

for x in chunk {
let circuit_frame = CircuitFrame::from_frame(x, store);
if meta.is_none() {
meta = Some(x.meta);
}
meta.get_or_insert(x.meta);
inner_frames.push(circuit_frame);
}

Expand Down Expand Up @@ -471,6 +461,7 @@ impl<
type AllocatedIO<F> = (AllocatedPtr<F>, AllocatedPtr<F>, AllocatedContPtr<F>);

impl<F: LurkField, C: Coprocessor<F>> CircuitFrame<'_, F, C> {
#[tracing::instrument(skip_all, name = "CircuitFrame::synthesize", level = "debug")]
pub(crate) fn synthesize<CS: ConstraintSystem<F>>(
&self,
cs: &mut CS,
Expand All @@ -483,7 +474,6 @@ impl<F: LurkField, C: Coprocessor<F>> CircuitFrame<'_, F, C> {
cont_circuit_witness: Option<ContCircuitWitness<F>>,
) -> Result<AllocatedIO<F>, SynthesisError> {
let (input_expr, input_env, input_cont) = inputs;
debug!("synthesizing frame");
let reduce = |store| {
let cons_circuit_witness = if let Some(ccw) = cons_circuit_witness {
ccw
Expand Down
2 changes: 1 addition & 1 deletion src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl<'a, F: LurkField, C: Coprocessor<F>> StepCircuit<F> for MultiFrame<'a, F, C
.folding_config
.lang()
.get_coprocessor_from_zptr(&z_ptr)
.expect("coprocessor missing");
.expect("coprocessor not found for a frame that requires one");
match self.frames.as_ref() {
Some(frames) => {
assert_eq!(1, frames.len());
Expand Down
1 change: 1 addition & 0 deletions src/proof/supernova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ where
{
pp: SuperNovaPublicParams<F>,
// SuperNova does not yet have a `CompressedSNARK`.
// see https://github.com/lurk-lab/arecibo/issues/27
// pk: ProverKey<G1<F>, G2<F>, C1<'a, F, C>, C2<F>, SS1<F>, SS2<F>>,
// vk: VerifierKey<G1<F>, G2<F>, C1<'a, F, C>, C2<F>, SS1<F>, SS2<F>>,
_p: PhantomData<C>,
Expand Down

0 comments on commit ee2f0f4

Please sign in to comment.