From 1093f5ecd2fee40fb7edb59df44bb30937a4e771 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Mon, 21 Aug 2023 23:24:03 +0800 Subject: [PATCH] Release v0.6.x (#792) * fix: replace branch with tag for `halo2-lib`, `snark-verifier` and `mpt-circuit` (#779) * Replace branch with tag for `halo2-lib`, `snark-verifier` and `mpt-circuit`. * Update `snark-verifier` to `v0.1.1`. * tag snark verifier * tag mpt circuit * fix false alarm panic inside aggregator * fix false alarm panic inside aggregator --------- Co-authored-by: Steven --- Cargo.lock | 10 +++++----- aggregator/Cargo.toml | 4 ++-- aggregator/src/util.rs | 25 +++++++++++++------------ zkevm-circuits/Cargo.toml | 11 +++++------ zktrie/Cargo.toml | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c54e5f438..b3df46cdfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2161,7 +2161,7 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "halo2-base" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" +source = "git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" dependencies = [ "ff", "halo2_proofs", @@ -2176,7 +2176,7 @@ dependencies = [ [[package]] name = "halo2-ecc" version = "0.2.2" -source = "git+https://github.com/scroll-tech/halo2-lib?branch=develop#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" +source = "git+https://github.com/scroll-tech/halo2-lib?tag=v0.1.0#2c225864227e74b207d9f4b9e08c4d5f1afc69a1" dependencies = [ "ff", "group", @@ -2211,7 +2211,7 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?branch=v0.5#1c11b6c9b1245073a76c3ce7100b6798060f7cb8" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.5.1#2163a9c436ed85363c954ecf7e6e1044a1b991dc" dependencies = [ "ethers-core", "halo2_proofs", @@ -4506,7 +4506,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "snark-verifier" version = "0.1.0" -source = "git+https://github.com/scroll-tech/snark-verifier?branch=develop#12c306ec57849921e690221b10b8a08189868d4a" +source = "git+https://github.com/scroll-tech/snark-verifier?tag=v0.1.2#4466059ce9a6dfaf26455e4ffb61d72af775cf52" dependencies = [ "bytes", "ethereum-types 0.14.1", @@ -4530,7 +4530,7 @@ dependencies = [ [[package]] name = "snark-verifier-sdk" version = "0.0.1" -source = "git+https://github.com/scroll-tech/snark-verifier?branch=develop#12c306ec57849921e690221b10b8a08189868d4a" +source = "git+https://github.com/scroll-tech/snark-verifier?tag=v0.1.2#4466059ce9a6dfaf26455e4ffb61d72af775cf52" dependencies = [ "bincode", "env_logger 0.10.0", diff --git a/aggregator/Cargo.toml b/aggregator/Cargo.toml index 3af735fa22..e15c19b939 100644 --- a/aggregator/Cargo.toml +++ b/aggregator/Cargo.toml @@ -21,8 +21,8 @@ serde_json = "1.0" rand = "0.8" halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_02_02" } -snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop" } -snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features=false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } +snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2" } +snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2", default-features=false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } [features] diff --git a/aggregator/src/util.rs b/aggregator/src/util.rs index 35b3c706f5..6d420a7f7c 100644 --- a/aggregator/src/util.rs +++ b/aggregator/src/util.rs @@ -157,24 +157,25 @@ pub(crate) fn assert_conditional_equal( #[inline] // assert a \in (b1, b2, b3) +// TODO: return Error::Synthesis? pub(crate) fn assert_exist( a: &AssignedCell, b1: &AssignedCell, b2: &AssignedCell, b3: &AssignedCell, ) { - let mut t1 = F::default(); - let mut t2 = F::default(); - let mut t3 = F::default(); - let mut t4 = F::default(); - a.value().map(|f| t1 = *f); - b1.value().map(|f| t2 = *f); - b2.value().map(|f| t3 = *f); - b3.value().map(|f| t4 = *f); - assert!( - t1 == t2 || t1 == t3 || t1 == t4, - "t1: {t1:?}\nt2: {t2:?}\nt3: {t3:?}\nt4: {t4:?}\n", - ) + let _ = a + .value() + .zip(b1.value()) + .zip(b2.value()) + .zip(b3.value()) + .error_if_known_and(|(((&a, &b1), &b2), &b3)| { + assert!( + a == b1 || a == b2 || a == b3, + "a: {a:?}\nb1: {b1:?}\nb2: {b2:?}\nb3: {b3:?}\n", + ); + !(a == b1 || a == b2 || a == b3) + }); } #[inline] diff --git a/zkevm-circuits/Cargo.toml b/zkevm-circuits/Cargo.toml index 7efe5d2bfe..15c152d2cd 100644 --- a/zkevm-circuits/Cargo.toml +++ b/zkevm-circuits/Cargo.toml @@ -33,11 +33,10 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.78" hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0723"} -#mpt-circuits = { package = "halo2-mpt-circuits", path = "../../mpt-circuit" } misc-precompiled-circuit = { package = "rmd160-circuits", git = "https://github.com/scroll-tech/misc-precompiled-circuit.git", branch = "integration" } -halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop", default-features=false, features=["halo2-pse","display"] } -halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", branch = "develop", default-features=false, features=["halo2-pse","display"] } +halo2-base = { git = "https://github.com/scroll-tech/halo2-lib", tag = "v0.1.0", default-features=false, features=["halo2-pse","display"] } +halo2-ecc = { git = "https://github.com/scroll-tech/halo2-lib", tag = "v0.1.0", default-features=false, features=["halo2-pse","display"] } maingate = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2023_02_02" } @@ -45,8 +44,8 @@ libsecp256k1 = "0.7" num-bigint = { version = "0.4" } subtle = "2.4" rand_chacha = "0.3" -snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop" } -snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", branch = "develop", default-features=false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } +snark-verifier = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2" } +snark-verifier-sdk = { git = "https://github.com/scroll-tech/snark-verifier", tag = "v0.1.2", default-features=false, features = ["loader_halo2", "loader_evm", "halo2-pse"] } hex = "0.4.3" rayon = "1.5" once_cell = "1.17.0" @@ -85,4 +84,4 @@ onephase = [] # debug only zktrie = [] poseidon-codehash = [] -debug-annotations = [] \ No newline at end of file +debug-annotations = [] diff --git a/zktrie/Cargo.toml b/zktrie/Cargo.toml index 716fb33cc5..e33562ca81 100644 --- a/zktrie/Cargo.toml +++ b/zktrie/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" [dependencies] halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_02_02" } -mpt-circuits = { package = "halo2-mpt-circuits", git = "https://github.com/scroll-tech/mpt-circuit.git", branch = "v0.5" } +mpt-circuits = { package = "halo2-mpt-circuits", git = "https://github.com/scroll-tech/mpt-circuit.git", tag = "v0.5.1" } zktrie = { git = "https://github.com/scroll-tech/zktrie.git", branch = "v0.6" } hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0723"} bus-mapping = { path = "../bus-mapping" }