Skip to content

Commit

Permalink
fix: agg. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkMagus authored Dec 31, 2023
1 parent 0e28e33 commit 395abc5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/fixed_recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ use crate::cross_table_lookup::{
};
//use crate::verifier::verify_proof;
use crate::generation::GenerationInputs;
use crate::get_challenges::observe_public_values_target;
//use crate::get_challenges::observe_public_values_target;
use crate::proof::{
MemRootsTarget,
Expand All @@ -56,6 +57,7 @@ use crate::recursive_verifier::{
StarkWrapperCircuit,
};
use crate::stark::Stark;
use crate::verifier::verify_proof;
//use crate::util::h256_limbs;

/// The recursion threshold. We end a chain of recursive proofs once we reach this size.
Expand Down Expand Up @@ -469,7 +471,7 @@ where
}
}

//observe_public_values_target::<F, C, D>(&mut challenger, &public_values);
observe_public_values_target::<F, C, D>(&mut challenger, &public_values);

let ctl_challenges = get_grand_product_challenge_set_target(
&mut builder,
Expand Down Expand Up @@ -933,7 +935,7 @@ where
timing: &mut TimingTree,
) -> anyhow::Result<(ProofWithPublicInputs<F, C, D>, PublicValues)> {
let all_proof = prove::<F, C, D>(all_stark, kernel, config, generation_inputs, timing)?;
//verify_proof(&all_stark, all_proof.clone(), &config).unwrap();
verify_proof(&all_stark, all_proof.clone(), &config).unwrap();
let mut root_inputs = PartialWitness::new();

for table in 0..NUM_TABLES {
Expand Down
29 changes: 23 additions & 6 deletions src/recursive_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use crate::lookup::LookupCheckVarsTarget;

use crate::memory::VALUE_LIMBS;
use crate::proof::{
PublicValues, PublicValuesTarget, StarkOpeningSetTarget, StarkProof,
MemRootsTarget, PublicValues, PublicValuesTarget, StarkOpeningSetTarget, StarkProof,
StarkProofChallengesTarget, StarkProofTarget, StarkProofWithMetadata,
};
use crate::stark::Stark;
Expand Down Expand Up @@ -681,8 +681,17 @@ pub(crate) fn add_virtual_public_values<F: RichField + Extendable<D>, const D: u
extra_block_data,
}
*/
let zero = builder.zero();
PublicValuesTarget::from_public_inputs(&[zero, zero])
// let zero = builder.zero();
// PublicValuesTarget::from_public_inputs(&[zero, zero])

PublicValuesTarget {
roots_before: MemRootsTarget {
root: builder.add_virtual_public_input(),
},
roots_after: MemRootsTarget {
root: builder.add_virtual_public_input(),
},
}
}

/*
Expand Down Expand Up @@ -838,14 +847,22 @@ pub(crate) fn set_stark_proof_target<F, C: GenericConfig<D, F = F>, W, const D:
}

pub(crate) fn set_public_value_targets<F, W, const D: usize>(
_witness: &mut W,
_public_values_target: &PublicValuesTarget,
_public_values: &PublicValues,
witness: &mut W,
public_values_target: &PublicValuesTarget,
public_values: &PublicValues,
) -> Result<(), ProgramError>
where
F: RichField + Extendable<D>,
W: Witness<F>,
{
witness.set_target(
public_values_target.roots_before.root,
F::from_canonical_u32(public_values.roots_before.root),
);
witness.set_target(
public_values_target.roots_after.root,
F::from_canonical_u32(public_values.roots_after.root),
);
/*
set_trie_roots_target(
witness,
Expand Down

0 comments on commit 395abc5

Please sign in to comment.