diff --git a/Cargo.lock b/Cargo.lock index 80581acb75f..f04fd43a7e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4192,6 +4192,7 @@ dependencies = [ "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", "zk_evm 1.4.0", "zk_evm 1.4.1", + "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.4.0", "zkevm_test_harness 1.4.1", "zksync_contracts", @@ -7166,6 +7167,7 @@ dependencies = [ "once_cell", "serde", "serde_json", + "zkevm_test_harness 1.3.3", "zksync_contracts", "zksync_state", "zksync_types", @@ -8615,7 +8617,7 @@ dependencies = [ "codegen 0.2.0", "crossbeam 0.8.2", "derivative", - "env_logger 0.10.0", + "env_logger 0.9.3", "hex", "num-bigint 0.4.4", "num-integer", diff --git a/core/bin/system-constants-generator/Cargo.toml b/core/bin/system-constants-generator/Cargo.toml index c80ee49cc21..12795dd32b4 100644 --- a/core/bin/system-constants-generator/Cargo.toml +++ b/core/bin/system-constants-generator/Cargo.toml @@ -16,6 +16,7 @@ zksync_types = { path = "../../lib/types" } zksync_utils = { path = "../../lib/utils" } zksync_contracts = { path = "../../lib/contracts" } multivm = { path = "../../lib/multivm" } +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" } codegen = "0.2.0" diff --git a/core/bin/system-constants-generator/src/main.rs b/core/bin/system-constants-generator/src/main.rs index 3c5c056ffe7..db42d91fbb5 100644 --- a/core/bin/system-constants-generator/src/main.rs +++ b/core/bin/system-constants-generator/src/main.rs @@ -6,14 +6,13 @@ use multivm::{ vm_latest::constants::MAX_PUBDATA_PER_BLOCK, }; use serde::{Deserialize, Serialize}; -use zksync_types::{ - zkevm_test_harness::zk_evm::zkevm_opcode_defs::{ - circuit_prices::{ - ECRECOVER_CIRCUIT_COST_IN_ERGS, KECCAK256_CIRCUIT_COST_IN_ERGS, - SHA256_CIRCUIT_COST_IN_ERGS, - }, - system_params::MAX_TX_ERGS_LIMIT, +use zkevm_test_harness_1_3_3::zk_evm::zkevm_opcode_defs::{ + circuit_prices::{ + ECRECOVER_CIRCUIT_COST_IN_ERGS, KECCAK256_CIRCUIT_COST_IN_ERGS, SHA256_CIRCUIT_COST_IN_ERGS, }, + system_params::MAX_TX_ERGS_LIMIT, +}; +use zksync_types::{ IntrinsicSystemGasConstants, ProtocolVersionId, GUARANTEED_PUBDATA_IN_TX, L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, REQUIRED_L1_TO_L2_GAS_PER_PUBDATA_BYTE, }; diff --git a/core/lib/dal/src/blocks_web3_dal.rs b/core/lib/dal/src/blocks_web3_dal.rs index 9f9a9d964af..3406da9bb09 100644 --- a/core/lib/dal/src/blocks_web3_dal.rs +++ b/core/lib/dal/src/blocks_web3_dal.rs @@ -7,7 +7,6 @@ use zksync_types::{ l2_to_l1_log::L2ToL1Log, vm_trace::Call, web3::types::{BlockHeader, U64}, - zkevm_test_harness::zk_evm::zkevm_opcode_defs::system_params, Bytes, L1BatchNumber, L2ChainId, MiniblockNumber, H160, H2048, H256, U256, }; use zksync_utils::bigdecimal_to_u256; @@ -24,7 +23,7 @@ use crate::{ StorageProcessor, }; -const BLOCK_GAS_LIMIT: u32 = system_params::VM_INITIAL_FRAME_ERGS; +const BLOCK_GAS_LIMIT: u32 = u32::MAX; #[derive(Debug)] pub struct BlocksWeb3Dal<'a, 'c> { diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index b30714d2cc3..7863a8e644b 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -15,6 +15,7 @@ zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-z zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.3-rc2" } zk_evm_1_3_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag= "v1.3.1-rc2" } +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" } zkevm_test_harness_1_4_0 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0", package = "zkevm_test_harness" } zkevm_test_harness_1_4_1 = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.1", package = "zkevm_test_harness" } diff --git a/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs index 23d42fc2b5a..517077bd6a2 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/pubdata_utils.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; use zk_evm_1_3_3::aux_structures::Timestamp; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_state::WriteStorage; use zksync_types::{ event::{extract_long_l2_to_l1_messages, extract_published_bytecodes}, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS, }; use zksync_utils::bytecode::bytecode_len_in_bytes; diff --git a/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs index c8d8d828c45..ceaf3d634ad 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/vm_with_bootloader.rs @@ -11,13 +11,13 @@ use zk_evm_1_3_3::{ STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_contracts::BaseSystemContracts; use zksync_state::WriteStorage; use zksync_system_constants::MAX_L2_TX_GAS_LIMIT; use zksync_types::{ - fee_model::L1PeggedBatchFeeModelInput, l1::is_l1_tx_type, - zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, Address, Transaction, BOOTLOADER_ADDRESS, - L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, + fee_model::L1PeggedBatchFeeModelInput, l1::is_l1_tx_type, Address, Transaction, + BOOTLOADER_ADDRESS, L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, }; use zksync_utils::{ address_to_u256, diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs index 3e3075cb45f..a8c5889a2ff 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/tracers/pubdata_tracer.rs @@ -4,6 +4,7 @@ use zk_evm_1_4_0::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, }; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_state::{StoragePtr, WriteStorage}; use zksync_types::{ event::{ @@ -11,7 +12,6 @@ use zksync_types::{ extract_l2tol1logs_from_l1_messenger, extract_long_l2_to_l1_messages, L1MessengerL2ToL1Log, }, writes::StateDiffRecord, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, AccountTreeId, StorageKey, L1_MESSENGER_ADDRESS, }; use zksync_utils::{h256_to_u256, u256_to_bytes_be, u256_to_h256}; diff --git a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs index bff8dbf0f56..e3c233931f3 100644 --- a/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_boojum_integration/types/internals/vm_state.rs @@ -9,12 +9,10 @@ use zk_evm_1_4_0::{ STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::BOOTLOADER_ADDRESS; -use zksync_types::{ - block::MiniblockHasher, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, Address, - MiniblockNumber, -}; +use zksync_types::{block::MiniblockHasher, Address, MiniblockNumber}; use zksync_utils::h256_to_u256; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs b/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs index b147bd597fa..09fade1b8f5 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/pubdata_tracer.rs @@ -4,6 +4,7 @@ use zk_evm_1_4_1::{ aux_structures::Timestamp, tracing::{BeforeExecutionData, VmLocalStateData}, }; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_state::{StoragePtr, WriteStorage}; use zksync_types::{ event::{ @@ -11,7 +12,6 @@ use zksync_types::{ extract_l2tol1logs_from_l1_messenger, extract_long_l2_to_l1_messages, L1MessengerL2ToL1Log, }, writes::StateDiffRecord, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, AccountTreeId, StorageKey, L1_MESSENGER_ADDRESS, }; use zksync_utils::{h256_to_u256, u256_to_bytes_be, u256_to_h256}; diff --git a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs index 223c908ae7f..54aa44874e8 100644 --- a/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_latest/types/internals/vm_state.rs @@ -9,12 +9,10 @@ use zk_evm_1_4_1::{ STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::BOOTLOADER_ADDRESS; -use zksync_types::{ - block::MiniblockHasher, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, Address, - MiniblockNumber, -}; +use zksync_types::{block::MiniblockHasher, Address, MiniblockNumber}; use zksync_utils::h256_to_u256; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs index 63e45edcbb8..e38e5d3bffd 100644 --- a/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_m5/pubdata_utils.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; use zk_evm_1_3_1::aux_structures::Timestamp; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_types::{ event::{extract_long_l2_to_l1_messages, extract_published_bytecodes}, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS, }; use zksync_utils::bytecode::bytecode_len_in_bytes; diff --git a/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs index 7b8a361c5a5..f51c5842d98 100644 --- a/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_m5/vm_with_bootloader.rs @@ -10,11 +10,12 @@ use zk_evm_1_3_1::{ BOOTLOADER_CALLDATA_PAGE, STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_contracts::BaseSystemContracts; use zksync_system_constants::MAX_L2_TX_GAS_LIMIT; use zksync_types::{ - fee_model::L1PeggedBatchFeeModelInput, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, - Address, Transaction, BOOTLOADER_ADDRESS, L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, + fee_model::L1PeggedBatchFeeModelInput, Address, Transaction, BOOTLOADER_ADDRESS, + L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, }; use zksync_utils::{ address_to_u256, bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256, misc::ceil_div, diff --git a/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs b/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs index 33307507f7e..81d11b94f1a 100644 --- a/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs +++ b/core/lib/multivm/src/versions/vm_m6/pubdata_utils.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; use zk_evm_1_3_1::aux_structures::Timestamp; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_types::{ event::{extract_long_l2_to_l1_messages, extract_published_bytecodes}, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, StorageKey, PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS, }; use zksync_utils::bytecode::bytecode_len_in_bytes; diff --git a/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs b/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs index 91a41bdbb0a..988cfaefdf5 100644 --- a/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs +++ b/core/lib/multivm/src/versions/vm_m6/vm_with_bootloader.rs @@ -10,11 +10,12 @@ use zk_evm_1_3_1::{ BOOTLOADER_CALLDATA_PAGE, STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_contracts::BaseSystemContracts; use zksync_system_constants::MAX_L2_TX_GAS_LIMIT; use zksync_types::{ - fee_model::L1PeggedBatchFeeModelInput, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, - Address, Transaction, BOOTLOADER_ADDRESS, L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, + fee_model::L1PeggedBatchFeeModelInput, Address, Transaction, BOOTLOADER_ADDRESS, + L1_GAS_PER_PUBDATA_BYTE, MAX_NEW_FACTORY_DEPS, U256, }; use zksync_utils::{ address_to_u256, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs index 48c1e1f082f..756bd2e7109 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/vm_state.rs @@ -9,12 +9,10 @@ use zk_evm_1_3_3::{ STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::BOOTLOADER_ADDRESS; -use zksync_types::{ - block::MiniblockHasher, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, Address, - MiniblockNumber, -}; +use zksync_types::{block::MiniblockHasher, Address, MiniblockNumber}; use zksync_utils::h256_to_u256; use crate::{ diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs index 106a431edba..c72d947dbca 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/refunds.rs @@ -6,12 +6,12 @@ use zk_evm_1_3_3::{ tracing::{BeforeExecutionData, VmLocalStateData}, vm_state::VmLocalState, }; +use zkevm_test_harness_1_3_3::witness::sort_storage_access::sort_storage_access_queries; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::{PUBLISH_BYTECODE_OVERHEAD, SYSTEM_CONTEXT_ADDRESS}; use zksync_types::{ event::{extract_long_l2_to_l1_messages, extract_published_bytecodes}, l2_to_l1_log::L2ToL1Log, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, L1BatchNumber, StorageKey, U256, }; use zksync_utils::{bytecode::bytecode_len_in_bytes, ceil_div_u256, u256_to_h256}; diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs index c2dc400439d..b4ca5320650 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/vm_state.rs @@ -9,12 +9,10 @@ use zk_evm_1_3_3::{ STARTING_BASE_PAGE, STARTING_TIMESTAMP, }, }; +use zkevm_test_harness_1_3_3::INITIAL_MONOTONIC_CYCLE_COUNTER; use zksync_state::{StoragePtr, WriteStorage}; use zksync_system_constants::BOOTLOADER_ADDRESS; -use zksync_types::{ - block::MiniblockHasher, zkevm_test_harness::INITIAL_MONOTONIC_CYCLE_COUNTER, Address, - MiniblockNumber, -}; +use zksync_types::{block::MiniblockHasher, Address, MiniblockNumber}; use zksync_utils::h256_to_u256; use crate::{ diff --git a/core/lib/object_store/src/objects.rs b/core/lib/object_store/src/objects.rs index dc9865a7c7c..e01519fa71d 100644 --- a/core/lib/object_store/src/objects.rs +++ b/core/lib/object_store/src/objects.rs @@ -13,17 +13,6 @@ use zksync_types::{ SnapshotFactoryDependencies, SnapshotStorageLogsChunk, SnapshotStorageLogsStorageKey, }, storage::witness_block_state::WitnessBlockState, - zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, - bellman::bn256::Bn256, - encodings::{recursion_request::RecursionRequest, QueueSimulator}, - witness::{ - full_block_artifact::{BlockBasicCircuits, BlockBasicCircuitsPublicInputs}, - oracle::VmWitnessOracle, - }, - LeafAggregationOutputDataWitness, NodeAggregationOutputDataWitness, - SchedulerCircuitInstanceWitness, - }, L1BatchNumber, }; @@ -153,72 +142,6 @@ impl StoredObject for PrepareBasicCircuitsJob { serialize_using_bincode!(); } -impl StoredObject for BlockBasicCircuits { - const BUCKET: Bucket = Bucket::LeafAggregationWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("basic_circuits_{key}.bin") - } - - serialize_using_bincode!(); -} - -impl StoredObject for BlockBasicCircuitsPublicInputs { - const BUCKET: Bucket = Bucket::LeafAggregationWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("basic_circuits_inputs_{key}.bin") - } - - serialize_using_bincode!(); -} - -impl StoredObject for SchedulerCircuitInstanceWitness { - const BUCKET: Bucket = Bucket::SchedulerWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("scheduler_witness_{key}.bin") - } - - serialize_using_bincode!(); -} - -impl StoredObject for NodeAggregationOutputDataWitness { - const BUCKET: Bucket = Bucket::SchedulerWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("final_node_aggregations_{key}.bin") - } - - serialize_using_bincode!(); -} - -impl StoredObject for Vec> { - const BUCKET: Bucket = Bucket::NodeAggregationWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("aggregation_outputs_{key}.bin") - } - - serialize_using_bincode!(); -} - -impl StoredObject for Vec, 2, 2>> { - const BUCKET: Bucket = Bucket::NodeAggregationWitnessJobs; - type Key<'a> = L1BatchNumber; - - fn encode_key(key: Self::Key<'_>) -> String { - format!("leaf_layer_subqueues_{key}.bin") - } - - serialize_using_bincode!(); -} - /// Storage key for a [AggregationWrapper`]. #[derive(Debug, Clone, Copy)] pub struct AggregationsKey { @@ -253,23 +176,6 @@ pub struct CircuitKey<'a> { pub aggregation_round: AggregationRound, } -impl StoredObject for ZkSyncCircuit> { - const BUCKET: Bucket = Bucket::ProverJobs; - type Key<'a> = CircuitKey<'a>; - - fn encode_key(key: Self::Key<'_>) -> String { - let CircuitKey { - block_number, - sequence_number, - circuit_type, - aggregation_round, - } = key; - format!("{block_number}_{sequence_number}_{circuit_type}_{aggregation_round:?}.bin") - } - - serialize_using_bincode!(); -} - impl StoredObject for L1BatchProofForL1 { const BUCKET: Bucket = Bucket::ProofsFri; type Key<'a> = L1BatchNumber; diff --git a/core/lib/types/src/lib.rs b/core/lib/types/src/lib.rs index 4c00137edf2..e6d7c739a82 100644 --- a/core/lib/types/src/lib.rs +++ b/core/lib/types/src/lib.rs @@ -26,7 +26,6 @@ pub use zk_evm::{ reference_impls::event_sink::EventMessage, zkevm_opcode_defs::FarCallOpcode, }; -pub use zkevm_test_harness; pub use zksync_basic_types::*; use crate::{l2::TransactionType, protocol_version::ProtocolUpgradeTxCommonData}; @@ -58,6 +57,7 @@ pub mod helpers; pub mod proofs; pub mod proto; pub mod prover_server_api; +pub mod sort_storage_access; pub mod transaction_request; pub mod utils; pub mod vk_transform; diff --git a/core/lib/types/src/sort_storage_access.rs b/core/lib/types/src/sort_storage_access.rs new file mode 100644 index 00000000000..0f9c5524e97 --- /dev/null +++ b/core/lib/types/src/sort_storage_access.rs @@ -0,0 +1,3 @@ +/// Public reexport from `zkevm_test_harness`. +// The aim here is to minimize the surface of public APIs. +pub use zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries; diff --git a/core/lib/zksync_core/Cargo.toml b/core/lib/zksync_core/Cargo.toml index a27281fb7f5..60447b5b55b 100644 --- a/core/lib/zksync_core/Cargo.toml +++ b/core/lib/zksync_core/Cargo.toml @@ -78,7 +78,6 @@ axum = { version = "0.6.19", default-features = false, features = [ ] } once_cell = "1.7" - actix-rt = "2.2.0" actix-cors = "0.6.0-beta.2" actix-web = "4.0.0-beta.8" diff --git a/core/lib/zksync_core/src/genesis.rs b/core/lib/zksync_core/src/genesis.rs index 54989bab93e..8d492ab42cf 100644 --- a/core/lib/zksync_core/src/genesis.rs +++ b/core/lib/zksync_core/src/genesis.rs @@ -13,8 +13,8 @@ use zksync_types::{ fee_model::BatchFeeInput, get_code_key, get_system_context_init_logs, protocol_version::{L1VerifierConfig, ProtocolVersion}, + sort_storage_access::sort_storage_access_queries, tokens::{TokenInfo, TokenMetadata, ETHEREUM_ADDRESS}, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, AccountTreeId, Address, L1BatchNumber, L2ChainId, LogQuery, MiniblockNumber, ProtocolVersionId, StorageKey, StorageLog, StorageLogKind, Timestamp, H256, }; diff --git a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs index df21c890e54..cea82b59edd 100644 --- a/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs +++ b/core/lib/zksync_core/src/state_keeper/io/seal_logic.rs @@ -20,12 +20,12 @@ use zksync_types::{ l2::L2Tx, l2_to_l1_log::{SystemL2ToL1Log, UserL2ToL1Log}, protocol_version::ProtocolUpgradeTx, + sort_storage_access::sort_storage_access_queries, storage_writes_deduplicator::{ModifiedSlot, StorageWritesDeduplicator}, tx::{ tx_execution_info::DeduplicatedWritesMetrics, IncludedTxLocation, TransactionExecutionResult, }, - zkevm_test_harness::witness::sort_storage_access::sort_storage_access_queries, AccountTreeId, Address, ExecuteTransactionCommon, L1BatchNumber, L1BlockNumber, LogQuery, MiniblockNumber, ProtocolVersionId, StorageKey, StorageLog, StorageLogQuery, StorageValue, Transaction, VmEvent, CURRENT_VIRTUAL_BLOCK_INFO_POSITION, H256, SYSTEM_CONTEXT_ADDRESS, diff --git a/prover/Cargo.lock b/prover/Cargo.lock index bea7839b2c3..72818f77ed5 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -3283,6 +3283,7 @@ dependencies = [ "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", "zk_evm 1.4.0", "zk_evm 1.4.1", + "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.4.0", "zkevm_test_harness 1.4.1", "zksync_contracts", @@ -6703,6 +6704,7 @@ dependencies = [ "toml_edit 0.14.4", "tracing", "vlog", + "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.4.1", "zksync_config", "zksync_env_config", @@ -7568,7 +7570,6 @@ dependencies = [ name = "zksync_crypto" version = "0.1.0" dependencies = [ - "base64 0.13.1", "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "once_cell", @@ -7681,6 +7682,7 @@ dependencies = [ "vise", "vk_setup_data_generator_server_fri", "vlog", + "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.4.1", "zksync_config", "zksync_dal", @@ -7854,15 +7856,9 @@ name = "zksync_system_constants" version = "0.1.0" dependencies = [ "anyhow", - "bigdecimal", - "hex", "num 0.3.1", "once_cell", - "serde", - "serde_json", - "url", "zksync_basic_types", - "zksync_contracts", "zksync_utils", ] @@ -7893,7 +7889,6 @@ dependencies = [ "zkevm_test_harness 1.3.3", "zksync_basic_types", "zksync_config", - "zksync_consensus_roles", "zksync_contracts", "zksync_mini_merkle_tree", "zksync_protobuf", diff --git a/prover/proof_fri_compressor/Cargo.toml b/prover/proof_fri_compressor/Cargo.toml index 068de147497..4ac0701acd1 100644 --- a/prover/proof_fri_compressor/Cargo.toml +++ b/prover/proof_fri_compressor/Cargo.toml @@ -20,6 +20,7 @@ zksync_queued_job_processor = { path = "../../core/lib/queued_job_processor" } vk_setup_data_generator_server_fri = { path = "../vk_setup_data_generator_server_fri" } vlog = { path = "../../core/lib/vlog" } +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" } zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.1" } anyhow = "1.0" diff --git a/prover/proof_fri_compressor/src/compressor.rs b/prover/proof_fri_compressor/src/compressor.rs index 3b21ef697bc..d224ca60abe 100644 --- a/prover/proof_fri_compressor/src/compressor.rs +++ b/prover/proof_fri_compressor/src/compressor.rs @@ -4,6 +4,13 @@ use anyhow::Context as _; use async_trait::async_trait; use tokio::task::JoinHandle; use zkevm_test_harness::proof_wrapper_utils::{wrap_proof, WrapperConfig}; +use zkevm_test_harness_1_3_3::{ + abstract_zksync_circuit::concrete_circuits::{ + ZkSyncCircuit, ZkSyncProof, ZkSyncVerificationKey, + }, + bellman::{bn256::Bn256, plonk::better_better_cs::proof::Proof}, + witness::oracle::VmWitnessOracle, +}; use zksync_dal::ConnectionPool; use zksync_object_store::ObjectStore; use zksync_prover_fri_types::{ @@ -17,17 +24,7 @@ use zksync_prover_fri_types::{ get_current_pod_name, AuxOutputWitnessWrapper, FriProofWrapper, }; use zksync_queued_job_processor::JobProcessor; -use zksync_types::{ - aggregated_operations::L1BatchProofForL1, - zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::{ - ZkSyncCircuit, ZkSyncProof, ZkSyncVerificationKey, - }, - bellman::{bn256::Bn256, plonk::better_better_cs::proof::Proof}, - witness::oracle::VmWitnessOracle, - }, - L1BatchNumber, -}; +use zksync_types::{aggregated_operations::L1BatchProofForL1, L1BatchNumber}; use zksync_vk_setup_data_server_fri::{get_recursive_layer_vk_for_circuit_type, get_snark_vk}; use crate::metrics::METRICS; diff --git a/prover/vk_setup_data_generator_server_fri/Cargo.toml b/prover/vk_setup_data_generator_server_fri/Cargo.toml index 31941bfafb7..bb1253f8027 100644 --- a/prover/vk_setup_data_generator_server_fri/Cargo.toml +++ b/prover/vk_setup_data_generator_server_fri/Cargo.toml @@ -25,6 +25,7 @@ vlog = { path = "../../core/lib/vlog" } zksync_types = { path = "../../core/lib/types" } zksync_prover_fri_types = { path = "../prover_fri_types" } +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" } zkevm_test_harness = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.1" } circuit_definitions = { git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.1", features = [ "log_tracing", diff --git a/prover/vk_setup_data_generator_server_fri/src/lib.rs b/prover/vk_setup_data_generator_server_fri/src/lib.rs index fa3de105533..bd3a8cfcb6f 100644 --- a/prover/vk_setup_data_generator_server_fri/src/lib.rs +++ b/prover/vk_setup_data_generator_server_fri/src/lib.rs @@ -9,6 +9,13 @@ use circuit_definitions::circuit_definitions::aux_layer::{ }; use serde::{de::DeserializeOwned, Deserialize, Serialize}; use zkevm_test_harness::prover_utils::create_base_layer_setup_data; +use zkevm_test_harness_1_3_3::{ + abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, + bellman::{ + bn256::Bn256, plonk::better_better_cs::setup::VerificationKey as SnarkVerificationKey, + }, + witness::oracle::VmWitnessOracle as SnarkWitnessOracle, +}; use zksync_config::configs::FriProverConfig; use zksync_env_config::FromEnv; use zksync_prover_fri_types::{ @@ -44,16 +51,7 @@ use zksync_prover_fri_types::{ }, ProverServiceDataKey, }; -use zksync_types::{ - proofs::AggregationRound, - zkevm_test_harness::{ - abstract_zksync_circuit::concrete_circuits::ZkSyncCircuit, - bellman::{ - bn256::Bn256, plonk::better_better_cs::setup::VerificationKey as SnarkVerificationKey, - }, - witness::oracle::VmWitnessOracle as SnarkWitnessOracle, - }, -}; +use zksync_types::proofs::AggregationRound; #[cfg(feature = "gpu")] use {shivini::cs::GpuSetup, std::alloc::Global};