From a471b147dd5aa7e69b9ae94b78cfdeba6eeb212b Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:17:32 -0700 Subject: [PATCH] chore: update rust toolchain (#266) * chore: fix link (#256) * chore: update `snark-verifier` git tag in `zkevm-hashes` * chore: update rust toolchain * chore: fix clippy * chore: update should_panic message * chore: switch to community-edition --------- Co-authored-by: yanziseeker <153156292+AdventureSeeker987@users.noreply.github.com> --- halo2-base/src/gates/flex_gate/mod.rs | 2 +- halo2-base/src/poseidon/hasher/tests/mod.rs | 8 ++++---- halo2-ecc/src/secp256k1/tests/ecdsa_tests.rs | 8 ++++++-- hashes/zkevm/Cargo.toml | 4 ++-- hashes/zkevm/src/keccak/component/circuit/tests/shard.rs | 2 +- rust-toolchain | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/halo2-base/src/gates/flex_gate/mod.rs b/halo2-base/src/gates/flex_gate/mod.rs index 03f952b6..4ed3b4c3 100644 --- a/halo2-base/src/gates/flex_gate/mod.rs +++ b/halo2-base/src/gates/flex_gate/mod.rs @@ -137,7 +137,7 @@ impl FlexGateConfig { Self { basic_gates, constants, - /// Warning: this needs to be updated if you create more advice columns after this `FlexGateConfig` is created + // Warning: this needs to be updated if you create more advice columns after this `FlexGateConfig` is created max_rows: (1 << params.k) - meta.minimum_rows(), } } diff --git a/halo2-base/src/poseidon/hasher/tests/mod.rs b/halo2-base/src/poseidon/hasher/tests/mod.rs index a734f7d0..76087be2 100644 --- a/halo2-base/src/poseidon/hasher/tests/mod.rs +++ b/halo2-base/src/poseidon/hasher/tests/mod.rs @@ -11,18 +11,18 @@ mod state; fn test_mds() { let spec = OptimizedPoseidonSpec::::new::<8, 57, 0>(); - let mds = vec![ - vec![ + let mds = [ + [ "7511745149465107256748700652201246547602992235352608707588321460060273774987", "10370080108974718697676803824769673834027675643658433702224577712625900127200", "19705173408229649878903981084052839426532978878058043055305024233888854471533", ], - vec![ + [ "18732019378264290557468133440468564866454307626475683536618613112504878618481", "20870176810702568768751421378473869562658540583882454726129544628203806653987", "7266061498423634438633389053804536045105766754026813321943009179476902321146", ], - vec![ + [ "9131299761947733513298312097611845208338517739621853568979632113419485819303", "10595341252162738537912664445405114076324478519622938027420701542910180337937", "11597556804922396090267472882856054602429588299176362916247939723151043581408", diff --git a/halo2-ecc/src/secp256k1/tests/ecdsa_tests.rs b/halo2-ecc/src/secp256k1/tests/ecdsa_tests.rs index d3d47da7..c4002722 100644 --- a/halo2-ecc/src/secp256k1/tests/ecdsa_tests.rs +++ b/halo2-ecc/src/secp256k1/tests/ecdsa_tests.rs @@ -28,14 +28,18 @@ fn custom_parameters_ecdsa(sk: u64, msg_hash: u64, k: u64) -> ECDSAInput { } #[test] -#[should_panic(expected = "assertion failed: `(left == right)`")] +#[should_panic( + expected = "assertion `left == right` failed\n left: 0x0000000000000000000000000000000000000000000000000000000000000000\n right: 0x0000000000000000000000000000000000000000000000000000000000000001" +)] fn test_ecdsa_msg_hash_zero() { let input = custom_parameters_ecdsa(random::(), 0, random::()); run_test(input); } #[test] -#[should_panic(expected = "assertion failed: `(left == right)`")] +#[should_panic( + expected = "assertion `left == right` failed\n left: 0x0000000000000000000000000000000000000000000000000000000000000000\n right: 0x0000000000000000000000000000000000000000000000000000000000000001" +)] fn test_ecdsa_private_key_zero() { let input = custom_parameters_ecdsa(0, random::(), random::()); run_test(input); diff --git a/hashes/zkevm/Cargo.toml b/hashes/zkevm/Cargo.toml index c4d5425e..22945267 100644 --- a/hashes/zkevm/Cargo.toml +++ b/hashes/zkevm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zkevm-hashes" -version = "0.2.1" +version = "0.2.2" authors = ["Privacy Scaling Explorations Team", "Taiko Labs", "Intrinsic Technologies"] license = "MIT OR Apache-2.0" edition = "2021" @@ -23,7 +23,7 @@ rayon = "1.8" sha3 = "0.10.8" # always included but without features to use Native poseidon and get CircuitExt trait # snark-verifier-sdk = { version = "=0.1.7", default-features = false } -snark-verifier-sdk = { version = "=0.1.7", git = "https://github.com/axiom-crypto/snark-verifier.git", tag = "v0.1.7-git", default-features = false } +snark-verifier-sdk = { git = "https://github.com/axiom-crypto/snark-verifier.git", branch = "community-edition", default-features = false } getset = "0.1.2" type-map = "0.5.0" diff --git a/hashes/zkevm/src/keccak/component/circuit/tests/shard.rs b/hashes/zkevm/src/keccak/component/circuit/tests/shard.rs index 17726327..c41f4d70 100644 --- a/hashes/zkevm/src/keccak/component/circuit/tests/shard.rs +++ b/hashes/zkevm/src/keccak/component/circuit/tests/shard.rs @@ -175,7 +175,7 @@ fn test_prove_shard_circuit_commit() { circuit.set_base_circuit_break_points(break_points); let circuit_outputs = multi_inputs_to_circuit_outputs::(&inputs, circuit_params.capacity()); - let instances = vec![vec![calculate_circuit_outputs_commit(&circuit_outputs)]]; + let instances = [[calculate_circuit_outputs_commit(&circuit_outputs)]]; let proof = gen_proof_with_instances( ¶ms, diff --git a/rust-toolchain b/rust-toolchain index ee2d639b..36e57ce7 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2023-08-12 \ No newline at end of file +nightly-2024-02-08