mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Merge pull request #96 from zcash/metrics-update
Bump metrics crate and pin its dependencies
This commit is contained in:
commit
bd73089123
7 changed files with 13 additions and 12 deletions
|
|
@ -38,7 +38,8 @@ bitvec = "0.18"
|
|||
subtle = "2.3"
|
||||
crossbeam-utils = "0.7"
|
||||
ff = "0.8"
|
||||
metrics = "=0.13.0-alpha.11"
|
||||
metrics = "=0.13.0-alpha.13"
|
||||
metrics-macros = "=0.1.0-alpha.9"
|
||||
num_cpus = "1.13"
|
||||
rand = "0.7"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use std::collections::HashMap;
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use metrics::{Key, Recorder, Unit};
|
||||
use metrics::{GaugeValue, Key, Recorder, Unit};
|
||||
|
||||
/// A [`metrics`] recorder for examining halo2 metrics.
|
||||
///
|
||||
|
|
@ -94,11 +94,11 @@ impl Recorder for ModelRecorder {
|
|||
.or_default() += value;
|
||||
}
|
||||
|
||||
fn update_gauge(&self, _key: Key, _value: f64) {
|
||||
fn update_gauge(&self, _key: Key, _value: GaugeValue) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn record_histogram(&self, _key: Key, _value: u64) {
|
||||
fn record_histogram(&self, _key: Key, _value: f64) {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ impl<C: CurveAffine> Params<C> {
|
|||
poly: &Polynomial<C::Scalar, Coeff>,
|
||||
r: Blind<C::Scalar>,
|
||||
) -> C::Projective {
|
||||
metrics::increment!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit");
|
||||
metrics::increment_counter!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit");
|
||||
let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
|
||||
let mut tmp_bases = Vec::with_capacity(poly.len() + 1);
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ impl<C: CurveAffine> Params<C> {
|
|||
poly: &Polynomial<C::Scalar, LagrangeCoeff>,
|
||||
r: Blind<C::Scalar>,
|
||||
) -> C::Projective {
|
||||
metrics::increment!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit_lagrange");
|
||||
metrics::increment_counter!("multiexp", "size" => format!("{}", poly.len() + 1), "fn" => "commit_lagrange");
|
||||
let mut tmp_scalars = Vec::with_capacity(poly.len() + 1);
|
||||
let mut tmp_bases = Vec::with_capacity(poly.len() + 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ impl<'a, C: CurveAffine> MSM<'a, C> {
|
|||
|
||||
assert_eq!(scalars.len(), len);
|
||||
|
||||
metrics::increment!("multiexp", "size" => format!("{}", len), "fn" => "MSM::eval");
|
||||
metrics::increment_counter!("multiexp", "size" => format!("{}", len), "fn" => "MSM::eval");
|
||||
bool::from(best_multiexp(&scalars, &bases).is_zero())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ impl<C: CurveAffine> Proof<C> {
|
|||
let d = C::Scalar::rand();
|
||||
let s = C::Scalar::rand();
|
||||
|
||||
metrics::increment!("multiexp", "val" => "delta", "size" => "3");
|
||||
metrics::increment_counter!("multiexp", "val" => "delta", "size" => "3");
|
||||
let delta = best_multiexp(&[d, d * &b, s], &[g, u, params.h]).to_affine();
|
||||
|
||||
// Feed delta into the transcript
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ impl<'a, C: CurveAffine> Guard<'a, C> {
|
|||
pub fn compute_g(&self) -> C {
|
||||
let s = compute_s(&self.challenges_sq, self.allinv);
|
||||
|
||||
metrics::increment!("multiexp", "size" => format!("{}", s.len()), "fn" => "compute_g");
|
||||
metrics::increment_counter!("multiexp", "size" => format!("{}", s.len()), "fn" => "compute_g");
|
||||
let mut tmp = best_multiexp(&s, &self.msm.params.g);
|
||||
tmp += self.msm.params.h;
|
||||
tmp.to_affine()
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ impl<G: Group> EvaluationDomain<G> {
|
|||
assert_eq!(a.values.len(), 1 << self.k);
|
||||
|
||||
// Perform inverse FFT to obtain the polynomial in coefficient form
|
||||
metrics::increment!("ifft", "size" => format!("{}", a.len()), "fn" => "lagrange_to_coeff");
|
||||
metrics::increment_counter!("ifft", "size" => format!("{}", a.len()), "fn" => "lagrange_to_coeff");
|
||||
Self::ifft(&mut a.values, self.omega_inv, self.k, self.ifft_divisor);
|
||||
|
||||
Polynomial {
|
||||
|
|
@ -240,7 +240,7 @@ impl<G: Group> EvaluationDomain<G> {
|
|||
Self::distribute_powers(&mut a.values, g);
|
||||
}
|
||||
a.values.resize(self.extended_len(), G::group_zero());
|
||||
metrics::increment!("fft", "size" => format!("{}", self.extended_len()), "fn" => "coeff_to_extended");
|
||||
metrics::increment_counter!("fft", "size" => format!("{}", self.extended_len()), "fn" => "coeff_to_extended");
|
||||
best_fft(&mut a.values, self.extended_omega, self.extended_k);
|
||||
|
||||
Polynomial {
|
||||
|
|
@ -259,7 +259,7 @@ impl<G: Group> EvaluationDomain<G> {
|
|||
assert_eq!(a.values.len(), self.extended_len());
|
||||
|
||||
// Inverse FFT
|
||||
metrics::increment!("ifft", "size" => format!("{}", a.len()), "fn" => "extended_to_coeff");
|
||||
metrics::increment_counter!("ifft", "size" => format!("{}", a.len()), "fn" => "extended_to_coeff");
|
||||
Self::ifft(
|
||||
&mut a.values,
|
||||
self.extended_omega_inv,
|
||||
|
|
|
|||
Loading…
Reference in a new issue