Skip to content

Commit

Permalink
chore: update ruint version and rust toolchain (#64)
Browse files Browse the repository at this point in the history
* chore: update `ruint` version (#62)

* chore: update `ruint` version

Necessary to import `alloy-primitives` in `axiom-eth`

* chore: update rust-toolchain

* chore: fix clippy

* chore: update rust-toolchain

* chore: clippy

* chore: clippy

* fix: lower rust toolchain to fix revm
  • Loading branch information
jonathanpwang authored Aug 14, 2024
1 parent e327c46 commit 27309cf
Show file tree
Hide file tree
Showing 10 changed files with 430 additions and 376 deletions.
716 changes: 379 additions & 337 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2023-08-12
nightly-2024-02-03
20 changes: 15 additions & 5 deletions snark-verifier-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snark-verifier-sdk"
version = "0.1.7"
version = "0.1.8"
authors = ["Privacy Scaling Explorations Team", "Intrinsic Technologies"]
license = "MIT"
edition = "2021"
Expand All @@ -26,11 +26,13 @@ bincode = "1.3.3"
ark-std = { version = "0.3.0", features = ["print-trace"], optional = true }
# halo2-base = { version = "=0.4.1", default-features = false }
halo2-base = { git = "https://github.com/axiom-crypto/halo2-lib.git", branch = "develop", default-features = false }
snark-verifier = { version = "=0.1.7", path = "../snark-verifier", default-features = false }
snark-verifier = { version = "0.1.8", path = "../snark-verifier", default-features = false }
getset = "0.1.2"

# loader_evm
ethereum-types = { version = "=0.14.1", default-features = false, features = ["std"], optional = true }
ethereum-types = { version = "=0.14.1", default-features = false, features = [
"std",
], optional = true }

# zkevm benchmarks
# zkevm-circuits = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits.git", rev = "f834e61", features = [
Expand All @@ -48,13 +50,21 @@ criterion = "0.5.1"
criterion-macro = "0.4"
# loader_evm
crossterm = { version = "0.25" }
ratatui = { version = "0.24", default-features = false, features = ["crossterm"] }
ratatui = { version = "0.24", default-features = false, features = [
"crossterm",
] }
clap = "=4.4" # fix clap version to prevent requiring rustc 1.74
clap_builder = "=4.4"
clap_lex = "=0.6.0"

[features]
default = ["loader_halo2", "loader_evm", "halo2-axiom", "halo2-base/jemallocator", "display"]
default = [
"loader_halo2",
"loader_evm",
"halo2-axiom",
"halo2-base/jemallocator",
"display",
]
display = ["snark-verifier/display", "dep:ark-std"]
loader_halo2 = ["snark-verifier/loader_halo2"]
loader_evm = ["snark-verifier/loader_evm", "dep:ethereum-types"]
Expand Down
3 changes: 2 additions & 1 deletion snark-verifier-sdk/src/halo2/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl VerifierUniversality {

#[allow(clippy::type_complexity)]
/// Core function used in `synthesize` to aggregate multiple `snarks`.
///
///
/// Returns the assigned instances of previous snarks and the new final pair that needs to be verified in a pairing check.
/// For each previous snark, we concatenate all instances into a single vector. We return a vector of vectors,
/// one vector per snark, for convenience.
Expand Down Expand Up @@ -361,6 +361,7 @@ pub enum AssignedTranscriptObject {
/// ## Notes
/// - This function does _not_ expose any public instances.
/// - `svk` is the generator of the KZG trusted setup, usually gotten via `params.get_g()[0]`
///
/// (avoids having to pass `params` into function just to get generator)
///
/// ## Universality
Expand Down
48 changes: 24 additions & 24 deletions snark-verifier-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,27 @@ pub fn write_instances(instances: &[&[Fr]], path: impl AsRef<Path>) {
bincode::serialize_into(f, &instances).unwrap();
}

#[cfg(feature = "zkevm")]
mod zkevm {
use super::CircuitExt;
use eth_types::Field;
use zkevm_circuits::{evm_circuit::EvmCircuit, state_circuit::StateCircuit};

impl<F: Field> CircuitExt<F> for EvmCircuit<F> {
fn instances(&self) -> Vec<Vec<F>> {
vec![]
}
fn num_instance(&self) -> Vec<usize> {
vec![]
}
}

impl<F: Field> CircuitExt<F> for StateCircuit<F> {
fn instances(&self) -> Vec<Vec<F>> {
vec![]
}
fn num_instance(&self) -> Vec<usize> {
vec![]
}
}
}
// #[cfg(feature = "zkevm")]
// mod zkevm {
// use super::CircuitExt;
// use eth_types::Field;
// use zkevm_circuits::{evm_circuit::EvmCircuit, state_circuit::StateCircuit};

// impl<F: Field> CircuitExt<F> for EvmCircuit<F> {
// fn instances(&self) -> Vec<Vec<F>> {
// vec![]
// }
// fn num_instance(&self) -> Vec<usize> {
// vec![]
// }
// }

// impl<F: Field> CircuitExt<F> for StateCircuit<F> {
// fn instances(&self) -> Vec<Vec<F>> {
// vec![]
// }
// fn num_instance(&self) -> Vec<usize> {
// vec![]
// }
// }
// }
4 changes: 2 additions & 2 deletions snark-verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "snark-verifier"
version = "0.1.7"
version = "0.1.8"
authors = ["Privacy Scaling Explorations Team", "Intrinsic Technologies"]
license = "MIT"
edition = "2021"
Expand Down Expand Up @@ -33,7 +33,7 @@ rayon = { version = "1.8", optional = true }

# loader_evm
sha3 = { version = "=0.10", optional = true }
ruint = { version = "=1.10", optional = true }
ruint = { version = "=1.12.1", optional = true }

# revm only used for testing smart contract execution
revm = { version = "=3.5.0", optional = true }
Expand Down
1 change: 1 addition & 0 deletions snark-verifier/examples/evm-verifier-with-accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ mod aggregation {
pub lookup_bits: usize,
}

#[allow(dead_code)]
#[derive(Clone, Debug)]
pub struct AggregationCircuit {
pub inner: BaseCircuitBuilder<Fr>,
Expand Down
2 changes: 1 addition & 1 deletion snark-verifier/src/loader/evm/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ impl<F: PrimeField<Repr = [u8; 0x20]>> ScalarLoader<F> for Rc<EvmLoader> {

let initial_value = loader.push(products.first().unwrap());
let mut code = format!("let prod := {initial_value}\n");
for (_, (value, product)) in values.iter().zip(products.iter()).skip(1).enumerate() {
for (value, product) in values.iter().zip(products.iter()).skip(1) {
let v = loader.push(value);
let ptr = product.ptr();
code.push_str(
Expand Down
2 changes: 1 addition & 1 deletion snark-verifier/src/pcs/ipa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fn h_coeffs<F: Field>(xi: &[F], scalar: F) -> Vec<F> {
coeffs
}

#[cfg(all(test, feature = "system_halo2"))]
#[cfg(all(test, feature = "halo2-pse"))]
mod test {
use crate::{
pcs::{
Expand Down
8 changes: 4 additions & 4 deletions snark-verifier/src/util/hash/poseidon/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ use crate::{halo2_curves::bn256::Fr, loader::native::NativeLoader};
fn test_mds() {
let spec = OptimizedPoseidonSpec::<Fr, 3, 2>::new::<8, 57, 0>();

let mds = vec![
vec![
let mds = [
[
"7511745149465107256748700652201246547602992235352608707588321460060273774987",
"10370080108974718697676803824769673834027675643658433702224577712625900127200",
"19705173408229649878903981084052839426532978878058043055305024233888854471533",
],
vec![
[
"18732019378264290557468133440468564866454307626475683536618613112504878618481",
"20870176810702568768751421378473869562658540583882454726129544628203806653987",
"7266061498423634438633389053804536045105766754026813321943009179476902321146",
],
vec![
[
"9131299761947733513298312097611845208338517739621853568979632113419485819303",
"10595341252162738537912664445405114076324478519622938027420701542910180337937",
"11597556804922396090267472882856054602429588299176362916247939723151043581408",
Expand Down

0 comments on commit 27309cf

Please sign in to comment.