Skip to content

Commit

Permalink
add L to pex, and L=0 to constants to make it compile without using y…
Browse files Browse the repository at this point in the history
…et the POD1-Introducer recursive verifier
  • Loading branch information
arnaucube committed Dec 2, 2024
1 parent 758e70f commit 697db77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions constants/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub const NS: usize = 10; // Max number of statements in a POD
pub const VL: usize = 10; // Max length of vectors
pub const L: usize = 0; // Max number of POD1-Introducer (1 level recursion) verifications
pub const M: usize = 2; // Max number of Schnorr POD
pub const N: usize = 2; // Max number of recursive proof verification in the creation of a POD
10 changes: 5 additions & 5 deletions pex/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod macros;
mod pex_constants;
use constants::{M, N, NS, VL};
use constants::{L, M, N, NS, VL};
pub mod repl;
pub mod store;

Expand All @@ -26,7 +26,7 @@ use plonky2::{
use pod2::{
pod::{
entry::Entry,
gadget::{plonky_pod::ProverParams, GadgetID, PlonkyButNotPlonkyGadget},
gadget::{plonky_pod::ProverParams, GadgetID},
origin::Origin,
payload::HashablePayload,
statement::{AnchoredKey, StatementRef},
Expand Down Expand Up @@ -214,7 +214,7 @@ pub struct Env {
bindings: Arc<Mutex<HashMap<String, Value>>>,
sk: Option<SchnorrSecretKey>,
script_id: Option<ScriptId>,
prover_params: Option<Arc<Mutex<ProverParams<M, N, NS, VL>>>>,
prover_params: Option<Arc<Mutex<ProverParams<L, M, N, NS, VL>>>>,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -744,7 +744,7 @@ impl PodBuilder {
.collect::<Vec<OpCmd>>()[..];
if let Some(prover_params) = &env.prover_params {
let mut params = prover_params.lock().unwrap();
POD::execute_plonky_gadget::<M, N, NS, VL>(&mut params, &gpg_input, pending_ops)
POD::execute_plonky_gadget::<L, M, N, NS, VL>(&mut params, &gpg_input, pending_ops)
} else {
POD::execute_oracle_gadget(&gpg_input, pending_ops)
}
Expand All @@ -759,7 +759,7 @@ impl Env {
pod_store: Arc<Mutex<MyPods>>,
sk: Option<SchnorrSecretKey>,
script_id: Option<ScriptId>,
prover_params: Option<Arc<Mutex<ProverParams<M, N, NS, VL>>>>,
prover_params: Option<Arc<Mutex<ProverParams<L, M, N, NS, VL>>>>,
) -> Self {
Self {
user,
Expand Down
14 changes: 11 additions & 3 deletions pex/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use pex::{
use pex::{Env, MyPods, Value};
use pod2::{
pod::gadget::PlonkyButNotPlonkyGadget,
recursion::traits::IntroducerCircuitTrait,
signature::schnorr::{SchnorrSecretKey, SchnorrSigner},
};
use reedline::{
Expand Down Expand Up @@ -130,9 +131,16 @@ async fn main() -> Result<()> {

let pod_store = Arc::new(Mutex::new(MyPods::default()));
let spinner = create_spinner("Generating prover parameters...");
let circuit_data = PlonkyButNotPlonkyGadget::<M, N, NS, VL>::circuit_data().unwrap();
let prover_params =
PlonkyButNotPlonkyGadget::<M, N, NS, VL>::build_prover_params(circuit_data).unwrap();

let pod1_circuit_data = pod2::recursion::traits_examples::ExampleIntroducer::circuit_data()?;
let pod1_verifier_data = pod1_circuit_data.verifier_data();
let circuit_data =
PlonkyButNotPlonkyGadget::<L, M, N, NS, VL>::circuit_data(pod1_verifier_data).unwrap();
let prover_params = PlonkyButNotPlonkyGadget::<L, M, N, NS, VL>::build_prover_params(
pod1_verifier_data,
circuit_data,
)
.unwrap();
spinner.finish_and_clear();
println!("⚙️ Prover parameters generated");
let env = Env::new(
Expand Down

0 comments on commit 697db77

Please sign in to comment.