Skip to content

Commit 9dbd8db

Browse files
4l0n50Nashtare
andauthored
Recover lens for types implementing the Recursive trait. (#132)
* Remove lens * Remove lens * Apply suggestion from @Nashtare Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com> * Remove commented derive * Fmt --------- Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
1 parent 87b657f commit 9dbd8db

File tree

5 files changed

+66
-299
lines changed

5 files changed

+66
-299
lines changed

recursion/src/circuit_verifier.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -418,41 +418,24 @@ mod tests {
418418
impl<F: Field, EF: ExtensionField<F>> Recursive<EF> for DummyCom<F> {
419419
type Input = Vec<Vec<F>>;
420420

421-
fn new(
422-
_circuit: &mut CircuitBuilder<EF>,
423-
_lens: &mut impl Iterator<Item = usize>,
424-
_degree_bits: usize,
425-
) -> Self {
421+
fn new(_circuit: &mut CircuitBuilder<EF>, _input: &Self::Input) -> Self {
426422
vec![]
427423
}
428424

429425
fn get_values(input: &Self::Input) -> Vec<EF> {
430426
input.iter().flatten().map(|v| EF::from(*v)).collect()
431427
}
432-
433-
fn lens(_input: &Self::Input) -> impl Iterator<Item = usize> {
434-
core::iter::empty()
435-
}
436428
}
437429

438430
type EmptyTarget = ();
439431
impl<F: Field> Recursive<F> for EmptyTarget {
440432
type Input = ();
441433

442-
fn new(
443-
_circuit: &mut p3_circuit::CircuitBuilder<F>,
444-
_lens: &mut impl Iterator<Item = usize>,
445-
_degree_bits: usize,
446-
) -> Self {
447-
}
434+
fn new(_circuit: &mut p3_circuit::CircuitBuilder<F>, _input: &Self::Input) -> Self {}
448435

449436
fn get_values(_input: &Self::Input) -> vec::Vec<F> {
450437
vec![]
451438
}
452-
453-
fn lens(_input: &Self::Input) -> impl Iterator<Item = usize> {
454-
core::iter::empty()
455-
}
456439
}
457440

458441
impl<SC: StarkGenericConfig, Comm: Recursive<SC::Challenge>, Dft>
@@ -717,19 +700,13 @@ mod tests {
717700
proof.commitments.quotient_chunks = vec![];
718701
proof.commitments.trace = vec![];
719702

720-
let mut all_lens = ProofTargets::<
721-
StarkConfig<TrivialPcs<Val, Dft>, Challenge, Challenger>,
722-
DummyCom<Val>,
723-
EmptyTarget,
724-
>::lens(&proof);
725-
726703
// Initialize the circuit builder.
727704
let mut circuit_builder = CircuitBuilder::new();
728705
let proof_targets = ProofTargets::<
729706
StarkConfig<TrivialPcs<Val, Dft>, Challenge, Challenger>,
730707
DummyCom<Val>,
731708
EmptyTarget,
732-
>::new(&mut circuit_builder, &mut all_lens, proof.degree_bits);
709+
>::new(&mut circuit_builder, &proof);
733710

734711
let proof_values = ProofTargets::<
735712
StarkConfig<TrivialPcs<Val, Dft>, Challenge, Challenger>,

recursion/src/public_inputs.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,7 @@ where
305305
.collect();
306306

307307
// Allocate proof targets
308-
let mut lens = crate::recursive_traits::ProofTargets::<SC, Comm, OpeningProof>::lens(proof);
309-
let proof_targets =
310-
crate::recursive_traits::ProofTargets::new(circuit, &mut lens, proof.degree_bits);
308+
let proof_targets = crate::recursive_traits::ProofTargets::new(circuit, proof);
311309

312310
Self {
313311
air_public_targets,

0 commit comments

Comments
 (0)