diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 6f544e4c6c84..1376a5e2cb9f 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -673,7 +673,7 @@ dependencies = [ "convert_case", "crossbeam 0.8.4", "crypto-bigint 0.5.5", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "cs_derive", "derivative", "ethereum-types", "firestorm", @@ -1016,14 +1016,6 @@ dependencies = [ "serde", ] -[[package]] -name = "circuit_testing" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-circuit_testing.git?branch=main#164c0adac85be39ee44bd9456b2b91cdede5af80" -dependencies = [ - "bellman_ce 0.3.2 (git+https://github.com/matter-labs/bellman?branch=dev)", -] - [[package]] name = "clang-sys" version = "1.8.1" @@ -1438,18 +1430,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "cs_derive" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-sync_vm.git?branch=v1.3.3#ed8ab8984cae05d00d9d62196753c8d40df47c7d" -dependencies = [ - "proc-macro-error", - "proc-macro2 1.0.85", - "quote 1.0.36", - "serde", - "syn 1.0.109", -] - [[package]] name = "ctrlc" version = "3.4.4" @@ -2105,36 +2085,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "franklin-crypto" -version = "0.0.5" -source = "git+https://github.com/matter-labs/franklin-crypto?branch=dev#5695d07c7bc604c2c39a27712ffac171d39ee1ed" -dependencies = [ - "arr_macro", - "bellman_ce 0.3.2 (git+https://github.com/matter-labs/bellman?branch=dev)", - "bit-vec", - "blake2 0.9.2", - "blake2-rfc_bellman_edition", - "blake2s_simd", - "byteorder", - "digest 0.9.0", - "hex", - "indexmap 1.9.3", - "itertools 0.10.5", - "lazy_static", - "num-bigint 0.4.5", - "num-derive 0.2.5", - "num-integer", - "num-traits", - "rand 0.4.6", - "serde", - "sha2 0.9.9", - "sha3 0.9.1", - "smallvec", - "splitmut", - "tiny-keccak 1.5.0", -] - [[package]] name = "franklin-crypto" version = "0.0.5" @@ -2155,7 +2105,7 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "num-bigint 0.4.5", - "num-derive 0.2.5", + "num-derive", "num-integer", "num-traits", "rand 0.4.6", @@ -2486,7 +2436,7 @@ dependencies = [ "bit-vec", "cfg-if 1.0.0", "crossbeam 0.8.4", - "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper)", + "franklin-crypto", "gpu-ffi", "itertools 0.13.0", "num_cpus", @@ -3774,17 +3724,6 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2 1.0.85", - "quote 1.0.36", - "syn 1.0.109", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -4990,7 +4929,7 @@ dependencies = [ "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder", "derivative", - "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=snark_wrapper)", + "franklin-crypto", "lazy_static", "log", "num-bigint 0.3.3", @@ -5004,26 +4943,6 @@ dependencies = [ "typemap_rev", ] -[[package]] -name = "rescue_poseidon" -version = "0.4.1" -source = "git+https://github.com/matter-labs/rescue-poseidon.git#d059b5042df5ed80e151f05751410b524a54d16c" -dependencies = [ - "addchain", - "arrayvec 0.7.4", - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder", - "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", - "num-bigint 0.3.3", - "num-integer", - "num-iter", - "num-traits", - "rand 0.4.6", - "serde", - "sha3 0.9.1", - "smallvec", -] - [[package]] name = "rfc6979" version = "0.3.1" @@ -5832,7 +5751,7 @@ source = "git+https://github.com/matter-labs/snark-wrapper.git?branch=main#76959 dependencies = [ "derivative", "rand 0.4.6", - "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", + "rescue_poseidon", ] [[package]] @@ -6258,29 +6177,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "sync_vm" -version = "1.3.3" -source = "git+https://github.com/matter-labs/era-sync_vm.git?branch=v1.3.3#ed8ab8984cae05d00d9d62196753c8d40df47c7d" -dependencies = [ - "arrayvec 0.7.4", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-sync_vm.git?branch=v1.3.3)", - "derivative", - "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", - "hex", - "itertools 0.10.5", - "num-bigint 0.4.5", - "num-derive 0.3.3", - "num-integer", - "num-traits", - "once_cell", - "rand 0.4.6", - "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git)", - "serde", - "smallvec", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3)", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -7656,7 +7552,7 @@ dependencies = [ "arrayvec 0.7.4", "bincode", "boojum", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -7677,7 +7573,7 @@ dependencies = [ "arrayvec 0.7.4", "bincode", "boojum", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -7698,7 +7594,7 @@ dependencies = [ "arrayvec 0.7.4", "bincode", "boojum", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -7718,7 +7614,7 @@ source = "git+https://github.com/matter-labs/era-zkevm_circuits.git?branch=v1.5. dependencies = [ "arrayvec 0.7.4", "boojum", - "cs_derive 0.1.0 (git+https://github.com/matter-labs/era-boojum.git?branch=main)", + "cs_derive", "derivative", "hex", "itertools 0.10.5", @@ -7785,34 +7681,6 @@ dependencies = [ "sha3 0.10.8", ] -[[package]] -name = "zkevm_test_harness" -version = "1.3.3" -source = "git+https://github.com/matter-labs/era-zkevm_test_harness.git?branch=v1.3.3#aba8f2a32767b79838aca7d7d00d9d23144df32f" -dependencies = [ - "bincode", - "circuit_sequencer_api 0.1.0", - "circuit_testing", - "codegen", - "crossbeam 0.8.4", - "derivative", - "env_logger 0.11.3", - "hex", - "num-bigint 0.4.5", - "num-integer", - "num-traits", - "rayon", - "serde", - "serde_json", - "smallvec", - "structopt", - "sync_vm", - "test-log", - "tracing", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?branch=v1.3.3)", - "zkevm-assembly 1.3.2", -] - [[package]] name = "zkevm_test_harness" version = "1.4.0" @@ -8265,7 +8133,6 @@ dependencies = [ "vise", "vk_setup_data_generator_server_fri", "wrapper-prover", - "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.5.0", "zksync_config", "zksync_env_config", diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 3bb55925543c..1d01ea176bee 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -75,7 +75,6 @@ zksync_multivm = { path = "../core/lib/multivm", version = "0.1.0" } zksync_vlog = { path = "../core/lib/vlog" } zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.1" } zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.5.0" } -zkevm_test_harness_1_3_3 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3", package = "zkevm_test_harness" } zksync_basic_types = { path = "../core/lib/basic_types" } zksync_config = { path = "../core/lib/config" } zksync_dal = { path = "../core/lib/dal" } diff --git a/prover/proof_fri_compressor/Cargo.toml b/prover/proof_fri_compressor/Cargo.toml index 3342aafe4baa..ff0eec6170a8 100644 --- a/prover/proof_fri_compressor/Cargo.toml +++ b/prover/proof_fri_compressor/Cargo.toml @@ -24,7 +24,6 @@ zksync_queued_job_processor.workspace = true vk_setup_data_generator_server_fri.workspace = true zksync_vlog.workspace = true -zkevm_test_harness_1_3_3.workspace = true circuit_sequencer_api.workspace = true zkevm_test_harness.workspace = true diff --git a/prover/proof_fri_compressor/src/compressor.rs b/prover/proof_fri_compressor/src/compressor.rs index 3306187b2bc3..0d9083a57c5c 100644 --- a/prover/proof_fri_compressor/src/compressor.rs +++ b/prover/proof_fri_compressor/src/compressor.rs @@ -10,17 +10,6 @@ use wrapper_prover::{Bn256, GPUWrapperConfigs, WrapperProver, DEFAULT_WRAPPER_CO use zkevm_test_harness::proof_wrapper_utils::WrapperConfig; #[allow(unused_imports)] use zkevm_test_harness::proof_wrapper_utils::{get_trusted_setup, wrap_proof}; -#[cfg(not(feature = "gpu"))] -use zkevm_test_harness_1_3_3::bellman::bn256::Bn256; -use zkevm_test_harness_1_3_3::{ - abstract_zksync_circuit::concrete_circuits::{ - ZkSyncCircuit, ZkSyncProof, ZkSyncVerificationKey, - }, - bellman::plonk::better_better_cs::{ - proof::Proof, setup::VerificationKey as SnarkVerificationKey, - }, - witness::oracle::VmWitnessOracle, -}; use zksync_object_store::ObjectStore; use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::{ @@ -44,7 +33,6 @@ pub struct ProofCompressor { blob_store: Arc, pool: ConnectionPool, compression_mode: u8, - verify_wrapper_proof: bool, max_attempts: u32, protocol_version: ProtocolSemanticVersion, } @@ -54,7 +42,6 @@ impl ProofCompressor { blob_store: Arc, pool: ConnectionPool, compression_mode: u8, - verify_wrapper_proof: bool, max_attempts: u32, protocol_version: ProtocolSemanticVersion, ) -> Self { @@ -62,37 +49,14 @@ impl ProofCompressor { blob_store, pool, compression_mode, - verify_wrapper_proof, max_attempts, protocol_version, } } - fn verify_proof(keystore: Keystore, serialized_proof: Vec) -> anyhow::Result<()> { - let proof: Proof>> = - bincode::deserialize(&serialized_proof) - .expect("Failed to deserialize proof with ZkSyncCircuit"); - // We're fetching the key as String and deserializing it here - // as we don't want to include the old version of prover in the main libraries. - let existing_vk_serialized = keystore - .load_snark_verification_key() - .context("get_snark_vk()")?; - let existing_vk = serde_json::from_str::< - SnarkVerificationKey>>, - >(&existing_vk_serialized)?; - - let vk = ZkSyncVerificationKey::from_verification_key_and_numeric_type(0, existing_vk); - let scheduler_proof = ZkSyncProof::from_proof_and_numeric_type(0, proof.clone()); - match vk.verify_proof(&scheduler_proof) { - true => tracing::info!("Compressed proof verified successfully"), - false => anyhow::bail!("Compressed proof verification failed "), - } - Ok(()) - } pub fn compress_proof( proof: ZkSyncRecursionLayerProof, _compression_mode: u8, - verify_wrapper_proof: bool, ) -> anyhow::Result { let keystore = Keystore::default(); let scheduler_vk = keystore @@ -126,12 +90,6 @@ impl ProofCompressor { let serialized = bincode::serialize(&wrapper_proof) .expect("Failed to serialize proof with ZkSyncSnarkWrapperCircuit"); - if verify_wrapper_proof { - // If we want to verify the proof, we have to deserialize it, with proper type. - // So that we can pass it into `from_proof_and_numeric_type` method below. - Self::verify_proof(keystore, serialized.clone())?; - } - // For sending to L1, we can use the `FinalProof` type, that has a generic circuit inside, that is not used for serialization. // So `FinalProof` and `Proof>>` are compatible on serialization bytecode level. let final_proof: FinalProof = @@ -213,11 +171,10 @@ impl JobProcessor for ProofCompressor { _started_at: Instant, ) -> JoinHandle> { let compression_mode = self.compression_mode; - let verify_wrapper_proof = self.verify_wrapper_proof; let block_number = *job_id; tokio::task::spawn_blocking(move || { let _span = tracing::info_span!("compress", %block_number).entered(); - Self::compress_proof(job, compression_mode, verify_wrapper_proof) + Self::compress_proof(job, compression_mode) }) } diff --git a/prover/proof_fri_compressor/src/main.rs b/prover/proof_fri_compressor/src/main.rs index 096bf9af7883..7be7f5fead10 100644 --- a/prover/proof_fri_compressor/src/main.rs +++ b/prover/proof_fri_compressor/src/main.rs @@ -93,7 +93,6 @@ async fn main() -> anyhow::Result<()> { blob_store, pool, config.compression_mode, - config.verify_wrapper_proof, config.max_attempts, protocol_version, );