diff --git a/CHANGELOG.md b/CHANGELOG.md index e61d43ed..18724bd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update `criterion` dev-dependency to 0.5 + ## [0.16.0] - 2023-10-11 ### Added diff --git a/Cargo.toml b/Cargo.toml index 8d6b144e..c00dd7f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ backtrace = {version = "0.3", optional = true} dusk-cdf = {version = "0.5", optional = true} [dev-dependencies] -criterion = "0.3" +criterion = "0.5" tempdir = "0.3" rand = "0.8" rkyv = {version = "0.7", default-features = false, features = ["size_32"]} diff --git a/refactor_circuit.md b/refactor_circuit.md deleted file mode 100644 index e694bd7e..00000000 --- a/refactor_circuit.md +++ /dev/null @@ -1,51 +0,0 @@ -Matteo's suggestion of restructuring the `Circuit` trait. - -1. Without the need to retain the private or public input values: -```rust -fn op(f: F, a: u32, b: u32) -> u32 where F: Fn(u32, u32) -> u32 { - f(a, b) -} - -fn add(a: u32, b: u32) -> u32 { - a + b -} - -fn mul(a: u32, b: u32) -> u32 { - a * b -} -``` - -2. With the option of retaining the private and public input values: -```rust -struct Foo where F: Fn(u32, u32) -> u32 { - a: u32, - b: u32, - callback: F -} - -impl Foo where F: Fn(u32, u32) -> u32 { - fn calc(&self) -> u32 { - (self.callback)(self.a, self.b) - } -} - -fn main() { - - let foo = Foo { - a: 10, - b: 20, - callback: add, - }; - - println!("add: {}", op(add, 10, 20)); - println!("mul: {}", op(mul, 10, 20)); - - println!("foo add: {}", foo.calc()); -} -``` - -Notes: -- The funcitons `add` and `mul` would be different circuit implementation, returning the size of the circuit. -- I wouldn't know how to search for the circuit implementation in the AST though. - -3. Another approach is the restructuring of the `Circuit` trait as proposed by Ed diff --git a/rust-toolchain b/rust-toolchain index fdd6c827..4ab37737 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2022-09-14 +nightly-2023-05-24 diff --git a/src/debugger.rs b/src/debugger.rs index 87514804..b4560825 100644 --- a/src/debugger.rs +++ b/src/debugger.rs @@ -10,7 +10,6 @@ use std::env; use std::path::PathBuf; use dusk_bls12_381::BlsScalar; -use dusk_bytes::Serializable; use dusk_cdf::{ BaseConfig, Config, EncodableConstraint, EncodableSource, EncodableWitness, Encoder, EncoderContextFileProvider, Polynomial, Selectors, WiredWitnesses, diff --git a/src/permutation.rs b/src/permutation.rs index a5717945..cf92fdd5 100644 --- a/src/permutation.rs +++ b/src/permutation.rs @@ -992,7 +992,7 @@ mod test { let gamma = BlsScalar::random(&mut OsRng); assert_ne!(gamma, beta); - //1. Compute the permutation polynomial using both methods + // 1. Compute the permutation polynomial using both methods let [s_sigma_1_poly, s_sigma_2_poly, s_sigma_3_poly, s_sigma_4_poly] = perm.compute_sigma_polynomials(n, domain); let (z_vec, numerator_components, denominator_components) = @@ -1048,7 +1048,7 @@ mod test { } assert_eq!(a_0 * b_0.invert().unwrap(), BlsScalar::one()); - //3. Now we perform the two checks that need to be done on the + // 3. Now we perform the two checks that need to be done on the // permutation polynomial (z) let z_poly = Polynomial::from_coefficients_vec(domain.ifft(&z_vec)); //