Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-camuto committed Sep 21, 2023
1 parent 75cb33d commit 47f381e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
24 changes: 12 additions & 12 deletions halo2_proofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,6 @@
#![allow(unused_imports)]
#![allow(clippy::derive_partial_eq_without_eq)]

pub mod arithmetic;
pub mod circuit;
pub use halo2curves;
mod multicore;
pub mod plonk;
pub mod poly;
pub mod transcript;

pub mod dev;
mod helpers;
pub use helpers::SerdeFormat;

#[cfg(feature = "counter")]
#[macro_use]
extern crate lazy_static;
Expand All @@ -55,3 +43,15 @@ lazy_static! {
static ref FFT_COUNTER: Mutex<BTreeMap<usize, usize>> = Mutex::new(BTreeMap::new());
static ref MSM_COUNTER: Mutex<BTreeMap<usize, usize>> = Mutex::new(BTreeMap::new());
}

pub mod arithmetic;
pub mod circuit;
pub use halo2curves;
mod multicore;
pub mod plonk;
pub mod poly;
pub mod transcript;

pub mod dev;
mod helpers;
pub use helpers::SerdeFormat;
22 changes: 22 additions & 0 deletions halo2_proofs/src/plonk/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ pub fn create_proof<
where
Scheme::Scalar: WithSmallOrderMulGroup<3> + FromUniformBytes<64>,
{
#[cfg(feature = "counter")]
{
use crate::{FFT_COUNTER, MSM_COUNTER};
use std::collections::BTreeMap;

// reset counters at the beginning of the prove
*MSM_COUNTER.lock().unwrap() = BTreeMap::new();
*FFT_COUNTER.lock().unwrap() = BTreeMap::new();
}

for instance in instances.iter() {
if instance.len() != pk.vk.cs.num_instance_columns {
return Err(Error::InvalidInstances);
Expand Down Expand Up @@ -695,6 +705,18 @@ where
// We query the h(X) polynomial at x
.chain(vanishing.open(x));

#[cfg(feature = "counter")]
{
use crate::{FFT_COUNTER, MSM_COUNTER};
use std::collections::BTreeMap;
println!("MSM_COUNTER: {:?}", MSM_COUNTER.lock().unwrap());
println!("FFT_COUNTER: {:?}", *FFT_COUNTER.lock().unwrap());

// reset counters at the end of the proving
*MSM_COUNTER.lock().unwrap() = BTreeMap::new();
*FFT_COUNTER.lock().unwrap() = BTreeMap::new();
}

let prover = P::new(params);
prover
.create_proof(rng, transcript, instances)
Expand Down

0 comments on commit 47f381e

Please sign in to comment.