From 8861f2994b674be3c654511416452c0a555d0f73 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Mon, 24 Jun 2024 13:37:33 +0400 Subject: [PATCH] feat: Make all core workspace crate names start with zksync_ (#2294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Renames a bunch of crates (most notably, `multivm` and `vlog`) so that they start with `zksync_` prefix. ## Why ❔ Unification within the workspace, less ambiguity if treated as global crates. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --- Cargo.lock | 264 +++++++++--------- Cargo.toml | 13 +- core/bin/block_reverter/Cargo.toml | 2 +- core/bin/block_reverter/src/main.rs | 4 +- core/bin/contract-verifier/Cargo.toml | 4 +- core/bin/contract-verifier/src/main.rs | 6 +- core/bin/external_node/Cargo.toml | 4 +- .../external_node/src/config/observability.rs | 8 +- core/bin/external_node/src/config/tests.rs | 6 +- core/bin/external_node/src/tests.rs | 4 +- .../Cargo.toml | 2 +- .../src/main.rs | 4 +- core/bin/snapshots_creator/Cargo.toml | 4 +- core/bin/snapshots_creator/src/main.rs | 6 +- .../bin/system-constants-generator/Cargo.toml | 2 +- .../src/intrinsic_costs.rs | 2 +- .../system-constants-generator/src/main.rs | 4 +- .../system-constants-generator/src/utils.rs | 12 +- core/bin/zksync_server/Cargo.toml | 4 +- core/bin/zksync_server/src/main.rs | 4 +- core/bin/zksync_server/src/node_builder.rs | 2 +- core/lib/db_connection/src/instrument.rs | 4 +- core/lib/multivm/Cargo.toml | 2 +- core/lib/multivm/src/interface/traits/vm.rs | 2 +- core/lib/prometheus_exporter/Cargo.toml | 2 +- core/lib/tee_verifier/Cargo.toml | 4 +- core/lib/tee_verifier/src/lib.rs | 14 +- core/lib/utils/Cargo.toml | 2 +- core/lib/utils/src/wait_for_tasks.rs | 4 +- core/lib/vlog/Cargo.toml | 2 +- core/lib/vm_utils/Cargo.toml | 4 +- core/lib/vm_utils/src/lib.rs | 6 +- core/lib/vm_utils/src/storage.rs | 6 +- core/node/api_server/Cargo.toml | 2 +- .../api_server/src/execution_sandbox/apply.rs | 6 +- .../api_server/src/execution_sandbox/error.rs | 2 +- .../src/execution_sandbox/execute.rs | 6 +- .../src/execution_sandbox/testonly.rs | 2 +- .../src/execution_sandbox/tracers.rs | 6 +- .../src/execution_sandbox/validate.rs | 4 +- .../src/execution_sandbox/vm_metrics.rs | 2 +- core/node/api_server/src/tx_sender/mod.rs | 14 +- core/node/api_server/src/tx_sender/result.rs | 2 +- core/node/api_server/src/tx_sender/tests.rs | 2 +- .../api_server/src/web3/namespaces/debug.rs | 4 +- .../api_server/src/web3/namespaces/zks.rs | 2 +- core/node/api_server/src/web3/tests/mod.rs | 2 +- core/node/api_server/src/web3/tests/vm.rs | 2 +- core/node/commitment_generator/Cargo.toml | 2 +- core/node/commitment_generator/src/lib.rs | 2 +- core/node/commitment_generator/src/utils.rs | 2 +- core/node/genesis/Cargo.toml | 2 +- core/node/genesis/src/lib.rs | 2 +- core/node/genesis/src/utils.rs | 6 +- core/node/house_keeper/Cargo.toml | 2 +- .../archiver/fri_gpu_prover_archiver.rs | 2 +- .../archiver/fri_prover_jobs_archiver.rs | 2 +- .../fri_proof_compressor_queue_reporter.rs | 2 +- .../fri_prover_queue_reporter.rs | 2 +- .../fri_witness_generator_queue_reporter.rs | 2 +- .../fri_proof_compressor_job_retry_manager.rs | 2 +- .../fri_prover_job_retry_manager.rs | 2 +- ...ri_witness_generator_jobs_retry_manager.rs | 2 +- ...waiting_to_queued_fri_witness_job_mover.rs | 2 +- core/node/node_framework/Cargo.toml | 6 +- .../node/node_framework/examples/main_node.rs | 4 +- .../layers/prometheus_exporter.rs | 2 +- .../src/implementations/resources/pools.rs | 2 +- core/node/node_sync/Cargo.toml | 2 +- core/node/node_sync/src/external_io.rs | 2 +- core/node/proof_data_handler/Cargo.toml | 2 +- core/node/proof_data_handler/src/tests.rs | 2 +- core/node/state_keeper/Cargo.toml | 4 +- .../src/batch_executor/main_executor.rs | 12 +- .../state_keeper/src/batch_executor/mod.rs | 6 +- .../src/batch_executor/tests/tester.rs | 8 +- core/node/state_keeper/src/io/common/mod.rs | 2 +- core/node/state_keeper/src/io/common/tests.rs | 2 +- core/node/state_keeper/src/io/mempool.rs | 4 +- core/node/state_keeper/src/io/mod.rs | 4 +- core/node/state_keeper/src/io/persistence.rs | 2 +- .../io/seal_logic/l2_block_seal_subtasks.rs | 4 +- .../state_keeper/src/io/seal_logic/mod.rs | 2 +- core/node/state_keeper/src/io/tests/mod.rs | 2 +- core/node/state_keeper/src/io/tests/tester.rs | 2 +- core/node/state_keeper/src/keeper.rs | 2 +- core/node/state_keeper/src/mempool_actor.rs | 2 +- core/node/state_keeper/src/metrics.rs | 2 +- .../criteria/gas_for_batch_tip.rs | 2 +- .../criteria/geometry_seal_criteria.rs | 4 +- .../seal_criteria/criteria/pubdata_bytes.rs | 2 +- .../src/seal_criteria/criteria/slots.rs | 2 +- .../criteria/tx_encoding_size.rs | 2 +- .../state_keeper/src/seal_criteria/mod.rs | 2 +- core/node/state_keeper/src/testonly/mod.rs | 10 +- .../src/testonly/test_batch_executor.rs | 8 +- core/node/state_keeper/src/tests/mod.rs | 6 +- core/node/state_keeper/src/types.rs | 2 +- .../src/updates/l1_batch_updates.rs | 4 +- .../src/updates/l2_block_updates.rs | 4 +- core/node/state_keeper/src/updates/mod.rs | 4 +- .../tee_verifier_input_producer/Cargo.toml | 2 +- .../tee_verifier_input_producer/src/lib.rs | 2 +- core/node/test_utils/Cargo.toml | 2 +- core/node/test_utils/src/lib.rs | 2 +- core/node/vm_runner/Cargo.toml | 4 +- core/node/vm_runner/src/process.rs | 2 +- core/node/vm_runner/src/storage.rs | 4 +- .../vm_runner/src/tests/output_handler.rs | 2 +- core/tests/loadnext/Cargo.toml | 4 +- core/tests/loadnext/src/main.rs | 6 +- core/tests/vm-benchmark/Cargo.toml | 3 +- core/tests/vm-benchmark/benches/criterion.rs | 2 +- .../vm-benchmark/benches/diy_benchmark.rs | 2 +- core/tests/vm-benchmark/benches/iai.rs | 2 +- core/tests/vm-benchmark/harness/Cargo.toml | 5 +- .../harness/src/instruction_counter.rs | 4 +- core/tests/vm-benchmark/harness/src/lib.rs | 12 +- core/tests/vm-benchmark/src/find_slowest.rs | 2 +- .../vm-benchmark/src/instruction_counts.rs | 2 +- core/tests/vm-benchmark/src/main.rs | 2 +- prover/Cargo.lock | 176 ++++++------ prover/Cargo.toml | 8 +- prover/proof_fri_compressor/Cargo.toml | 6 +- prover/proof_fri_compressor/src/compressor.rs | 2 +- prover/proof_fri_compressor/src/main.rs | 8 +- prover/prover_cli/Cargo.toml | 4 +- prover/prover_cli/src/commands/delete.rs | 2 +- prover/prover_cli/src/commands/requeue.rs | 2 +- prover/prover_cli/src/commands/restart.rs | 6 +- .../prover_cli/src/commands/status/batch.rs | 2 +- prover/prover_cli/src/commands/status/l1.rs | 2 +- prover/prover_dal/Cargo.toml | 2 +- prover/prover_fri/Cargo.toml | 6 +- .../src/gpu_prover_availability_checker.rs | 2 +- .../src/gpu_prover_job_processor.rs | 6 +- prover/prover_fri/src/main.rs | 8 +- prover/prover_fri/src/prover_job_processor.rs | 6 +- prover/prover_fri/src/socket_listener.rs | 2 +- prover/prover_fri/src/utils.rs | 2 +- prover/prover_fri_gateway/Cargo.toml | 6 +- .../src/api_data_fetcher.rs | 2 +- prover/prover_fri_gateway/src/main.rs | 8 +- .../src/proof_gen_data_fetcher.rs | 2 +- .../prover_fri_gateway/src/proof_submitter.rs | 2 +- prover/prover_fri_utils/Cargo.toml | 2 +- prover/prover_fri_utils/src/lib.rs | 2 +- .../Cargo.toml | 2 +- prover/witness_generator/Cargo.toml | 8 +- .../witness_generator/src/basic_circuits.rs | 8 +- .../witness_generator/src/leaf_aggregation.rs | 2 +- prover/witness_generator/src/main.rs | 8 +- .../witness_generator/src/node_aggregation.rs | 2 +- prover/witness_generator/src/recursion_tip.rs | 2 +- prover/witness_generator/src/scheduler.rs | 2 +- prover/witness_generator/src/utils.rs | 2 +- prover/witness_vector_generator/Cargo.toml | 6 +- .../witness_vector_generator/src/generator.rs | 2 +- prover/witness_vector_generator/src/main.rs | 8 +- 159 files changed, 520 insertions(+), 515 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b013517e0cc2..3ceca59262f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -637,13 +637,13 @@ dependencies = [ "clap 4.4.6", "serde_json", "tokio", - "vlog", "zksync_block_reverter", "zksync_config", "zksync_dal", "zksync_env_config", "zksync_object_store", "zksync_types", + "zksync_vlog", ] [[package]] @@ -3304,7 +3304,6 @@ dependencies = [ "hex", "num", "once_cell", - "prometheus_exporter", "rand 0.8.5", "regex", "reqwest", @@ -3315,14 +3314,15 @@ dependencies = [ "tokio", "tracing", "vise", - "vlog", "zksync_config", "zksync_contracts", "zksync_eth_client", "zksync_eth_signer", + "zksync_prometheus_exporter", "zksync_system_constants", "zksync_types", "zksync_utils", + "zksync_vlog", "zksync_web3_decl", ] @@ -3476,12 +3476,12 @@ dependencies = [ "anyhow", "clap 4.4.6", "tracing", - "vlog", "zksync_config", "zksync_env_config", "zksync_merkle_tree", "zksync_storage", "zksync_types", + "zksync_vlog", ] [[package]] @@ -3625,39 +3625,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "multivm" -version = "0.1.0" -dependencies = [ - "anyhow", - "circuit_sequencer_api 0.1.0", - "circuit_sequencer_api 0.1.40", - "circuit_sequencer_api 0.1.41", - "circuit_sequencer_api 0.1.42", - "circuit_sequencer_api 0.1.50", - "ethabi", - "hex", - "itertools 0.10.5", - "once_cell", - "serde", - "thiserror", - "tokio", - "tracing", - "vise", - "zk_evm 1.3.1", - "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", - "zk_evm 1.5.0", - "zksync_contracts", - "zksync_eth_signer", - "zksync_state", - "zksync_system_constants", - "zksync_test_account", - "zksync_types", - "zksync_utils", -] - [[package]] name = "native-tls" version = "0.2.11" @@ -4588,18 +4555,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "prometheus_exporter" -version = "0.1.0" -dependencies = [ - "anyhow", - "metrics", - "metrics-exporter-prometheus", - "tokio", - "vise", - "vise-exporter", -] - [[package]] name = "prost" version = "0.11.9" @@ -4720,16 +4675,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prover_dal" -version = "0.1.0" -dependencies = [ - "sqlx", - "strum", - "zksync_basic_types", - "zksync_db_connection", -] - [[package]] name = "ptr_meta" version = "0.1.4" @@ -5912,17 +5857,17 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "prometheus_exporter", "rand 0.8.5", "tokio", "tracing", "vise", - "vlog", "zksync_config", "zksync_dal", "zksync_env_config", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_types", + "zksync_vlog", ] [[package]] @@ -6394,11 +6339,11 @@ name = "system-constants-generator" version = "0.1.0" dependencies = [ "codegen 0.2.0", - "multivm", "once_cell", "serde", "serde_json", "zksync_contracts", + "zksync_multivm", "zksync_state", "zksync_types", "zksync_utils", @@ -7174,22 +7119,6 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "vlog" -version = "0.1.0" -dependencies = [ - "chrono", - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "sentry", - "serde", - "serde_json", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", -] - [[package]] name = "vm-benchmark" version = "0.1.0" @@ -7199,36 +7128,7 @@ dependencies = [ "metrics-exporter-prometheus", "tokio", "vise", - "vm-benchmark-harness", -] - -[[package]] -name = "vm-benchmark-harness" -version = "0.1.0" -dependencies = [ - "multivm", - "once_cell", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", - "zksync_contracts", - "zksync_state", - "zksync_system_constants", - "zksync_types", - "zksync_utils", -] - -[[package]] -name = "vm_utils" -version = "0.1.0" -dependencies = [ - "anyhow", - "multivm", - "tokio", - "tracing", - "zksync_contracts", - "zksync_dal", - "zksync_state", - "zksync_types", - "zksync_utils", + "zksync_vm_benchmark_harness", ] [[package]] @@ -7954,7 +7854,6 @@ dependencies = [ "circuit_sequencer_api 0.1.50", "futures 0.3.28", "itertools 0.10.5", - "multivm", "num_cpus", "rand 0.8.5", "serde_json", @@ -7969,6 +7868,7 @@ dependencies = [ "zksync_eth_client", "zksync_health_check", "zksync_l1_contract_interface", + "zksync_multivm", "zksync_node_genesis", "zksync_node_test_utils", "zksync_types", @@ -8192,17 +8092,17 @@ dependencies = [ "anyhow", "ctrlc", "futures 0.3.28", - "prometheus_exporter", "structopt", "tokio", "tracing", - "vlog", "zksync_config", "zksync_contract_verifier_lib", "zksync_dal", "zksync_env_config", + "zksync_prometheus_exporter", "zksync_queued_job_processor", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -8440,7 +8340,6 @@ dependencies = [ "clap 4.4.6", "envy", "futures 0.3.28", - "prometheus_exporter", "rustc_version", "semver", "serde", @@ -8451,7 +8350,6 @@ dependencies = [ "tracing", "url", "vise", - "vlog", "zksync_block_reverter", "zksync_commitment_generator", "zksync_concurrency", @@ -8475,6 +8373,7 @@ dependencies = [ "zksync_node_genesis", "zksync_node_sync", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_protobuf_config", "zksync_reorg_detector", "zksync_shared_metrics", @@ -8484,6 +8383,7 @@ dependencies = [ "zksync_storage", "zksync_types", "zksync_utils", + "zksync_vlog", "zksync_web3_decl", ] @@ -8508,12 +8408,12 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "prover_dal", "tokio", "tracing", "vise", "zksync_config", "zksync_dal", + "zksync_prover_dal", "zksync_shared_metrics", "zksync_types", ] @@ -8618,6 +8518,39 @@ dependencies = [ "zksync_crypto", ] +[[package]] +name = "zksync_multivm" +version = "0.1.0" +dependencies = [ + "anyhow", + "circuit_sequencer_api 0.1.0", + "circuit_sequencer_api 0.1.40", + "circuit_sequencer_api 0.1.41", + "circuit_sequencer_api 0.1.42", + "circuit_sequencer_api 0.1.50", + "ethabi", + "hex", + "itertools 0.10.5", + "once_cell", + "serde", + "thiserror", + "tokio", + "tracing", + "vise", + "zk_evm 1.3.1", + "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", + "zk_evm 1.5.0", + "zksync_contracts", + "zksync_eth_signer", + "zksync_state", + "zksync_system_constants", + "zksync_test_account", + "zksync_types", + "zksync_utils", +] + [[package]] name = "zksync_node_api_server" version = "0.1.0" @@ -8633,7 +8566,6 @@ dependencies = [ "http", "itertools 0.10.5", "lru", - "multivm", "once_cell", "pin-project-lite", "rand 0.8.5", @@ -8653,6 +8585,7 @@ dependencies = [ "zksync_health_check", "zksync_metadata_calculator", "zksync_mini_merkle_tree", + "zksync_multivm", "zksync_node_fee_model", "zksync_node_genesis", "zksync_node_sync", @@ -8758,12 +8691,9 @@ dependencies = [ "async-trait", "ctrlc", "futures 0.3.28", - "prometheus_exporter", - "prover_dal", "thiserror", "tokio", "tracing", - "vlog", "zksync_block_reverter", "zksync_circuit_breaker", "zksync_commitment_generator", @@ -8787,8 +8717,10 @@ dependencies = [ "zksync_node_fee_model", "zksync_node_sync", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_proof_data_handler", "zksync_protobuf_config", + "zksync_prover_dal", "zksync_queued_job_processor", "zksync_reorg_detector", "zksync_state", @@ -8797,6 +8729,7 @@ dependencies = [ "zksync_tee_verifier_input_producer", "zksync_types", "zksync_utils", + "zksync_vlog", "zksync_vm_runner", "zksync_web3_decl", ] @@ -8807,7 +8740,6 @@ version = "0.1.0" dependencies = [ "anyhow", "itertools 0.10.5", - "multivm", "thiserror", "tokio", "tracing", @@ -8817,6 +8749,7 @@ dependencies = [ "zksync_dal", "zksync_eth_client", "zksync_merkle_tree", + "zksync_multivm", "zksync_system_constants", "zksync_types", "zksync_utils", @@ -8839,7 +8772,6 @@ dependencies = [ "tokio", "tracing", "vise", - "vm_utils", "zksync_concurrency", "zksync_config", "zksync_contracts", @@ -8853,6 +8785,7 @@ dependencies = [ "zksync_system_constants", "zksync_types", "zksync_utils", + "zksync_vm_utils", "zksync_web3_decl", ] @@ -8860,10 +8793,10 @@ dependencies = [ name = "zksync_node_test_utils" version = "0.1.0" dependencies = [ - "multivm", "zksync_contracts", "zksync_dal", "zksync_merkle_tree", + "zksync_multivm", "zksync_node_genesis", "zksync_system_constants", "zksync_types", @@ -8895,6 +8828,18 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_prometheus_exporter" +version = "0.1.0" +dependencies = [ + "anyhow", + "metrics", + "metrics-exporter-prometheus", + "tokio", + "vise", + "vise-exporter", +] + [[package]] name = "zksync_proof_data_handler" version = "0.1.0" @@ -8903,7 +8848,6 @@ dependencies = [ "axum", "chrono", "hyper", - "multivm", "serde_json", "tokio", "tower", @@ -8912,6 +8856,7 @@ dependencies = [ "zksync_config", "zksync_contracts", "zksync_dal", + "zksync_multivm", "zksync_object_store", "zksync_prover_interface", "zksync_tee_verifier", @@ -8972,6 +8917,16 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_prover_dal" +version = "0.1.0" +dependencies = [ + "sqlx", + "strum", + "zksync_basic_types", + "zksync_db_connection", +] + [[package]] name = "zksync_prover_interface" version = "0.1.0" @@ -9028,12 +8983,10 @@ dependencies = [ "anyhow", "clap 4.4.6", "futures 0.3.28", - "prometheus_exporter", "serde_json", "tikv-jemallocator", "tokio", "tracing", - "vlog", "zksync_concurrency", "zksync_config", "zksync_consensus_crypto", @@ -9046,10 +8999,12 @@ dependencies = [ "zksync_node_api_server", "zksync_node_framework", "zksync_node_genesis", + "zksync_prometheus_exporter", "zksync_protobuf_config", "zksync_storage", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -9120,7 +9075,6 @@ dependencies = [ "futures 0.3.28", "hex", "itertools 0.10.5", - "multivm", "once_cell", "tempfile", "test-casing", @@ -9128,12 +9082,12 @@ dependencies = [ "tokio", "tracing", "vise", - "vm_utils", "zksync_config", "zksync_contracts", "zksync_dal", "zksync_eth_client", "zksync_mempool", + "zksync_multivm", "zksync_node_fee_model", "zksync_node_genesis", "zksync_node_test_utils", @@ -9145,6 +9099,7 @@ dependencies = [ "zksync_test_account", "zksync_types", "zksync_utils", + "zksync_vm_utils", ] [[package]] @@ -9174,10 +9129,8 @@ name = "zksync_tee_verifier" version = "0.1.0" dependencies = [ "anyhow", - "multivm", "serde", "tracing", - "vm_utils", "zksync_basic_types", "zksync_config", "zksync_contracts", @@ -9185,12 +9138,14 @@ dependencies = [ "zksync_dal", "zksync_db_connection", "zksync_merkle_tree", + "zksync_multivm", "zksync_object_store", "zksync_prover_interface", "zksync_queued_job_processor", "zksync_state", "zksync_types", "zksync_utils", + "zksync_vm_utils", ] [[package]] @@ -9202,7 +9157,6 @@ dependencies = [ "tokio", "tracing", "vise", - "vm_utils", "zksync_dal", "zksync_object_store", "zksync_prover_interface", @@ -9210,6 +9164,7 @@ dependencies = [ "zksync_tee_verifier", "zksync_types", "zksync_utils", + "zksync_vm_utils", ] [[package]] @@ -9278,9 +9233,39 @@ dependencies = [ "thiserror", "tokio", "tracing", - "vlog", "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", "zksync_basic_types", + "zksync_vlog", +] + +[[package]] +name = "zksync_vlog" +version = "0.1.0" +dependencies = [ + "chrono", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "sentry", + "serde", + "serde_json", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", +] + +[[package]] +name = "zksync_vm_benchmark_harness" +version = "0.1.0" +dependencies = [ + "once_cell", + "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", + "zksync_contracts", + "zksync_multivm", + "zksync_state", + "zksync_system_constants", + "zksync_types", + "zksync_utils", ] [[package]] @@ -9292,16 +9277,15 @@ dependencies = [ "backon", "dashmap", "futures 0.3.28", - "multivm", "once_cell", "rand 0.8.5", "tempfile", "tokio", "tracing", "vise", - "vm_utils", "zksync_contracts", "zksync_dal", + "zksync_multivm", "zksync_node_genesis", "zksync_node_test_utils", "zksync_state", @@ -9310,6 +9294,22 @@ dependencies = [ "zksync_test_account", "zksync_types", "zksync_utils", + "zksync_vm_utils", +] + +[[package]] +name = "zksync_vm_utils" +version = "0.1.0" +dependencies = [ + "anyhow", + "tokio", + "tracing", + "zksync_contracts", + "zksync_dal", + "zksync_multivm", + "zksync_state", + "zksync_types", + "zksync_utils", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5d9f6adf37ad..05f22a033cc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,13 +203,12 @@ zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era zksync_protobuf_build = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "3e6f101ee4124308c4c974caaa259d524549b0c6" } # "Local" dependencies -multivm = { path = "core/lib/multivm" } -prometheus_exporter = { path = "core/lib/prometheus_exporter" } -prover_dal = { path = "prover/prover_dal" } -vlog = { path = "core/lib/vlog" } -vm_utils = { path = "core/lib/vm_utils" } -vm-benchmark-harness = { path = "core/tests/vm-benchmark/harness" } -zksync = { path = "sdk/zksync-rs" } +zksync_multivm = { path = "core/lib/multivm" } +zksync_prometheus_exporter = { path = "core/lib/prometheus_exporter" } +zksync_prover_dal = { path = "prover/prover_dal" } +zksync_vlog = { path = "core/lib/vlog" } +zksync_vm_utils = { path = "core/lib/vm_utils" } +zksync_vm_benchmark_harness = { path = "core/tests/vm-benchmark/harness" } zksync_basic_types = { path = "core/lib/basic_types" } zksync_circuit_breaker = { path = "core/lib/circuit_breaker" } zksync_config = { path = "core/lib/config" } diff --git a/core/bin/block_reverter/Cargo.toml b/core/bin/block_reverter/Cargo.toml index 5f32f68acbd8..3517b353b68e 100644 --- a/core/bin/block_reverter/Cargo.toml +++ b/core/bin/block_reverter/Cargo.toml @@ -17,7 +17,7 @@ zksync_dal.workspace = true zksync_object_store.workspace = true zksync_types.workspace = true zksync_block_reverter.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true clap = { workspace = true, features = ["derive"] } diff --git a/core/bin/block_reverter/src/main.rs b/core/bin/block_reverter/src/main.rs index 53ba90d99ffe..7864a75f95eb 100644 --- a/core/bin/block_reverter/src/main.rs +++ b/core/bin/block_reverter/src/main.rs @@ -87,12 +87,12 @@ async fn main() -> anyhow::Result<()> { let command = Cli::parse().command; let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new() + let mut builder = zksync_vlog::ObservabilityBuilder::new() .with_log_format(log_format) .disable_default_logs(); // It's a CLI application, so we only need to show logs that were actually requested. if let Some(sentry_url) = observability_config.sentry_url { diff --git a/core/bin/contract-verifier/Cargo.toml b/core/bin/contract-verifier/Cargo.toml index 3e9832f995f9..0b5b4213c56e 100644 --- a/core/bin/contract-verifier/Cargo.toml +++ b/core/bin/contract-verifier/Cargo.toml @@ -17,8 +17,8 @@ zksync_config.workspace = true zksync_contract_verifier_lib.workspace = true zksync_queued_job_processor.workspace = true zksync_utils.workspace = true -prometheus_exporter.workspace = true -vlog.workspace = true +zksync_prometheus_exporter.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true tokio = { workspace = true, features = ["full"] } diff --git a/core/bin/contract-verifier/src/main.rs b/core/bin/contract-verifier/src/main.rs index 118e7f41be97..db26de9f8157 100644 --- a/core/bin/contract-verifier/src/main.rs +++ b/core/bin/contract-verifier/src/main.rs @@ -2,7 +2,6 @@ use std::{cell::RefCell, time::Duration}; use anyhow::Context as _; use futures::{channel::mpsc, executor::block_on, SinkExt, StreamExt}; -use prometheus_exporter::PrometheusExporterConfig; use structopt::StructOpt; use tokio::sync::watch; use zksync_config::{ @@ -12,6 +11,7 @@ use zksync_config::{ use zksync_contract_verifier_lib::ContractVerifier; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_env_config::FromEnv; +use zksync_prometheus_exporter::PrometheusExporterConfig; use zksync_queued_job_processor::JobProcessor; use zksync_utils::{wait_for_tasks::ManagedTasks, workspace_dir_or_current_dir}; @@ -140,11 +140,11 @@ async fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url) diff --git a/core/bin/external_node/Cargo.toml b/core/bin/external_node/Cargo.toml index ee6aa08be9da..fb324ba5108c 100644 --- a/core/bin/external_node/Cargo.toml +++ b/core/bin/external_node/Cargo.toml @@ -25,7 +25,7 @@ zksync_contracts.workspace = true zksync_l1_contract_interface.workspace = true zksync_snapshots_applier.workspace = true zksync_object_store.workspace = true -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true zksync_health_check.workspace = true zksync_web3_decl.workspace = true zksync_types.workspace = true @@ -43,7 +43,7 @@ zksync_node_sync.workspace = true zksync_node_api_server.workspace = true zksync_node_consensus.workspace = true zksync_node_framework.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true zksync_concurrency.workspace = true zksync_consensus_roles.workspace = true diff --git a/core/bin/external_node/src/config/observability.rs b/core/bin/external_node/src/config/observability.rs index a571b071b5e2..4e196dcc7132 100644 --- a/core/bin/external_node/src/config/observability.rs +++ b/core/bin/external_node/src/config/observability.rs @@ -1,9 +1,9 @@ use std::{collections::HashMap, time::Duration}; use anyhow::Context as _; -use prometheus_exporter::PrometheusExporterConfig; use serde::Deserialize; -use vlog::LogFormat; +use zksync_prometheus_exporter::PrometheusExporterConfig; +use zksync_vlog::LogFormat; use super::{ConfigurationSource, Environment}; @@ -78,8 +78,8 @@ impl ObservabilityENConfig { } } - pub fn build_observability(&self) -> anyhow::Result { - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(self.log_format); + pub fn build_observability(&self) -> anyhow::Result { + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(self.log_format); // Some legacy deployments use `unset` as an equivalent of `None`. let sentry_url = self.sentry_url.as_deref().filter(|&url| url != "unset"); if let Some(sentry_url) = sentry_url { diff --git a/core/bin/external_node/src/config/tests.rs b/core/bin/external_node/src/config/tests.rs index 79db5a174970..1b42b98a32a4 100644 --- a/core/bin/external_node/src/config/tests.rs +++ b/core/bin/external_node/src/config/tests.rs @@ -42,12 +42,12 @@ fn parsing_observability_config() { assert_eq!(config.prometheus_port, Some(3322)); assert_eq!(config.sentry_url.unwrap(), "https://example.com/"); assert_eq!(config.sentry_environment.unwrap(), "mainnet - mainnet2"); - assert_matches!(config.log_format, vlog::LogFormat::Plain); + assert_matches!(config.log_format, zksync_vlog::LogFormat::Plain); assert_eq!(config.prometheus_push_interval_ms, 10_000); env_vars.0.insert("MISC_LOG_FORMAT", "json"); let config = ObservabilityENConfig::new(&env_vars).unwrap(); - assert_matches!(config.log_format, vlog::LogFormat::Json); + assert_matches!(config.log_format, zksync_vlog::LogFormat::Json); // If both the canonical and obsolete vars are specified, the canonical one should prevail. env_vars.0.insert("EN_LOG_FORMAT", "plain"); @@ -55,7 +55,7 @@ fn parsing_observability_config() { .0 .insert("EN_SENTRY_URL", "https://example.com/new"); let config = ObservabilityENConfig::new(&env_vars).unwrap(); - assert_matches!(config.log_format, vlog::LogFormat::Plain); + assert_matches!(config.log_format, zksync_vlog::LogFormat::Plain); assert_eq!(config.sentry_url.unwrap(), "https://example.com/new"); } diff --git a/core/bin/external_node/src/tests.rs b/core/bin/external_node/src/tests.rs index 8966a7ac3f3b..a7b944f15714 100644 --- a/core/bin/external_node/src/tests.rs +++ b/core/bin/external_node/src/tests.rs @@ -133,7 +133,7 @@ fn mock_eth_client(diamond_proxy_addr: Address) -> MockClient { #[tokio::test] #[tracing::instrument] // Add args to the test logs async fn external_node_basics(components_str: &'static str) { - let _guard = vlog::ObservabilityBuilder::new().build(); // Enable logging to simplify debugging + let _guard = zksync_vlog::ObservabilityBuilder::new().build(); // Enable logging to simplify debugging let temp_dir = tempfile::TempDir::new().unwrap(); // Simplest case to mock: the EN already has a genesis L1 batch / L2 block, and it's the only L1 batch / L2 block @@ -252,7 +252,7 @@ async fn external_node_basics(components_str: &'static str) { #[tokio::test] async fn node_reacts_to_stop_signal_during_initial_reorg_detection() { - let _guard = vlog::ObservabilityBuilder::new().build(); // Enable logging to simplify debugging + let _guard = zksync_vlog::ObservabilityBuilder::new().build(); // Enable logging to simplify debugging let temp_dir = tempfile::TempDir::new().unwrap(); let connection_pool = ConnectionPool::test_pool().await; diff --git a/core/bin/merkle_tree_consistency_checker/Cargo.toml b/core/bin/merkle_tree_consistency_checker/Cargo.toml index 75fa4fc10be1..9d13a2b0d199 100644 --- a/core/bin/merkle_tree_consistency_checker/Cargo.toml +++ b/core/bin/merkle_tree_consistency_checker/Cargo.toml @@ -16,7 +16,7 @@ zksync_env_config.workspace = true zksync_merkle_tree.workspace = true zksync_types.workspace = true zksync_storage.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true clap = { workspace = true, features = ["derive"] } diff --git a/core/bin/merkle_tree_consistency_checker/src/main.rs b/core/bin/merkle_tree_consistency_checker/src/main.rs index 82550d272771..f8584653681f 100644 --- a/core/bin/merkle_tree_consistency_checker/src/main.rs +++ b/core/bin/merkle_tree_consistency_checker/src/main.rs @@ -54,11 +54,11 @@ impl Cli { fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = observability_config.sentry_url { builder = builder .with_sentry_url(&sentry_url) diff --git a/core/bin/snapshots_creator/Cargo.toml b/core/bin/snapshots_creator/Cargo.toml index 4fe88a64db49..8e3f56498ee8 100644 --- a/core/bin/snapshots_creator/Cargo.toml +++ b/core/bin/snapshots_creator/Cargo.toml @@ -12,13 +12,13 @@ publish = false [dependencies] vise.workspace = true -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true zksync_config.workspace = true zksync_dal.workspace = true zksync_env_config.workspace = true zksync_types.workspace = true zksync_object_store.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true tokio = { workspace = true, features = ["full"] } diff --git a/core/bin/snapshots_creator/src/main.rs b/core/bin/snapshots_creator/src/main.rs index 91751f6d2ddf..52387ceead83 100644 --- a/core/bin/snapshots_creator/src/main.rs +++ b/core/bin/snapshots_creator/src/main.rs @@ -10,7 +10,6 @@ //! at a time). use anyhow::Context as _; -use prometheus_exporter::PrometheusExporterConfig; use tokio::{sync::watch, task::JoinHandle}; use zksync_config::{ configs::{DatabaseSecrets, ObservabilityConfig, PrometheusConfig}, @@ -19,6 +18,7 @@ use zksync_config::{ use zksync_dal::{ConnectionPool, Core}; use zksync_env_config::{object_store::SnapshotsObjectStoreConfig, FromEnv}; use zksync_object_store::ObjectStoreFactory; +use zksync_prometheus_exporter::PrometheusExporterConfig; use crate::creator::SnapshotCreator; @@ -55,13 +55,13 @@ async fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; let prometheus_exporter_task = maybe_enable_prometheus_metrics(stop_receiver).await?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = observability_config.sentry_url { builder = builder .with_sentry_url(&sentry_url) diff --git a/core/bin/system-constants-generator/Cargo.toml b/core/bin/system-constants-generator/Cargo.toml index 4dc4c507c07b..6f52ed28b2d4 100644 --- a/core/bin/system-constants-generator/Cargo.toml +++ b/core/bin/system-constants-generator/Cargo.toml @@ -15,7 +15,7 @@ zksync_state.workspace = true zksync_types.workspace = true zksync_utils.workspace = true zksync_contracts.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true codegen.workspace = true serde.workspace = true diff --git a/core/bin/system-constants-generator/src/intrinsic_costs.rs b/core/bin/system-constants-generator/src/intrinsic_costs.rs index c94592defeee..f50cd9eb3a22 100644 --- a/core/bin/system-constants-generator/src/intrinsic_costs.rs +++ b/core/bin/system-constants-generator/src/intrinsic_costs.rs @@ -4,7 +4,7 @@ //! as well as contracts/SystemConfig.json //! -use multivm::utils::get_bootloader_encoding_space; +use zksync_multivm::utils::get_bootloader_encoding_space; use zksync_types::{ethabi::Address, IntrinsicSystemGasConstants, ProtocolVersionId, U256}; use crate::utils::{ diff --git a/core/bin/system-constants-generator/src/main.rs b/core/bin/system-constants-generator/src/main.rs index b0276aeb7fa1..7ada47302248 100644 --- a/core/bin/system-constants-generator/src/main.rs +++ b/core/bin/system-constants-generator/src/main.rs @@ -1,7 +1,8 @@ use std::fs; use codegen::{Block, Scope}; -use multivm::{ +use serde::{Deserialize, Serialize}; +use zksync_multivm::{ utils::{get_bootloader_encoding_space, get_bootloader_max_txs_in_batch}, vm_latest::constants::MAX_VM_PUBDATA_PER_BATCH, zk_evm_latest::zkevm_opcode_defs::{ @@ -12,7 +13,6 @@ use multivm::{ system_params::MAX_TX_ERGS_LIMIT, }, }; -use serde::{Deserialize, Serialize}; 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/bin/system-constants-generator/src/utils.rs b/core/bin/system-constants-generator/src/utils.rs index 329ff77738c7..a56c85a7d5b6 100644 --- a/core/bin/system-constants-generator/src/utils.rs +++ b/core/bin/system-constants-generator/src/utils.rs @@ -1,6 +1,11 @@ use std::{cell::RefCell, rc::Rc}; -use multivm::{ +use once_cell::sync::Lazy; +use zksync_contracts::{ + load_sys_contract, read_bootloader_code, read_sys_contract_bytecode, read_zbin_bytecode, + BaseSystemContracts, ContractLanguage, SystemContractCode, +}; +use zksync_multivm::{ interface::{ dyn_tracers::vm_1_5_0::DynTracer, tracer::VmExecutionStopReason, L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode, VmExecutionMode, VmInterface, @@ -12,11 +17,6 @@ use multivm::{ }, zk_evm_latest::aux_structures::Timestamp, }; -use once_cell::sync::Lazy; -use zksync_contracts::{ - load_sys_contract, read_bootloader_code, read_sys_contract_bytecode, read_zbin_bytecode, - BaseSystemContracts, ContractLanguage, SystemContractCode, -}; use zksync_state::{InMemoryStorage, StorageView, WriteStorage}; use zksync_types::{ block::L2BlockHasher, ethabi::Token, fee::Fee, fee_model::BatchFeeInput, l1::L1Tx, l2::L2Tx, diff --git a/core/bin/zksync_server/Cargo.toml b/core/bin/zksync_server/Cargo.toml index a2f9067872e2..4df475f3a4eb 100644 --- a/core/bin/zksync_server/Cargo.toml +++ b/core/bin/zksync_server/Cargo.toml @@ -26,7 +26,7 @@ zksync_consensus_crypto.workspace = true zksync_consensus_roles.workspace = true zksync_consensus_executor.workspace = true zksync_concurrency.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true clap = { workspace = true, features = ["derive"] } @@ -38,7 +38,7 @@ futures.workspace = true zksync_node_framework.workspace = true zksync_metadata_calculator.workspace = true zksync_node_api_server.workspace = true -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true [target.'cfg(not(target_env = "msvc"))'.dependencies] tikv-jemallocator.workspace = true diff --git a/core/bin/zksync_server/src/main.rs b/core/bin/zksync_server/src/main.rs index dfb11b55da92..5e1d5480d75c 100644 --- a/core/bin/zksync_server/src/main.rs +++ b/core/bin/zksync_server/src/main.rs @@ -108,12 +108,12 @@ fn main() -> anyhow::Result<()> { .clone() .context("observability config")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(log_directives) = observability_config.log_directives { builder = builder.with_log_directives(log_directives); } diff --git a/core/bin/zksync_server/src/node_builder.rs b/core/bin/zksync_server/src/node_builder.rs index 563c413cc346..d1fecb1e3d7e 100644 --- a/core/bin/zksync_server/src/node_builder.rs +++ b/core/bin/zksync_server/src/node_builder.rs @@ -2,7 +2,6 @@ //! as well as an interface to run the node with the specified components. use anyhow::Context; -use prometheus_exporter::PrometheusExporterConfig; use zksync_config::{ configs::{consensus::ConsensusConfig, wallets::Wallets, GeneralConfig, Secrets}, ContractsConfig, GenesisConfig, @@ -50,6 +49,7 @@ use zksync_node_framework::{ }, service::{ZkStackService, ZkStackServiceBuilder}, }; +use zksync_prometheus_exporter::PrometheusExporterConfig; /// Macro that looks into a path to fetch an optional config, /// and clones it into a variable. diff --git a/core/lib/db_connection/src/instrument.rs b/core/lib/db_connection/src/instrument.rs index 91f207838c3b..244329ca75bb 100644 --- a/core/lib/db_connection/src/instrument.rs +++ b/core/lib/db_connection/src/instrument.rs @@ -498,7 +498,7 @@ mod tests { #[tokio::test] async fn instrumenting_erroneous_query() { let pool = ConnectionPool::::test_pool().await; - // Add `vlog::init()` here to debug this test + // Add `zksync_vlog::init()` here to debug this test let mut conn = pool.connection().await.unwrap(); sqlx::query("WHAT") @@ -514,7 +514,7 @@ mod tests { #[tokio::test] async fn instrumenting_slow_query() { let pool = ConnectionPool::::test_pool().await; - // Add `vlog::init()` here to debug this test + // Add `zksync_vlog::init()` here to debug this test let mut conn = pool.connection().await.unwrap(); sqlx::query("SELECT pg_sleep(1.5)") diff --git a/core/lib/multivm/Cargo.toml b/core/lib/multivm/Cargo.toml index d76257d342d9..0555a3e8961d 100644 --- a/core/lib/multivm/Cargo.toml +++ b/core/lib/multivm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "multivm" +name = "zksync_multivm" version = "0.1.0" edition.workspace = true authors.workspace = true diff --git a/core/lib/multivm/src/interface/traits/vm.rs b/core/lib/multivm/src/interface/traits/vm.rs index 0e90a42e4888..499c46a7b52d 100644 --- a/core/lib/multivm/src/interface/traits/vm.rs +++ b/core/lib/multivm/src/interface/traits/vm.rs @@ -19,7 +19,7 @@ //! sync::Arc //! }; //! use once_cell::sync::OnceCell; -//! use multivm::{ +//! use zksync_multivm::{ //! interface::{L1BatchEnv, SystemEnv, VmInterface}, //! tracers::CallTracer , //! vm_latest::ToTracerPointer diff --git a/core/lib/prometheus_exporter/Cargo.toml b/core/lib/prometheus_exporter/Cargo.toml index 3158aeb73da0..c9f8463d0415 100644 --- a/core/lib/prometheus_exporter/Cargo.toml +++ b/core/lib/prometheus_exporter/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "prometheus_exporter" +name = "zksync_prometheus_exporter" version = "0.1.0" edition.workspace = true authors.workspace = true diff --git a/core/lib/tee_verifier/Cargo.toml b/core/lib/tee_verifier/Cargo.toml index 9b7230386665..ed222565a1a3 100644 --- a/core/lib/tee_verifier/Cargo.toml +++ b/core/lib/tee_verifier/Cargo.toml @@ -13,10 +13,10 @@ categories.workspace = true [dependencies] anyhow.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true serde.workspace = true tracing.workspace = true -vm_utils.workspace = true +zksync_vm_utils.workspace = true zksync_config.workspace = true zksync_crypto.workspace = true zksync_dal.workspace = true diff --git a/core/lib/tee_verifier/src/lib.rs b/core/lib/tee_verifier/src/lib.rs index 19e9c4655f40..069036f11527 100644 --- a/core/lib/tee_verifier/src/lib.rs +++ b/core/lib/tee_verifier/src/lib.rs @@ -7,22 +7,22 @@ use std::{cell::RefCell, rc::Rc}; use anyhow::Context; -use multivm::{ - interface::{FinishedL1Batch, L1BatchEnv, L2BlockEnv, SystemEnv, VmInterface}, - vm_latest::HistoryEnabled, - VmInstance, -}; use serde::{Deserialize, Serialize}; -use vm_utils::execute_tx; use zksync_crypto::hasher::blake2::Blake2Hasher; use zksync_merkle_tree::{ BlockOutputWithProofs, TreeInstruction, TreeLogEntry, TreeLogEntryWithProof, }; +use zksync_multivm::{ + interface::{FinishedL1Batch, L1BatchEnv, L2BlockEnv, SystemEnv, VmInterface}, + vm_latest::HistoryEnabled, + VmInstance, +}; use zksync_object_store::{serialize_using_bincode, Bucket, StoredObject}; use zksync_prover_interface::inputs::{PrepareBasicCircuitsJob, StorageLogMetadata}; use zksync_state::{InMemoryStorage, StorageView, WriteStorage}; use zksync_types::{block::L2BlockExecutionData, L1BatchNumber, StorageLog, H256}; use zksync_utils::bytecode::hash_bytecode; +use zksync_vm_utils::execute_tx; /// Version 1 of the data used as input for the TEE verifier. #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] @@ -282,9 +282,9 @@ impl StoredObject for TeeVerifierInput { #[cfg(test)] mod tests { - use multivm::interface::TxExecutionMode; use zksync_basic_types::U256; use zksync_contracts::{BaseSystemContracts, SystemContractCode}; + use zksync_multivm::interface::TxExecutionMode; use super::*; diff --git a/core/lib/utils/Cargo.toml b/core/lib/utils/Cargo.toml index 4eea7d1398d1..9ab2041bef98 100644 --- a/core/lib/utils/Cargo.toml +++ b/core/lib/utils/Cargo.toml @@ -12,7 +12,7 @@ categories.workspace = true [dependencies] zksync_basic_types.workspace = true zk_evm.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true bigdecimal.workspace = true num = { workspace = true, features = ["serde"] } diff --git a/core/lib/utils/src/wait_for_tasks.rs b/core/lib/utils/src/wait_for_tasks.rs index 2fa59280e99e..ab548bdd1dde 100644 --- a/core/lib/utils/src/wait_for_tasks.rs +++ b/core/lib/utils/src/wait_for_tasks.rs @@ -47,14 +47,14 @@ impl ManagedTasks { let err = "One of the actors finished its run, while it wasn't expected to do it"; tracing::error!("{err}"); - vlog::capture_message(err, vlog::AlertLevel::Warning); + zksync_vlog::capture_message(err, zksync_vlog::AlertLevel::Warning); } } Ok(Err(err)) => { let err = format!("One of the tokio actors unexpectedly finished with error: {err:#}"); tracing::error!("{err}"); - vlog::capture_message(&err, vlog::AlertLevel::Warning); + zksync_vlog::capture_message(&err, zksync_vlog::AlertLevel::Warning); } Err(error) => { let panic_message = try_extract_panic_message(error); diff --git a/core/lib/vlog/Cargo.toml b/core/lib/vlog/Cargo.toml index 8efefb158021..91630dd92b6f 100644 --- a/core/lib/vlog/Cargo.toml +++ b/core/lib/vlog/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vlog" +name = "zksync_vlog" version = "0.1.0" edition.workspace = true authors.workspace = true diff --git a/core/lib/vm_utils/Cargo.toml b/core/lib/vm_utils/Cargo.toml index 2ae020f44052..632813d55e6a 100644 --- a/core/lib/vm_utils/Cargo.toml +++ b/core/lib/vm_utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vm_utils" +name = "zksync_vm_utils" version = "0.1.0" edition.workspace = true authors.workspace = true @@ -10,7 +10,7 @@ keywords.workspace = true categories.workspace = true [dependencies] -multivm.workspace = true +zksync_multivm.workspace = true zksync_types.workspace = true zksync_dal.workspace = true zksync_state.workspace = true diff --git a/core/lib/vm_utils/src/lib.rs b/core/lib/vm_utils/src/lib.rs index 2dcf186d48d3..d3f294afd9e7 100644 --- a/core/lib/vm_utils/src/lib.rs +++ b/core/lib/vm_utils/src/lib.rs @@ -1,13 +1,13 @@ pub mod storage; use anyhow::{anyhow, Context}; -use multivm::{ +use tokio::runtime::Handle; +use zksync_dal::{Connection, Core}; +use zksync_multivm::{ interface::{VmInterface, VmInterfaceHistoryEnabled}, vm_latest::HistoryEnabled, VmInstance, }; -use tokio::runtime::Handle; -use zksync_dal::{Connection, Core}; use zksync_state::{PostgresStorage, StoragePtr, StorageView, WriteStorage}; use zksync_types::{L1BatchNumber, L2ChainId, Transaction}; diff --git a/core/lib/vm_utils/src/storage.rs b/core/lib/vm_utils/src/storage.rs index f9b6dec23da6..6eeaf92b718e 100644 --- a/core/lib/vm_utils/src/storage.rs +++ b/core/lib/vm_utils/src/storage.rs @@ -1,13 +1,13 @@ use std::time::{Duration, Instant}; use anyhow::Context; -use multivm::{ +use zksync_contracts::BaseSystemContracts; +use zksync_dal::{Connection, Core, CoreDal, DalError}; +use zksync_multivm::{ interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, zk_evm_latest::ethereum_types::H256, }; -use zksync_contracts::BaseSystemContracts; -use zksync_dal::{Connection, Core, CoreDal, DalError}; use zksync_types::{ block::L2BlockHeader, fee_model::BatchFeeInput, snapshots::SnapshotRecoveryStatus, Address, L1BatchNumber, L2BlockNumber, L2ChainId, ProtocolVersionId, ZKPORTER_IS_AVAILABLE, diff --git a/core/node/api_server/Cargo.toml b/core/node/api_server/Cargo.toml index b826a8b40f21..787b1e2f634a 100644 --- a/core/node/api_server/Cargo.toml +++ b/core/node/api_server/Cargo.toml @@ -26,7 +26,7 @@ zksync_web3_decl = { workspace = true, features = ["server"] } zksync_utils.workspace = true zksync_protobuf.workspace = true zksync_mini_merkle_tree.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true vise.workspace = true anyhow.workspace = true diff --git a/core/node/api_server/src/execution_sandbox/apply.rs b/core/node/api_server/src/execution_sandbox/apply.rs index dc8b56f41967..e876a55b66f5 100644 --- a/core/node/api_server/src/execution_sandbox/apply.rs +++ b/core/node/api_server/src/execution_sandbox/apply.rs @@ -9,14 +9,14 @@ use std::time::{Duration, Instant}; use anyhow::Context as _; -use multivm::{ +use tokio::runtime::Handle; +use zksync_dal::{Connection, ConnectionPool, Core, CoreDal, DalError}; +use zksync_multivm::{ interface::{L1BatchEnv, L2BlockEnv, SystemEnv, VmInterface}, utils::adjust_pubdata_price_for_tx, vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, HistoryDisabled}, VmInstance, }; -use tokio::runtime::Handle; -use zksync_dal::{Connection, ConnectionPool, Core, CoreDal, DalError}; use zksync_state::{PostgresStorage, ReadStorage, StoragePtr, StorageView, WriteStorage}; use zksync_system_constants::{ SYSTEM_CONTEXT_ADDRESS, SYSTEM_CONTEXT_CURRENT_L2_BLOCK_INFO_POSITION, diff --git a/core/node/api_server/src/execution_sandbox/error.rs b/core/node/api_server/src/execution_sandbox/error.rs index 9d6d635a344c..5d63d50a3c85 100644 --- a/core/node/api_server/src/execution_sandbox/error.rs +++ b/core/node/api_server/src/execution_sandbox/error.rs @@ -1,5 +1,5 @@ -use multivm::interface::{Halt, TxRevertReason}; use thiserror::Error; +use zksync_multivm::interface::{Halt, TxRevertReason}; #[derive(Debug, Error)] pub(crate) enum SandboxExecutionError { diff --git a/core/node/api_server/src/execution_sandbox/execute.rs b/core/node/api_server/src/execution_sandbox/execute.rs index 9a844df28673..d15cf7a91439 100644 --- a/core/node/api_server/src/execution_sandbox/execute.rs +++ b/core/node/api_server/src/execution_sandbox/execute.rs @@ -1,13 +1,13 @@ //! Implementation of "executing" methods, e.g. `eth_call`. use anyhow::Context as _; -use multivm::{ +use tracing::{span, Level}; +use zksync_dal::{ConnectionPool, Core}; +use zksync_multivm::{ interface::{TxExecutionMode, VmExecutionResultAndLogs, VmInterface}, tracers::StorageInvocations, MultiVMTracer, }; -use tracing::{span, Level}; -use zksync_dal::{ConnectionPool, Core}; use zksync_types::{ fee::TransactionExecutionMetrics, l2::L2Tx, transaction_request::CallOverrides, ExecuteTransactionCommon, Nonce, PackedEthSignature, Transaction, U256, diff --git a/core/node/api_server/src/execution_sandbox/testonly.rs b/core/node/api_server/src/execution_sandbox/testonly.rs index f027acc6d625..673c30b9f17e 100644 --- a/core/node/api_server/src/execution_sandbox/testonly.rs +++ b/core/node/api_server/src/execution_sandbox/testonly.rs @@ -1,6 +1,6 @@ use std::fmt; -use multivm::interface::{ExecutionResult, VmExecutionResultAndLogs}; +use zksync_multivm::interface::{ExecutionResult, VmExecutionResultAndLogs}; use zksync_types::{ fee::TransactionExecutionMetrics, l2::L2Tx, ExecuteTransactionCommon, Transaction, }; diff --git a/core/node/api_server/src/execution_sandbox/tracers.rs b/core/node/api_server/src/execution_sandbox/tracers.rs index 2b969e380dd2..ba258ab7c74a 100644 --- a/core/node/api_server/src/execution_sandbox/tracers.rs +++ b/core/node/api_server/src/execution_sandbox/tracers.rs @@ -1,7 +1,9 @@ use std::sync::Arc; -use multivm::{tracers::CallTracer, vm_latest::HistoryMode, MultiVMTracer, MultiVmTracerPointer}; use once_cell::sync::OnceCell; +use zksync_multivm::{ + tracers::CallTracer, vm_latest::HistoryMode, MultiVMTracer, MultiVmTracerPointer, +}; use zksync_state::WriteStorage; use zksync_types::vm_trace::Call; @@ -14,7 +16,7 @@ pub(crate) enum ApiTracer { impl ApiTracer { pub fn into_boxed< S: WriteStorage, - H: HistoryMode + multivm::HistoryMode + 'static, + H: HistoryMode + zksync_multivm::HistoryMode + 'static, >( self, ) -> MultiVmTracerPointer { diff --git a/core/node/api_server/src/execution_sandbox/validate.rs b/core/node/api_server/src/execution_sandbox/validate.rs index 0356ac74c5c1..958fbc8a0742 100644 --- a/core/node/api_server/src/execution_sandbox/validate.rs +++ b/core/node/api_server/src/execution_sandbox/validate.rs @@ -1,7 +1,8 @@ use std::collections::HashSet; use anyhow::Context as _; -use multivm::{ +use zksync_dal::{Connection, ConnectionPool, Core, CoreDal}; +use zksync_multivm::{ interface::{ExecutionResult, VmExecutionMode, VmInterface}, tracers::{ validator::{self, ValidationTracer, ValidationTracerParams}, @@ -10,7 +11,6 @@ use multivm::{ vm_latest::HistoryDisabled, MultiVMTracer, }; -use zksync_dal::{Connection, ConnectionPool, Core, CoreDal}; use zksync_types::{l2::L2Tx, Address, Transaction, TRUSTED_ADDRESS_SLOTS, TRUSTED_TOKEN_SLOTS}; use super::{ diff --git a/core/node/api_server/src/execution_sandbox/vm_metrics.rs b/core/node/api_server/src/execution_sandbox/vm_metrics.rs index 33100169e392..e1e96d8eee5e 100644 --- a/core/node/api_server/src/execution_sandbox/vm_metrics.rs +++ b/core/node/api_server/src/execution_sandbox/vm_metrics.rs @@ -1,9 +1,9 @@ use std::time::Duration; -use multivm::interface::{VmExecutionResultAndLogs, VmMemoryMetrics}; use vise::{ Buckets, EncodeLabelSet, EncodeLabelValue, Family, Gauge, Histogram, LatencyObserver, Metrics, }; +use zksync_multivm::interface::{VmExecutionResultAndLogs, VmMemoryMetrics}; use zksync_shared_metrics::InteractionType; use zksync_state::StorageViewMetrics; use zksync_types::{ diff --git a/core/node/api_server/src/tx_sender/mod.rs b/core/node/api_server/src/tx_sender/mod.rs index a6bbbf9ffa04..50b0be541bf0 100644 --- a/core/node/api_server/src/tx_sender/mod.rs +++ b/core/node/api_server/src/tx_sender/mod.rs @@ -3,7 +3,13 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; -use multivm::{ +use tokio::sync::RwLock; +use zksync_config::configs::{api::Web3JsonRpcConfig, chain::StateKeeperConfig}; +use zksync_contracts::BaseSystemContracts; +use zksync_dal::{ + transactions_dal::L2TxSubmissionResult, Connection, ConnectionPool, Core, CoreDal, +}; +use zksync_multivm::{ interface::VmExecutionResultAndLogs, utils::{ adjust_pubdata_price_for_tx, derive_base_fee_and_gas_per_pubdata, derive_overhead, @@ -11,12 +17,6 @@ use multivm::{ }, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; -use tokio::sync::RwLock; -use zksync_config::configs::{api::Web3JsonRpcConfig, chain::StateKeeperConfig}; -use zksync_contracts::BaseSystemContracts; -use zksync_dal::{ - transactions_dal::L2TxSubmissionResult, Connection, ConnectionPool, Core, CoreDal, -}; use zksync_node_fee_model::{ApiFeeInputProvider, BatchFeeModelInputProvider}; use zksync_state::PostgresStorageCaches; use zksync_state_keeper::{ diff --git a/core/node/api_server/src/tx_sender/result.rs b/core/node/api_server/src/tx_sender/result.rs index a003b640525d..f4bda54efc65 100644 --- a/core/node/api_server/src/tx_sender/result.rs +++ b/core/node/api_server/src/tx_sender/result.rs @@ -1,5 +1,5 @@ -use multivm::interface::{ExecutionResult, VmExecutionResultAndLogs}; use thiserror::Error; +use zksync_multivm::interface::{ExecutionResult, VmExecutionResultAndLogs}; use zksync_types::{l2::error::TxCheckError, U256}; use zksync_web3_decl::error::EnrichedClientError; diff --git a/core/node/api_server/src/tx_sender/tests.rs b/core/node/api_server/src/tx_sender/tests.rs index 154e94280f36..06b6b7a1301b 100644 --- a/core/node/api_server/src/tx_sender/tests.rs +++ b/core/node/api_server/src/tx_sender/tests.rs @@ -1,7 +1,7 @@ //! Tests for the transaction sender. use assert_matches::assert_matches; -use multivm::interface::ExecutionResult; +use zksync_multivm::interface::ExecutionResult; use zksync_node_fee_model::MockBatchFeeParamsProvider; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_node_test_utils::{create_l2_block, create_l2_transaction, prepare_recovery_snapshot}; diff --git a/core/node/api_server/src/web3/namespaces/debug.rs b/core/node/api_server/src/web3/namespaces/debug.rs index 35bc2e22bc3d..a2e6e2782ac5 100644 --- a/core/node/api_server/src/web3/namespaces/debug.rs +++ b/core/node/api_server/src/web3/namespaces/debug.rs @@ -1,9 +1,11 @@ use std::sync::Arc; use anyhow::Context as _; -use multivm::{interface::ExecutionResult, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT}; use once_cell::sync::OnceCell; use zksync_dal::{CoreDal, DalError}; +use zksync_multivm::{ + interface::ExecutionResult, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, +}; use zksync_system_constants::MAX_ENCODED_TX_SIZE; use zksync_types::{ api::{BlockId, BlockNumber, DebugCall, ResultDebugCall, TracerConfig}, diff --git a/core/node/api_server/src/web3/namespaces/zks.rs b/core/node/api_server/src/web3/namespaces/zks.rs index 6b872bcf637e..2b3fbbcd55ca 100644 --- a/core/node/api_server/src/web3/namespaces/zks.rs +++ b/core/node/api_server/src/web3/namespaces/zks.rs @@ -1,10 +1,10 @@ use std::{collections::HashMap, convert::TryInto}; use anyhow::Context as _; -use multivm::interface::VmExecutionResultAndLogs; use zksync_dal::{Connection, Core, CoreDal, DalError}; use zksync_metadata_calculator::api_server::TreeApiError; use zksync_mini_merkle_tree::MiniMerkleTree; +use zksync_multivm::interface::VmExecutionResultAndLogs; use zksync_system_constants::DEFAULT_L2_TX_GAS_PER_PUBDATA_BYTE; use zksync_types::{ api::{ diff --git a/core/node/api_server/src/web3/tests/mod.rs b/core/node/api_server/src/web3/tests/mod.rs index b2331a547707..41f25639acf8 100644 --- a/core/node/api_server/src/web3/tests/mod.rs +++ b/core/node/api_server/src/web3/tests/mod.rs @@ -7,7 +7,6 @@ use std::{ use assert_matches::assert_matches; use async_trait::async_trait; -use multivm::zk_evm_latest::ethereum_types::U256; use tokio::sync::watch; use zksync_config::{ configs::{ @@ -18,6 +17,7 @@ use zksync_config::{ GenesisConfig, }; use zksync_dal::{transactions_dal::L2TxSubmissionResult, Connection, ConnectionPool, CoreDal}; +use zksync_multivm::zk_evm_latest::ethereum_types::U256; use zksync_node_genesis::{insert_genesis_batch, mock_genesis_config, GenesisParams}; use zksync_node_test_utils::{ create_l1_batch, create_l1_batch_metadata, create_l2_block, create_l2_transaction, diff --git a/core/node/api_server/src/web3/tests/vm.rs b/core/node/api_server/src/web3/tests/vm.rs index cb59f2f88e25..1bce1b732b13 100644 --- a/core/node/api_server/src/web3/tests/vm.rs +++ b/core/node/api_server/src/web3/tests/vm.rs @@ -3,7 +3,7 @@ use std::sync::atomic::{AtomicU32, Ordering}; use itertools::Itertools; -use multivm::{ +use zksync_multivm::{ interface::{ExecutionResult, VmRevertReason}, vm_latest::{VmExecutionLogs, VmExecutionResultAndLogs}, }; diff --git a/core/node/commitment_generator/Cargo.toml b/core/node/commitment_generator/Cargo.toml index 24752691348b..c43343e3614a 100644 --- a/core/node/commitment_generator/Cargo.toml +++ b/core/node/commitment_generator/Cargo.toml @@ -18,7 +18,7 @@ zksync_l1_contract_interface.workspace = true zksync_utils.workspace = true zksync_eth_client.workspace = true zksync_contracts.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true circuit_sequencer_api_1_4_0.workspace = true circuit_sequencer_api_1_4_1.workspace = true circuit_sequencer_api_1_5_0.workspace = true diff --git a/core/node/commitment_generator/src/lib.rs b/core/node/commitment_generator/src/lib.rs index cbb6279481ca..135aca361a0b 100644 --- a/core/node/commitment_generator/src/lib.rs +++ b/core/node/commitment_generator/src/lib.rs @@ -2,11 +2,11 @@ use std::{num::NonZeroU32, ops, sync::Arc, time::Duration}; use anyhow::Context; use itertools::Itertools; -use multivm::zk_evm_latest::ethereum_types::U256; use tokio::{sync::watch, task::JoinHandle}; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_health_check::{Health, HealthStatus, HealthUpdater, ReactiveHealthCheck}; use zksync_l1_contract_interface::i_executor::commit::kzg::pubdata_to_blob_commitments; +use zksync_multivm::zk_evm_latest::ethereum_types::U256; use zksync_types::{ blob::num_blobs_required, commitment::{ diff --git a/core/node/commitment_generator/src/utils.rs b/core/node/commitment_generator/src/utils.rs index 9a12f0c43165..b4e6bc542e97 100644 --- a/core/node/commitment_generator/src/utils.rs +++ b/core/node/commitment_generator/src/utils.rs @@ -2,7 +2,6 @@ use std::fmt; -use multivm::utils::get_used_bootloader_memory_bytes; use zk_evm_1_3_3::{ aux_structures::Timestamp as Timestamp_1_3_3, zk_evm_abstractions::queries::LogQuery as LogQuery_1_3_3, @@ -15,6 +14,7 @@ use zk_evm_1_5_0::{ aux_structures::Timestamp as Timestamp_1_5_0, zk_evm_abstractions::queries::LogQuery as LogQuery_1_5_0, }; +use zksync_multivm::utils::get_used_bootloader_memory_bytes; use zksync_types::{zk_evm_types::LogQuery, ProtocolVersionId, VmVersion, H256, U256}; use zksync_utils::expand_memory_contents; diff --git a/core/node/genesis/Cargo.toml b/core/node/genesis/Cargo.toml index 1f274cab877c..c9d554770338 100644 --- a/core/node/genesis/Cargo.toml +++ b/core/node/genesis/Cargo.toml @@ -10,7 +10,7 @@ keywords.workspace = true categories.workspace = true [dependencies] -multivm.workspace = true +zksync_multivm.workspace = true vise.workspace = true zksync_types.workspace = true zksync_dal.workspace = true diff --git a/core/node/genesis/src/lib.rs b/core/node/genesis/src/lib.rs index 461f208e3012..e1f15109bc0d 100644 --- a/core/node/genesis/src/lib.rs +++ b/core/node/genesis/src/lib.rs @@ -5,12 +5,12 @@ use std::fmt::Formatter; use anyhow::Context as _; -use multivm::utils::get_max_gas_per_pubdata_byte; use zksync_config::{configs::DatabaseSecrets, GenesisConfig}; use zksync_contracts::{BaseSystemContracts, BaseSystemContractsHashes, SET_CHAIN_ID_EVENT}; use zksync_dal::{Connection, ConnectionPool, Core, CoreDal, DalError}; use zksync_eth_client::EthInterface; use zksync_merkle_tree::{domain::ZkSyncTree, TreeInstruction}; +use zksync_multivm::utils::get_max_gas_per_pubdata_byte; use zksync_system_constants::PRIORITY_EXPIRATION; use zksync_types::{ block::{BlockGasCount, DeployedContract, L1BatchHeader, L2BlockHasher, L2BlockHeader}, diff --git a/core/node/genesis/src/utils.rs b/core/node/genesis/src/utils.rs index 7fdbe05da368..af257b13bb70 100644 --- a/core/node/genesis/src/utils.rs +++ b/core/node/genesis/src/utils.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use itertools::Itertools; -use multivm::{ +use zksync_contracts::BaseSystemContracts; +use zksync_dal::{Connection, Core, CoreDal}; +use zksync_multivm::{ circuit_sequencer_api_latest::sort_storage_access::sort_storage_access_queries, zk_evm_latest::aux_structures::{LogQuery as MultiVmLogQuery, Timestamp as MultiVMTimestamp}, }; -use zksync_contracts::BaseSystemContracts; -use zksync_dal::{Connection, Core, CoreDal}; use zksync_system_constants::{DEFAULT_ERA_CHAIN_ID, ETHEREUM_ADDRESS}; use zksync_types::{ block::{DeployedContract, L1BatchTreeData}, diff --git a/core/node/house_keeper/Cargo.toml b/core/node/house_keeper/Cargo.toml index 62b3605c3857..66bdca149a2e 100644 --- a/core/node/house_keeper/Cargo.toml +++ b/core/node/house_keeper/Cargo.toml @@ -13,7 +13,7 @@ categories.workspace = true vise.workspace = true zksync_dal.workspace = true zksync_shared_metrics.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_types.workspace = true zksync_config.workspace = true diff --git a/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs b/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs index 2af66a937b33..5db53710733c 100644 --- a/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs +++ b/core/node/house_keeper/src/prover/archiver/fri_gpu_prover_archiver.rs @@ -1,5 +1,5 @@ -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::HOUSE_KEEPER_METRICS}; diff --git a/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs b/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs index 8e3134c078f2..02268c60e5f5 100644 --- a/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs +++ b/core/node/house_keeper/src/prover/archiver/fri_prover_jobs_archiver.rs @@ -1,5 +1,5 @@ -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::HOUSE_KEEPER_METRICS}; diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs index 886a4c116b89..c554bf4616d3 100644 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs +++ b/core/node/house_keeper/src/prover/queue_reporter/fri_proof_compressor_queue_reporter.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_types::{protocol_version::ProtocolSemanticVersion, prover_dal::JobCountStatistics}; use crate::{ diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs index 04d823252aff..f429367c44a1 100644 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs +++ b/core/node/house_keeper/src/prover/queue_reporter/fri_prover_queue_reporter.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_config::configs::fri_prover_group::FriProverGroupConfig; use zksync_dal::{ConnectionPool, Core, CoreDal}; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::FRI_PROVER_METRICS}; diff --git a/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs b/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs index 487b28491c43..cd124dffaf67 100644 --- a/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs +++ b/core/node/house_keeper/src/prover/queue_reporter/fri_witness_generator_queue_reporter.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_types::{ basic_fri_types::AggregationRound, protocol_version::ProtocolSemanticVersion, prover_dal::JobCountStatistics, diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs index 4a27993249f0..4d4d8ceed75e 100644 --- a/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs +++ b/core/node/house_keeper/src/prover/retry_manager/fri_proof_compressor_job_retry_manager.rs @@ -1,8 +1,8 @@ use std::time::Duration; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::PROVER_FRI_METRICS}; diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs index f059703a13c5..755944d21634 100644 --- a/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs +++ b/core/node/house_keeper/src/prover/retry_manager/fri_prover_job_retry_manager.rs @@ -1,8 +1,8 @@ use std::time::Duration; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::SERVER_METRICS}; diff --git a/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs b/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs index 5b418fe64389..817d1e290252 100644 --- a/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs +++ b/core/node/house_keeper/src/prover/retry_manager/fri_witness_generator_jobs_retry_manager.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_config::configs::fri_witness_generator::WitnessGenerationTimeouts; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_types::prover_dal::StuckJobs; use crate::{ diff --git a/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs b/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs index bf4e31eee69d..d4d5edc78eb9 100644 --- a/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs +++ b/core/node/house_keeper/src/prover/waiting_to_queued_fri_witness_job_mover.rs @@ -1,6 +1,6 @@ use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zksync_dal::ConnectionPool; +use zksync_prover_dal::{Prover, ProverDal}; use crate::{periodic_job::PeriodicJob, prover::metrics::SERVER_METRICS}; diff --git a/core/node/node_framework/Cargo.toml b/core/node/node_framework/Cargo.toml index d48522fb8116..5bed78e4b601 100644 --- a/core/node/node_framework/Cargo.toml +++ b/core/node/node_framework/Cargo.toml @@ -10,11 +10,11 @@ keywords.workspace = true categories.workspace = true [dependencies] -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true zksync_types.workspace = true zksync_health_check.workspace = true zksync_dal.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_db_connection.workspace = true zksync_config.workspace = true zksync_protobuf_config.workspace = true @@ -57,5 +57,5 @@ ctrlc.workspace = true [dev-dependencies] zksync_env_config.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true assert_matches.workspace = true diff --git a/core/node/node_framework/examples/main_node.rs b/core/node/node_framework/examples/main_node.rs index f0cb8417ff97..4c0ef626927c 100644 --- a/core/node/node_framework/examples/main_node.rs +++ b/core/node/node_framework/examples/main_node.rs @@ -379,11 +379,11 @@ impl MainNodeBuilder { fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let _guard = vlog::ObservabilityBuilder::new() + let _guard = zksync_vlog::ObservabilityBuilder::new() .with_log_format(log_format) .build(); diff --git a/core/node/node_framework/src/implementations/layers/prometheus_exporter.rs b/core/node/node_framework/src/implementations/layers/prometheus_exporter.rs index 4b7451348235..3cfa6e0d5427 100644 --- a/core/node/node_framework/src/implementations/layers/prometheus_exporter.rs +++ b/core/node/node_framework/src/implementations/layers/prometheus_exporter.rs @@ -1,5 +1,5 @@ -use prometheus_exporter::PrometheusExporterConfig; use zksync_health_check::{HealthStatus, HealthUpdater, ReactiveHealthCheck}; +use zksync_prometheus_exporter::PrometheusExporterConfig; use crate::{ implementations::resources::healthcheck::AppHealthCheckResource, diff --git a/core/node/node_framework/src/implementations/resources/pools.rs b/core/node/node_framework/src/implementations/resources/pools.rs index b33933f83e21..8355bb1bdd62 100644 --- a/core/node/node_framework/src/implementations/resources/pools.rs +++ b/core/node/node_framework/src/implementations/resources/pools.rs @@ -6,10 +6,10 @@ use std::{ time::Duration, }; -use prover_dal::Prover; use tokio::sync::Mutex; use zksync_dal::{ConnectionPool, Core}; use zksync_db_connection::connection_pool::ConnectionPoolBuilder; +use zksync_prover_dal::Prover; use zksync_types::url::SensitiveUrl; use crate::resource::Resource; diff --git a/core/node/node_sync/Cargo.toml b/core/node/node_sync/Cargo.toml index 58eec35a630c..7d97bdf053ac 100644 --- a/core/node/node_sync/Cargo.toml +++ b/core/node/node_sync/Cargo.toml @@ -24,7 +24,7 @@ zksync_utils.workspace = true zksync_eth_client.workspace = true zksync_concurrency.workspace = true vise.workspace = true -vm_utils.workspace = true +zksync_vm_utils.workspace = true anyhow.workspace = true async-trait.workspace = true diff --git a/core/node/node_sync/src/external_io.rs b/core/node/node_sync/src/external_io.rs index 690d38f620a0..8ad143861450 100644 --- a/core/node/node_sync/src/external_io.rs +++ b/core/node/node_sync/src/external_io.rs @@ -2,7 +2,6 @@ use std::{collections::HashMap, time::Duration}; use anyhow::Context as _; use async_trait::async_trait; -use vm_utils::storage::L1BatchParamsProvider; use zksync_contracts::{BaseSystemContracts, BaseSystemContractsHashes, SystemContractCode}; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_state_keeper::{ @@ -21,6 +20,7 @@ use zksync_types::{ L1BatchNumber, L2BlockNumber, L2ChainId, ProtocolVersionId, Transaction, H256, }; use zksync_utils::bytes_to_be_words; +use zksync_vm_utils::storage::L1BatchParamsProvider; use super::{ client::MainNodeClient, diff --git a/core/node/proof_data_handler/Cargo.toml b/core/node/proof_data_handler/Cargo.toml index 301ce0df6a80..0ab5d4bb1913 100644 --- a/core/node/proof_data_handler/Cargo.toml +++ b/core/node/proof_data_handler/Cargo.toml @@ -24,7 +24,7 @@ tracing.workspace = true [dev-dependencies] hyper.workspace = true chrono.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true serde_json.workspace = true tower.workspace = true zksync_basic_types.workspace = true diff --git a/core/node/proof_data_handler/src/tests.rs b/core/node/proof_data_handler/src/tests.rs index 7047bd154c9a..c4381fdc387d 100644 --- a/core/node/proof_data_handler/src/tests.rs +++ b/core/node/proof_data_handler/src/tests.rs @@ -7,13 +7,13 @@ use axum::{ Router, }; use hyper::body::HttpBody; -use multivm::interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}; use serde_json::json; use tower::ServiceExt; use zksync_basic_types::U256; use zksync_config::configs::ProofDataHandlerConfig; use zksync_contracts::{BaseSystemContracts, SystemContractCode}; use zksync_dal::{ConnectionPool, CoreDal}; +use zksync_multivm::interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}; use zksync_object_store::MockObjectStore; use zksync_prover_interface::{api::SubmitTeeProofRequest, inputs::PrepareBasicCircuitsJob}; use zksync_tee_verifier::TeeVerifierInput; diff --git a/core/node/state_keeper/Cargo.toml b/core/node/state_keeper/Cargo.toml index c2ac940eef39..28f850d339f9 100644 --- a/core/node/state_keeper/Cargo.toml +++ b/core/node/state_keeper/Cargo.toml @@ -12,7 +12,7 @@ categories.workspace = true [dependencies] vise.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true zksync_types.workspace = true zksync_dal.workspace = true zksync_state.workspace = true @@ -27,7 +27,7 @@ zksync_protobuf.workspace = true zksync_test_account.workspace = true zksync_node_genesis.workspace = true zksync_node_test_utils.workspace = true -vm_utils.workspace = true +zksync_vm_utils.workspace = true anyhow.workspace = true async-trait.workspace = true diff --git a/core/node/state_keeper/src/batch_executor/main_executor.rs b/core/node/state_keeper/src/batch_executor/main_executor.rs index f3f947d0d1e6..5bbd9f7c3a52 100644 --- a/core/node/state_keeper/src/batch_executor/main_executor.rs +++ b/core/node/state_keeper/src/batch_executor/main_executor.rs @@ -2,7 +2,12 @@ use std::sync::Arc; use anyhow::Context as _; use async_trait::async_trait; -use multivm::{ +use once_cell::sync::OnceCell; +use tokio::{ + runtime::Handle, + sync::{mpsc, watch}, +}; +use zksync_multivm::{ interface::{ ExecutionResult, FinishedL1Batch, Halt, L1BatchEnv, L2BlockEnv, SystemEnv, VmExecutionResultAndLogs, VmInterface, VmInterfaceHistoryEnabled, @@ -11,11 +16,6 @@ use multivm::{ vm_latest::HistoryEnabled, MultiVMTracer, VmInstance, }; -use once_cell::sync::OnceCell; -use tokio::{ - runtime::Handle, - sync::{mpsc, watch}, -}; use zksync_shared_metrics::{InteractionType, TxStage, APP_METRICS}; use zksync_state::{ReadStorage, ReadStorageFactory, StorageView, WriteStorage}; use zksync_types::{vm_trace::Call, Transaction}; diff --git a/core/node/state_keeper/src/batch_executor/mod.rs b/core/node/state_keeper/src/batch_executor/mod.rs index 8703831f3952..bb3effedbbab 100644 --- a/core/node/state_keeper/src/batch_executor/mod.rs +++ b/core/node/state_keeper/src/batch_executor/mod.rs @@ -2,13 +2,13 @@ use std::{error::Error as StdError, fmt, sync::Arc}; use anyhow::Context as _; use async_trait::async_trait; -use multivm::interface::{ - FinishedL1Batch, Halt, L1BatchEnv, L2BlockEnv, SystemEnv, VmExecutionResultAndLogs, -}; use tokio::{ sync::{mpsc, oneshot, watch}, task::JoinHandle, }; +use zksync_multivm::interface::{ + FinishedL1Batch, Halt, L1BatchEnv, L2BlockEnv, SystemEnv, VmExecutionResultAndLogs, +}; use zksync_state::ReadStorageFactory; use zksync_types::{vm_trace::Call, Transaction}; use zksync_utils::bytecode::CompressedBytecodeInfo; diff --git a/core/node/state_keeper/src/batch_executor/tests/tester.rs b/core/node/state_keeper/src/batch_executor/tests/tester.rs index 7e734ffc3d5e..91ff05357931 100644 --- a/core/node/state_keeper/src/batch_executor/tests/tester.rs +++ b/core/node/state_keeper/src/batch_executor/tests/tester.rs @@ -3,15 +3,15 @@ use std::{collections::HashMap, fmt::Debug, sync::Arc}; -use multivm::{ - interface::{L1BatchEnv, L2BlockEnv, SystemEnv}, - vm_latest::constants::INITIAL_STORAGE_WRITE_PUBDATA_BYTES, -}; use tempfile::TempDir; use tokio::{sync::watch, task::JoinHandle}; use zksync_config::configs::chain::StateKeeperConfig; use zksync_contracts::{get_loadnext_contract, test_contracts::LoadnextContractExecutionParams}; use zksync_dal::{ConnectionPool, Core, CoreDal}; +use zksync_multivm::{ + interface::{L1BatchEnv, L2BlockEnv, SystemEnv}, + vm_latest::constants::INITIAL_STORAGE_WRITE_PUBDATA_BYTES, +}; use zksync_node_genesis::create_genesis_l1_batch; use zksync_node_test_utils::prepare_recovery_snapshot; use zksync_state::{ReadStorageFactory, RocksdbStorageOptions}; diff --git a/core/node/state_keeper/src/io/common/mod.rs b/core/node/state_keeper/src/io/common/mod.rs index f521a87ab228..6bd881414a20 100644 --- a/core/node/state_keeper/src/io/common/mod.rs +++ b/core/node/state_keeper/src/io/common/mod.rs @@ -1,8 +1,8 @@ use std::time::Duration; use anyhow::Context; -use multivm::interface::{L1BatchEnv, SystemEnv}; use zksync_dal::{Connection, Core, CoreDal}; +use zksync_multivm::interface::{L1BatchEnv, SystemEnv}; use zksync_types::{L1BatchNumber, L2BlockNumber, H256}; use super::PendingBatchData; diff --git a/core/node/state_keeper/src/io/common/tests.rs b/core/node/state_keeper/src/io/common/tests.rs index 5810061af19a..7e6fbdc795ab 100644 --- a/core/node/state_keeper/src/io/common/tests.rs +++ b/core/node/state_keeper/src/io/common/tests.rs @@ -6,7 +6,6 @@ use std::{collections::HashMap, ops}; use futures::FutureExt; -use vm_utils::storage::L1BatchParamsProvider; use zksync_config::GenesisConfig; use zksync_contracts::BaseSystemContractsHashes; use zksync_dal::{ConnectionPool, Core}; @@ -19,6 +18,7 @@ use zksync_types::{ block::L2BlockHasher, fee::TransactionExecutionMetrics, protocol_version::ProtocolSemanticVersion, L2ChainId, ProtocolVersion, ProtocolVersionId, }; +use zksync_vm_utils::storage::L1BatchParamsProvider; use super::*; diff --git a/core/node/state_keeper/src/io/mempool.rs b/core/node/state_keeper/src/io/mempool.rs index 38bcdaad193d..a35b8e031e2b 100644 --- a/core/node/state_keeper/src/io/mempool.rs +++ b/core/node/state_keeper/src/io/mempool.rs @@ -7,12 +7,11 @@ use std::{ use anyhow::Context as _; use async_trait::async_trait; -use multivm::{interface::Halt, utils::derive_base_fee_and_gas_per_pubdata}; -use vm_utils::storage::L1BatchParamsProvider; use zksync_config::configs::chain::StateKeeperConfig; use zksync_contracts::BaseSystemContracts; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_mempool::L2TxFilter; +use zksync_multivm::{interface::Halt, utils::derive_base_fee_and_gas_per_pubdata}; use zksync_node_fee_model::BatchFeeModelInputProvider; use zksync_types::{ protocol_upgrade::ProtocolUpgradeTx, utils::display_timestamp, Address, L1BatchNumber, @@ -20,6 +19,7 @@ use zksync_types::{ }; // TODO (SMA-1206): use seconds instead of milliseconds. use zksync_utils::time::millis_since_epoch; +use zksync_vm_utils::storage::L1BatchParamsProvider; use crate::{ io::{ diff --git a/core/node/state_keeper/src/io/mod.rs b/core/node/state_keeper/src/io/mod.rs index 80ba8e59e2b7..384b0f45b0f6 100644 --- a/core/node/state_keeper/src/io/mod.rs +++ b/core/node/state_keeper/src/io/mod.rs @@ -1,13 +1,13 @@ use std::{fmt, time::Duration}; use async_trait::async_trait; -use multivm::interface::{L1BatchEnv, SystemEnv}; -use vm_utils::storage::l1_batch_params; use zksync_contracts::BaseSystemContracts; +use zksync_multivm::interface::{L1BatchEnv, SystemEnv}; use zksync_types::{ block::L2BlockExecutionData, fee_model::BatchFeeInput, protocol_upgrade::ProtocolUpgradeTx, Address, L1BatchNumber, L2ChainId, ProtocolVersionId, Transaction, H256, }; +use zksync_vm_utils::storage::l1_batch_params; pub use self::{ common::IoCursor, diff --git a/core/node/state_keeper/src/io/persistence.rs b/core/node/state_keeper/src/io/persistence.rs index c3da618fe76f..de9ac22e1777 100644 --- a/core/node/state_keeper/src/io/persistence.rs +++ b/core/node/state_keeper/src/io/persistence.rs @@ -351,8 +351,8 @@ mod tests { use assert_matches::assert_matches; use futures::FutureExt; - use multivm::zk_evm_latest::ethereum_types::{H256, U256}; use zksync_dal::CoreDal; + use zksync_multivm::zk_evm_latest::ethereum_types::{H256, U256}; use zksync_node_genesis::{insert_genesis_batch, GenesisParams}; use zksync_types::{ api::TransactionStatus, block::BlockGasCount, tx::ExecutionMetrics, diff --git a/core/node/state_keeper/src/io/seal_logic/l2_block_seal_subtasks.rs b/core/node/state_keeper/src/io/seal_logic/l2_block_seal_subtasks.rs index fabdc855fa47..03495c0d98b4 100644 --- a/core/node/state_keeper/src/io/seal_logic/l2_block_seal_subtasks.rs +++ b/core/node/state_keeper/src/io/seal_logic/l2_block_seal_subtasks.rs @@ -365,12 +365,12 @@ impl L2BlockSealSubtask for InsertL2ToL1LogsSubtask { #[cfg(test)] mod tests { - use multivm::{ + use zksync_dal::{ConnectionPool, Core}; + use zksync_multivm::{ utils::{get_max_batch_gas_limit, get_max_gas_per_pubdata_byte}, zk_evm_latest::ethereum_types::H256, VmVersion, }; - use zksync_dal::{ConnectionPool, Core}; use zksync_node_test_utils::create_l2_transaction; use zksync_types::{ block::L2BlockHeader, diff --git a/core/node/state_keeper/src/io/seal_logic/mod.rs b/core/node/state_keeper/src/io/seal_logic/mod.rs index 5aedb85b8131..e998317f726a 100644 --- a/core/node/state_keeper/src/io/seal_logic/mod.rs +++ b/core/node/state_keeper/src/io/seal_logic/mod.rs @@ -8,8 +8,8 @@ use std::{ use anyhow::Context as _; use itertools::Itertools; -use multivm::utils::{get_max_batch_gas_limit, get_max_gas_per_pubdata_byte}; use zksync_dal::{Connection, ConnectionPool, Core, CoreDal}; +use zksync_multivm::utils::{get_max_batch_gas_limit, get_max_gas_per_pubdata_byte}; use zksync_shared_metrics::{BlockStage, L2BlockStage, APP_METRICS}; use zksync_types::{ block::{L1BatchHeader, L2BlockHeader}, diff --git a/core/node/state_keeper/src/io/tests/mod.rs b/core/node/state_keeper/src/io/tests/mod.rs index ee0e39ed0618..943ecfc2ad79 100644 --- a/core/node/state_keeper/src/io/tests/mod.rs +++ b/core/node/state_keeper/src/io/tests/mod.rs @@ -1,10 +1,10 @@ use std::time::Duration; -use multivm::utils::derive_base_fee_and_gas_per_pubdata; use test_casing::test_casing; use zksync_contracts::BaseSystemContractsHashes; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_mempool::L2TxFilter; +use zksync_multivm::utils::derive_base_fee_and_gas_per_pubdata; use zksync_node_test_utils::prepare_recovery_snapshot; use zksync_types::{ block::{BlockGasCount, L2BlockHasher}, diff --git a/core/node/state_keeper/src/io/tests/tester.rs b/core/node/state_keeper/src/io/tests/tester.rs index 84dfd4354b3c..35758c44bc95 100644 --- a/core/node/state_keeper/src/io/tests/tester.rs +++ b/core/node/state_keeper/src/io/tests/tester.rs @@ -2,7 +2,6 @@ use std::{slice, sync::Arc, time::Duration}; -use multivm::vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT; use zksync_config::{ configs::{chain::StateKeeperConfig, eth_sender::PubdataSendingMode, wallets::Wallets}, GasAdjusterConfig, @@ -10,6 +9,7 @@ use zksync_config::{ use zksync_contracts::BaseSystemContracts; use zksync_dal::{ConnectionPool, Core, CoreDal}; use zksync_eth_client::clients::MockEthereum; +use zksync_multivm::vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT; use zksync_node_fee_model::{l1_gas_price::GasAdjuster, MainNodeFeeInputProvider}; use zksync_node_genesis::create_genesis_l1_batch; use zksync_node_test_utils::{ diff --git a/core/node/state_keeper/src/keeper.rs b/core/node/state_keeper/src/keeper.rs index 6d44dd247c4d..6c1718232a09 100644 --- a/core/node/state_keeper/src/keeper.rs +++ b/core/node/state_keeper/src/keeper.rs @@ -5,8 +5,8 @@ use std::{ }; use anyhow::Context as _; -use multivm::interface::{Halt, L1BatchEnv, SystemEnv}; use tokio::sync::watch; +use zksync_multivm::interface::{Halt, L1BatchEnv, SystemEnv}; use zksync_state::ReadStorageFactory; use zksync_types::{ block::L2BlockExecutionData, l2::TransactionType, protocol_upgrade::ProtocolUpgradeTx, diff --git a/core/node/state_keeper/src/mempool_actor.rs b/core/node/state_keeper/src/mempool_actor.rs index 85a68069e00b..d79d9ebb34a8 100644 --- a/core/node/state_keeper/src/mempool_actor.rs +++ b/core/node/state_keeper/src/mempool_actor.rs @@ -1,13 +1,13 @@ use std::{collections::HashMap, sync::Arc, time::Duration}; use anyhow::Context as _; -use multivm::utils::derive_base_fee_and_gas_per_pubdata; #[cfg(test)] use tokio::sync::mpsc; use tokio::sync::watch; use zksync_config::configs::chain::MempoolConfig; use zksync_dal::{Connection, ConnectionPool, Core, CoreDal}; use zksync_mempool::L2TxFilter; +use zksync_multivm::utils::derive_base_fee_and_gas_per_pubdata; use zksync_node_fee_model::BatchFeeModelInputProvider; #[cfg(test)] use zksync_types::H256; diff --git a/core/node/state_keeper/src/metrics.rs b/core/node/state_keeper/src/metrics.rs index 66c6e7933e8e..429f4f859c5c 100644 --- a/core/node/state_keeper/src/metrics.rs +++ b/core/node/state_keeper/src/metrics.rs @@ -5,12 +5,12 @@ use std::{ time::Duration, }; -use multivm::interface::{VmExecutionResultAndLogs, VmRevertReason}; use vise::{ Buckets, Counter, EncodeLabelSet, EncodeLabelValue, Family, Gauge, Histogram, LatencyObserver, Metrics, }; use zksync_mempool::MempoolStore; +use zksync_multivm::interface::{VmExecutionResultAndLogs, VmRevertReason}; use zksync_shared_metrics::InteractionType; use zksync_types::{tx::tx_execution_info::DeduplicatedWritesMetrics, ProtocolVersionId}; diff --git a/core/node/state_keeper/src/seal_criteria/criteria/gas_for_batch_tip.rs b/core/node/state_keeper/src/seal_criteria/criteria/gas_for_batch_tip.rs index 8c15d04d0833..69214406bea5 100644 --- a/core/node/state_keeper/src/seal_criteria/criteria/gas_for_batch_tip.rs +++ b/core/node/state_keeper/src/seal_criteria/criteria/gas_for_batch_tip.rs @@ -1,4 +1,4 @@ -use multivm::utils::gas_bootloader_batch_tip_overhead; +use zksync_multivm::utils::gas_bootloader_batch_tip_overhead; use zksync_types::ProtocolVersionId; use crate::seal_criteria::{ diff --git a/core/node/state_keeper/src/seal_criteria/criteria/geometry_seal_criteria.rs b/core/node/state_keeper/src/seal_criteria/criteria/geometry_seal_criteria.rs index 3e800f18e2d9..264618f5d136 100644 --- a/core/node/state_keeper/src/seal_criteria/criteria/geometry_seal_criteria.rs +++ b/core/node/state_keeper/src/seal_criteria/criteria/geometry_seal_criteria.rs @@ -1,7 +1,7 @@ -use multivm::utils::{ +use zksync_config::configs::chain::StateKeeperConfig; +use zksync_multivm::utils::{ circuit_statistics_bootloader_batch_tip_overhead, get_max_batch_base_layer_circuits, }; -use zksync_config::configs::chain::StateKeeperConfig; use zksync_types::ProtocolVersionId; // Local uses diff --git a/core/node/state_keeper/src/seal_criteria/criteria/pubdata_bytes.rs b/core/node/state_keeper/src/seal_criteria/criteria/pubdata_bytes.rs index e021cc127be7..f575a905891c 100644 --- a/core/node/state_keeper/src/seal_criteria/criteria/pubdata_bytes.rs +++ b/core/node/state_keeper/src/seal_criteria/criteria/pubdata_bytes.rs @@ -1,4 +1,4 @@ -use multivm::utils::execution_metrics_bootloader_batch_tip_overhead; +use zksync_multivm::utils::execution_metrics_bootloader_batch_tip_overhead; use zksync_types::ProtocolVersionId; use crate::seal_criteria::{ diff --git a/core/node/state_keeper/src/seal_criteria/criteria/slots.rs b/core/node/state_keeper/src/seal_criteria/criteria/slots.rs index 6178f9e824d8..81b3a0933801 100644 --- a/core/node/state_keeper/src/seal_criteria/criteria/slots.rs +++ b/core/node/state_keeper/src/seal_criteria/criteria/slots.rs @@ -1,4 +1,4 @@ -use multivm::utils::get_bootloader_max_txs_in_batch; +use zksync_multivm::utils::get_bootloader_max_txs_in_batch; use zksync_types::ProtocolVersionId; use crate::seal_criteria::{SealCriterion, SealData, SealResolution, StateKeeperConfig}; diff --git a/core/node/state_keeper/src/seal_criteria/criteria/tx_encoding_size.rs b/core/node/state_keeper/src/seal_criteria/criteria/tx_encoding_size.rs index 13a7f0b0a757..409673d6cac8 100644 --- a/core/node/state_keeper/src/seal_criteria/criteria/tx_encoding_size.rs +++ b/core/node/state_keeper/src/seal_criteria/criteria/tx_encoding_size.rs @@ -1,4 +1,4 @@ -use multivm::utils::get_bootloader_encoding_space; +use zksync_multivm::utils::get_bootloader_encoding_space; use zksync_types::ProtocolVersionId; use crate::seal_criteria::{ diff --git a/core/node/state_keeper/src/seal_criteria/mod.rs b/core/node/state_keeper/src/seal_criteria/mod.rs index ff231107326a..01be129dde6f 100644 --- a/core/node/state_keeper/src/seal_criteria/mod.rs +++ b/core/node/state_keeper/src/seal_criteria/mod.rs @@ -12,8 +12,8 @@ use std::fmt; -use multivm::{interface::Halt, vm_latest::TransactionVmExt}; use zksync_config::configs::chain::StateKeeperConfig; +use zksync_multivm::{interface::Halt, vm_latest::TransactionVmExt}; use zksync_types::{ block::BlockGasCount, fee::TransactionExecutionMetrics, diff --git a/core/node/state_keeper/src/testonly/mod.rs b/core/node/state_keeper/src/testonly/mod.rs index 3f7244a2fb75..965c3c0f05ca 100644 --- a/core/node/state_keeper/src/testonly/mod.rs +++ b/core/node/state_keeper/src/testonly/mod.rs @@ -4,17 +4,17 @@ use std::sync::Arc; use async_trait::async_trait; -use multivm::{ +use once_cell::sync::Lazy; +use tokio::sync::{mpsc, watch}; +use zksync_contracts::BaseSystemContracts; +use zksync_dal::{ConnectionPool, Core, CoreDal as _}; +use zksync_multivm::{ interface::{ CurrentExecutionState, ExecutionResult, FinishedL1Batch, L1BatchEnv, Refunds, SystemEnv, VmExecutionResultAndLogs, VmExecutionStatistics, }, vm_latest::VmExecutionLogs, }; -use once_cell::sync::Lazy; -use tokio::sync::{mpsc, watch}; -use zksync_contracts::BaseSystemContracts; -use zksync_dal::{ConnectionPool, Core, CoreDal as _}; use zksync_state::ReadStorageFactory; use zksync_test_account::Account; use zksync_types::{ diff --git a/core/node/state_keeper/src/testonly/test_batch_executor.rs b/core/node/state_keeper/src/testonly/test_batch_executor.rs index 4539633174a8..9cb701797483 100644 --- a/core/node/state_keeper/src/testonly/test_batch_executor.rs +++ b/core/node/state_keeper/src/testonly/test_batch_executor.rs @@ -13,12 +13,12 @@ use std::{ }; use async_trait::async_trait; -use multivm::{ +use tokio::sync::{mpsc, watch, watch::Receiver}; +use zksync_contracts::BaseSystemContracts; +use zksync_multivm::{ interface::{ExecutionResult, L1BatchEnv, SystemEnv, VmExecutionResultAndLogs}, vm_latest::constants::BATCH_COMPUTATIONAL_GAS_LIMIT, }; -use tokio::sync::{mpsc, watch, watch::Receiver}; -use zksync_contracts::BaseSystemContracts; use zksync_node_test_utils::create_l2_transaction; use zksync_state::{PgOrRocksdbStorage, ReadStorageFactory}; use zksync_types::{ @@ -271,7 +271,7 @@ pub(crate) fn successful_exec_with_metrics( /// Creates a `TxExecutionResult` object denoting a tx that was rejected. pub(crate) fn rejected_exec() -> TxExecutionResult { TxExecutionResult::RejectedByVm { - reason: multivm::interface::Halt::InnerTxError, + reason: zksync_multivm::interface::Halt::InnerTxError, } } diff --git a/core/node/state_keeper/src/tests/mod.rs b/core/node/state_keeper/src/tests/mod.rs index ee716df2e691..8bfc53c8f7b1 100644 --- a/core/node/state_keeper/src/tests/mod.rs +++ b/core/node/state_keeper/src/tests/mod.rs @@ -6,15 +6,15 @@ use std::{ time::Instant, }; -use multivm::{ +use tokio::sync::watch; +use zksync_config::configs::chain::StateKeeperConfig; +use zksync_multivm::{ interface::{ ExecutionResult, Halt, L1BatchEnv, L2BlockEnv, Refunds, SystemEnv, TxExecutionMode, VmExecutionResultAndLogs, VmExecutionStatistics, }, vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, VmExecutionLogs}, }; -use tokio::sync::watch; -use zksync_config::configs::chain::StateKeeperConfig; use zksync_node_test_utils::create_l2_transaction; use zksync_types::{ aggregated_operations::AggregatedActionType, diff --git a/core/node/state_keeper/src/types.rs b/core/node/state_keeper/src/types.rs index 61548483dfd2..2606e7d5c7b7 100644 --- a/core/node/state_keeper/src/types.rs +++ b/core/node/state_keeper/src/types.rs @@ -3,9 +3,9 @@ use std::{ sync::{Arc, Mutex}, }; -use multivm::interface::VmExecutionResultAndLogs; use zksync_dal::{Connection, Core, CoreDal}; use zksync_mempool::{L2TxFilter, MempoolInfo, MempoolStore}; +use zksync_multivm::interface::VmExecutionResultAndLogs; use zksync_types::{ block::BlockGasCount, tx::ExecutionMetrics, Address, Nonce, PriorityOpId, Transaction, }; diff --git a/core/node/state_keeper/src/updates/l1_batch_updates.rs b/core/node/state_keeper/src/updates/l1_batch_updates.rs index 0670b06db7d7..7bc2095ff9b1 100644 --- a/core/node/state_keeper/src/updates/l1_batch_updates.rs +++ b/core/node/state_keeper/src/updates/l1_batch_updates.rs @@ -1,4 +1,4 @@ -use multivm::interface::FinishedL1Batch; +use zksync_multivm::interface::FinishedL1Batch; use zksync_types::{ block::BlockGasCount, priority_op_onchain_data::PriorityOpOnchainData, @@ -51,7 +51,7 @@ impl L1BatchUpdates { #[cfg(test)] mod tests { - use multivm::vm_latest::TransactionVmExt; + use zksync_multivm::vm_latest::TransactionVmExt; use zksync_types::{L2BlockNumber, ProtocolVersionId, H256}; use super::*; diff --git a/core/node/state_keeper/src/updates/l2_block_updates.rs b/core/node/state_keeper/src/updates/l2_block_updates.rs index 93e0a481ebc3..8b3060babad1 100644 --- a/core/node/state_keeper/src/updates/l2_block_updates.rs +++ b/core/node/state_keeper/src/updates/l2_block_updates.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use multivm::{ +use zksync_multivm::{ interface::{ExecutionResult, L2BlockEnv, VmExecutionResultAndLogs}, vm_latest::TransactionVmExt, }; @@ -181,7 +181,7 @@ impl L2BlockUpdates { #[cfg(test)] mod tests { - use multivm::vm_latest::TransactionVmExt; + use zksync_multivm::vm_latest::TransactionVmExt; use super::*; use crate::tests::{create_execution_result, create_transaction}; diff --git a/core/node/state_keeper/src/updates/mod.rs b/core/node/state_keeper/src/updates/mod.rs index c78607147468..1121af8d72e2 100644 --- a/core/node/state_keeper/src/updates/mod.rs +++ b/core/node/state_keeper/src/updates/mod.rs @@ -1,8 +1,8 @@ -use multivm::{ +use zksync_contracts::BaseSystemContractsHashes; +use zksync_multivm::{ interface::{FinishedL1Batch, L1BatchEnv, SystemEnv, VmExecutionResultAndLogs}, utils::get_batch_base_fee, }; -use zksync_contracts::BaseSystemContractsHashes; use zksync_types::{ block::BlockGasCount, fee_model::BatchFeeInput, storage_writes_deduplicator::StorageWritesDeduplicator, diff --git a/core/node/tee_verifier_input_producer/Cargo.toml b/core/node/tee_verifier_input_producer/Cargo.toml index 208e7e35760c..1cad743c41b1 100644 --- a/core/node/tee_verifier_input_producer/Cargo.toml +++ b/core/node/tee_verifier_input_producer/Cargo.toml @@ -17,7 +17,7 @@ zksync_queued_job_processor.workspace = true zksync_tee_verifier.workspace = true zksync_types.workspace = true zksync_utils.workspace = true -vm_utils.workspace = true +zksync_vm_utils.workspace = true vise.workspace = true anyhow.workspace = true diff --git a/core/node/tee_verifier_input_producer/src/lib.rs b/core/node/tee_verifier_input_producer/src/lib.rs index 9104b62fa5e5..7175b807bc8c 100644 --- a/core/node/tee_verifier_input_producer/src/lib.rs +++ b/core/node/tee_verifier_input_producer/src/lib.rs @@ -12,7 +12,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context; use async_trait::async_trait; use tokio::task::JoinHandle; -use vm_utils::storage::L1BatchParamsProvider; use zksync_dal::{tee_verifier_input_producer_dal::JOB_MAX_ATTEMPT, ConnectionPool, Core, CoreDal}; use zksync_object_store::ObjectStore; use zksync_prover_interface::inputs::PrepareBasicCircuitsJob; @@ -20,6 +19,7 @@ use zksync_queued_job_processor::JobProcessor; use zksync_tee_verifier::TeeVerifierInput; use zksync_types::{L1BatchNumber, L2ChainId}; use zksync_utils::u256_to_h256; +use zksync_vm_utils::storage::L1BatchParamsProvider; use self::metrics::METRICS; diff --git a/core/node/test_utils/Cargo.toml b/core/node/test_utils/Cargo.toml index da23ac917571..78205337c549 100644 --- a/core/node/test_utils/Cargo.toml +++ b/core/node/test_utils/Cargo.toml @@ -10,7 +10,7 @@ keywords.workspace = true categories.workspace = true [dependencies] -multivm.workspace = true +zksync_multivm.workspace = true zksync_types.workspace = true zksync_dal.workspace = true zksync_contracts.workspace = true diff --git a/core/node/test_utils/src/lib.rs b/core/node/test_utils/src/lib.rs index a77e0aea2c0c..6b3082abb35e 100644 --- a/core/node/test_utils/src/lib.rs +++ b/core/node/test_utils/src/lib.rs @@ -2,10 +2,10 @@ use std::collections::HashMap; -use multivm::utils::get_max_gas_per_pubdata_byte; use zksync_contracts::BaseSystemContractsHashes; use zksync_dal::{Connection, Core, CoreDal}; use zksync_merkle_tree::{domain::ZkSyncTree, TreeInstruction}; +use zksync_multivm::utils::get_max_gas_per_pubdata_byte; use zksync_node_genesis::GenesisParams; use zksync_system_constants::{get_intrinsic_constants, ZKPORTER_IS_AVAILABLE}; use zksync_types::{ diff --git a/core/node/vm_runner/Cargo.toml b/core/node/vm_runner/Cargo.toml index 5571bb7f3fde..a68cd27f8cb5 100644 --- a/core/node/vm_runner/Cargo.toml +++ b/core/node/vm_runner/Cargo.toml @@ -10,7 +10,7 @@ keywords.workspace = true categories.workspace = true [dependencies] -multivm.workspace = true +zksync_multivm.workspace = true zksync_types.workspace = true zksync_dal.workspace = true zksync_contracts.workspace = true @@ -18,7 +18,7 @@ zksync_state.workspace = true zksync_storage.workspace = true zksync_state_keeper.workspace = true zksync_utils.workspace = true -vm_utils.workspace = true +zksync_vm_utils.workspace = true tokio = { workspace = true, features = ["time"] } anyhow.workspace = true diff --git a/core/node/vm_runner/src/process.rs b/core/node/vm_runner/src/process.rs index 945d35477ce6..8a9ebb4e3dc9 100644 --- a/core/node/vm_runner/src/process.rs +++ b/core/node/vm_runner/src/process.rs @@ -1,9 +1,9 @@ use std::{sync::Arc, time::Duration}; use anyhow::Context; -use multivm::interface::L2BlockEnv; use tokio::{sync::watch, task::JoinHandle}; use zksync_dal::{ConnectionPool, Core}; +use zksync_multivm::interface::L2BlockEnv; use zksync_state_keeper::{ BatchExecutor, BatchExecutorHandle, ExecutionMetricsForCriteria, L2BlockParams, StateKeeperOutputHandler, TxExecutionResult, UpdatesManager, diff --git a/core/node/vm_runner/src/storage.rs b/core/node/vm_runner/src/storage.rs index 7f4de2725e4a..a7a4c6c18a6d 100644 --- a/core/node/vm_runner/src/storage.rs +++ b/core/node/vm_runner/src/storage.rs @@ -7,15 +7,15 @@ use std::{ use anyhow::Context as _; use async_trait::async_trait; -use multivm::{interface::L1BatchEnv, vm_1_4_2::SystemEnv}; use tokio::sync::{watch, RwLock}; -use vm_utils::storage::L1BatchParamsProvider; use zksync_dal::{Connection, ConnectionPool, Core, CoreDal}; +use zksync_multivm::{interface::L1BatchEnv, vm_1_4_2::SystemEnv}; use zksync_state::{ AsyncCatchupTask, BatchDiff, PgOrRocksdbStorage, ReadStorageFactory, RocksdbCell, RocksdbStorage, RocksdbStorageBuilder, RocksdbWithMemory, }; use zksync_types::{block::L2BlockExecutionData, L1BatchNumber, L2ChainId}; +use zksync_vm_utils::storage::L1BatchParamsProvider; use crate::{metrics::METRICS, VmRunnerIo}; diff --git a/core/node/vm_runner/src/tests/output_handler.rs b/core/node/vm_runner/src/tests/output_handler.rs index 97ea59db63b0..453507328c4f 100644 --- a/core/node/vm_runner/src/tests/output_handler.rs +++ b/core/node/vm_runner/src/tests/output_handler.rs @@ -1,12 +1,12 @@ use std::{collections::HashMap, sync::Arc, time::Duration}; -use multivm::interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}; use tokio::{ sync::{watch, RwLock}, task::JoinHandle, }; use zksync_contracts::{BaseSystemContracts, SystemContractCode}; use zksync_dal::{ConnectionPool, Core}; +use zksync_multivm::interface::{L1BatchEnv, L2BlockEnv, SystemEnv, TxExecutionMode}; use zksync_state_keeper::UpdatesManager; use zksync_types::L1BatchNumber; diff --git a/core/tests/loadnext/Cargo.toml b/core/tests/loadnext/Cargo.toml index 0c8b005d5582..2ba120cb4dac 100644 --- a/core/tests/loadnext/Cargo.toml +++ b/core/tests/loadnext/Cargo.toml @@ -19,8 +19,8 @@ zksync_eth_client.workspace = true zksync_config.workspace = true zksync_contracts.workspace = true zksync_system_constants.workspace = true -vlog.workspace = true -prometheus_exporter.workspace = true +zksync_vlog.workspace = true +zksync_prometheus_exporter.workspace = true async-trait.workspace = true serde = { workspace = true, features = ["derive"] } diff --git a/core/tests/loadnext/src/main.rs b/core/tests/loadnext/src/main.rs index 309dd7557687..3abd8e0441af 100644 --- a/core/tests/loadnext/src/main.rs +++ b/core/tests/loadnext/src/main.rs @@ -12,16 +12,16 @@ use loadnext::{ executor::Executor, report_collector::LoadtestResult, }; -use prometheus_exporter::PrometheusExporterConfig; use tokio::sync::watch; use zksync_config::configs::api::PrometheusConfig; +use zksync_prometheus_exporter::PrometheusExporterConfig; #[tokio::main] async fn main() -> anyhow::Result<()> { // We don't want to introduce dependency on `zksync_env_config` in loadnext, // but we historically rely on the environment variables for the observability configuration, // so we load them directly here. - let log_format: vlog::LogFormat = std::env::var("MISC_LOG_FORMAT") + let log_format: zksync_vlog::LogFormat = std::env::var("MISC_LOG_FORMAT") .ok() .unwrap_or("plain".to_string()) .parse()?; @@ -39,7 +39,7 @@ async fn main() -> anyhow::Result<()> { } }; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = sentry_url { builder = builder .with_sentry_url(&sentry_url) diff --git a/core/tests/vm-benchmark/Cargo.toml b/core/tests/vm-benchmark/Cargo.toml index 5b96d7767305..e765191cd869 100644 --- a/core/tests/vm-benchmark/Cargo.toml +++ b/core/tests/vm-benchmark/Cargo.toml @@ -3,9 +3,10 @@ name = "vm-benchmark" version = "0.1.0" edition.workspace = true license.workspace = true +publish = false [dependencies] -vm-benchmark-harness.workspace = true +zksync_vm_benchmark_harness.workspace = true metrics-exporter-prometheus.workspace = true vise.workspace = true tokio.workspace = true diff --git a/core/tests/vm-benchmark/benches/criterion.rs b/core/tests/vm-benchmark/benches/criterion.rs index c6c81d723365..5becccfab801 100644 --- a/core/tests/vm-benchmark/benches/criterion.rs +++ b/core/tests/vm-benchmark/benches/criterion.rs @@ -1,5 +1,5 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; +use zksync_vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; fn benches_in_folder(c: &mut Criterion) { for path in std::fs::read_dir("deployment_benchmarks").unwrap() { diff --git a/core/tests/vm-benchmark/benches/diy_benchmark.rs b/core/tests/vm-benchmark/benches/diy_benchmark.rs index c1c627cbcb4a..1601de5eb85f 100644 --- a/core/tests/vm-benchmark/benches/diy_benchmark.rs +++ b/core/tests/vm-benchmark/benches/diy_benchmark.rs @@ -2,7 +2,7 @@ use std::time::{Duration, Instant}; use criterion::black_box; use vise::{Gauge, LabeledFamily, Metrics}; -use vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; +use zksync_vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; fn main() { let mut results = vec![]; diff --git a/core/tests/vm-benchmark/benches/iai.rs b/core/tests/vm-benchmark/benches/iai.rs index a7c8a9c2ecd4..f0ba43f26853 100644 --- a/core/tests/vm-benchmark/benches/iai.rs +++ b/core/tests/vm-benchmark/benches/iai.rs @@ -1,5 +1,5 @@ use iai::black_box; -use vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; +use zksync_vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; fn run_bytecode(path: &str) { let test_contract = std::fs::read(path).expect("failed to read file"); diff --git a/core/tests/vm-benchmark/harness/Cargo.toml b/core/tests/vm-benchmark/harness/Cargo.toml index da786ee391b1..acd5f37cbc7b 100644 --- a/core/tests/vm-benchmark/harness/Cargo.toml +++ b/core/tests/vm-benchmark/harness/Cargo.toml @@ -1,11 +1,12 @@ [package] -name = "vm-benchmark-harness" +name = "zksync_vm_benchmark_harness" version.workspace = true edition.workspace = true license.workspace = true +publish = false [dependencies] -multivm.workspace = true +zksync_multivm.workspace = true zksync_types.workspace = true zksync_state.workspace = true zksync_utils.workspace = true diff --git a/core/tests/vm-benchmark/harness/src/instruction_counter.rs b/core/tests/vm-benchmark/harness/src/instruction_counter.rs index 8ab861c56ae8..0d80658c7208 100644 --- a/core/tests/vm-benchmark/harness/src/instruction_counter.rs +++ b/core/tests/vm-benchmark/harness/src/instruction_counter.rs @@ -1,6 +1,6 @@ use std::{cell::RefCell, rc::Rc}; -use multivm::{ +use zksync_multivm::{ interface::{dyn_tracers::vm_1_5_0::DynTracer, tracer::TracerExecutionStatus}, vm_latest::{BootloaderState, HistoryMode, SimpleMemory, VmTracer, ZkSyncVmState}, }; @@ -32,7 +32,7 @@ impl VmTracer for InstructionCounter { &mut self, _state: &mut ZkSyncVmState, _bootloader_state: &BootloaderState, - _stop_reason: multivm::interface::tracer::VmExecutionStopReason, + _stop_reason: zksync_multivm::interface::tracer::VmExecutionStopReason, ) { *self.output.borrow_mut() = self.count; } diff --git a/core/tests/vm-benchmark/harness/src/lib.rs b/core/tests/vm-benchmark/harness/src/lib.rs index 137a3b654cba..35e7530e9aad 100644 --- a/core/tests/vm-benchmark/harness/src/lib.rs +++ b/core/tests/vm-benchmark/harness/src/lib.rs @@ -1,14 +1,14 @@ use std::{cell::RefCell, rc::Rc}; -use multivm::{ +use once_cell::sync::Lazy; +use zksync_contracts::{deployer_contract, BaseSystemContracts}; +use zksync_multivm::{ interface::{ L2BlockEnv, TxExecutionMode, VmExecutionMode, VmExecutionResultAndLogs, VmInterface, }, utils::get_max_gas_per_pubdata_byte, vm_latest::{constants::BATCH_COMPUTATIONAL_GAS_LIMIT, HistoryEnabled, TracerDispatcher, Vm}, }; -use once_cell::sync::Lazy; -use zksync_contracts::{deployer_contract, BaseSystemContracts}; use zksync_state::{InMemoryStorage, StorageView}; use zksync_types::{ block::L2BlockHasher, @@ -69,7 +69,7 @@ impl BenchmarkingVm { let timestamp = unix_timestamp_ms(); Self(Vm::new( - multivm::interface::L1BatchEnv { + zksync_multivm::interface::L1BatchEnv { previous_batch_hash: None, number: L1BatchNumber(1), timestamp, @@ -86,7 +86,7 @@ impl BenchmarkingVm { max_virtual_blocks_to_create: 100, }, }, - multivm::interface::SystemEnv { + zksync_multivm::interface::SystemEnv { zk_porter_available: false, version: ProtocolVersionId::latest(), base_system_smart_contracts: SYSTEM_CONTRACTS.clone(), @@ -173,7 +173,7 @@ mod tests { assert!(matches!( res.result, - multivm::interface::ExecutionResult::Success { .. } + zksync_multivm::interface::ExecutionResult::Success { .. } )); } } diff --git a/core/tests/vm-benchmark/src/find_slowest.rs b/core/tests/vm-benchmark/src/find_slowest.rs index 2bc2a894d2d0..97a6acd5acd9 100644 --- a/core/tests/vm-benchmark/src/find_slowest.rs +++ b/core/tests/vm-benchmark/src/find_slowest.rs @@ -3,7 +3,7 @@ use std::{ time::{Duration, Instant}, }; -use vm_benchmark_harness::*; +use zksync_vm_benchmark_harness::*; fn main() { let mut results = vec![]; diff --git a/core/tests/vm-benchmark/src/instruction_counts.rs b/core/tests/vm-benchmark/src/instruction_counts.rs index a80d8a7ffd67..c038c8f2bf6b 100644 --- a/core/tests/vm-benchmark/src/instruction_counts.rs +++ b/core/tests/vm-benchmark/src/instruction_counts.rs @@ -2,7 +2,7 @@ use std::path::Path; -use vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; +use zksync_vm_benchmark_harness::{cut_to_allowed_bytecode_size, get_deploy_tx, BenchmarkingVm}; fn main() { // using source file location because this is just a script, the binary isn't meant to be reused diff --git a/core/tests/vm-benchmark/src/main.rs b/core/tests/vm-benchmark/src/main.rs index 99105e078ea7..925ec78ceb3c 100644 --- a/core/tests/vm-benchmark/src/main.rs +++ b/core/tests/vm-benchmark/src/main.rs @@ -1,4 +1,4 @@ -use vm_benchmark_harness::*; +use zksync_vm_benchmark_harness::*; fn main() { let test_contract = std::fs::read( diff --git a/prover/Cargo.lock b/prover/Cargo.lock index c0e965605fd4..b7cafdc0ad10 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -3563,35 +3563,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" -[[package]] -name = "multivm" -version = "0.1.0" -dependencies = [ - "anyhow", - "circuit_sequencer_api 0.1.0", - "circuit_sequencer_api 0.1.40", - "circuit_sequencer_api 0.1.41", - "circuit_sequencer_api 0.1.42", - "circuit_sequencer_api 0.1.50", - "hex", - "itertools 0.10.5", - "once_cell", - "serde", - "thiserror", - "tracing", - "vise", - "zk_evm 1.3.1", - "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", - "zk_evm 1.5.0", - "zksync_contracts", - "zksync_state", - "zksync_system_constants", - "zksync_types", - "zksync_utils", -] - [[package]] name = "native-tls" version = "0.2.12" @@ -4438,18 +4409,6 @@ dependencies = [ "syn 2.0.66", ] -[[package]] -name = "prometheus_exporter" -version = "0.1.0" -dependencies = [ - "anyhow", - "metrics", - "metrics-exporter-prometheus", - "tokio", - "vise", - "vise-exporter", -] - [[package]] name = "proptest" version = "1.4.0" @@ -4600,7 +4559,6 @@ dependencies = [ "colored", "dialoguer", "hex", - "prover_dal", "serde_json", "sqlx", "strum", @@ -4615,22 +4573,13 @@ dependencies = [ "zksync_db_connection", "zksync_env_config", "zksync_eth_client", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_interface", "zksync_types", "zksync_utils", ] -[[package]] -name = "prover_dal" -version = "0.1.0" -dependencies = [ - "sqlx", - "strum", - "zksync_basic_types", - "zksync_db_connection", -] - [[package]] name = "prover_version" version = "0.1.0" @@ -7044,29 +6993,13 @@ dependencies = [ "toml_edit 0.14.4", "tracing", "tracing-subscriber", - "vlog", "zkevm_test_harness 1.5.0", "zksync_config", "zksync_env_config", "zksync_prover_fri_types", "zksync_types", "zksync_utils", -] - -[[package]] -name = "vlog" -version = "0.1.0" -dependencies = [ - "chrono", - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry-semantic-conventions", - "sentry", - "serde", - "serde_json", - "tracing", - "tracing-opentelemetry", - "tracing-subscriber", + "zksync_vlog", ] [[package]] @@ -8171,13 +8104,41 @@ dependencies = [ "zksync_crypto", ] +[[package]] +name = "zksync_multivm" +version = "0.1.0" +dependencies = [ + "anyhow", + "circuit_sequencer_api 0.1.0", + "circuit_sequencer_api 0.1.40", + "circuit_sequencer_api 0.1.41", + "circuit_sequencer_api 0.1.42", + "circuit_sequencer_api 0.1.50", + "hex", + "itertools 0.10.5", + "once_cell", + "serde", + "thiserror", + "tracing", + "vise", + "zk_evm 1.3.1", + "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", + "zk_evm 1.5.0", + "zksync_contracts", + "zksync_state", + "zksync_system_constants", + "zksync_types", + "zksync_utils", +] + [[package]] name = "zksync_node_genesis" version = "0.1.0" dependencies = [ "anyhow", "itertools 0.10.5", - "multivm", "thiserror", "tokio", "tracing", @@ -8187,6 +8148,7 @@ dependencies = [ "zksync_dal", "zksync_eth_client", "zksync_merkle_tree", + "zksync_multivm", "zksync_system_constants", "zksync_types", "zksync_utils", @@ -8215,6 +8177,18 @@ dependencies = [ "zksync_types", ] +[[package]] +name = "zksync_prometheus_exporter" +version = "0.1.0" +dependencies = [ + "anyhow", + "metrics", + "metrics-exporter-prometheus", + "tokio", + "vise", + "vise-exporter", +] + [[package]] name = "zksync_proof_fri_compressor" version = "0.1.0" @@ -8225,8 +8199,6 @@ dependencies = [ "circuit_sequencer_api 0.1.50", "ctrlc", "futures 0.3.30", - "prometheus_exporter", - "prover_dal", "reqwest", "serde", "serde_json", @@ -8235,18 +8207,20 @@ dependencies = [ "tracing", "vise", "vk_setup_data_generator_server_fri", - "vlog", "wrapper-prover", "zkevm_test_harness 1.3.3", "zkevm_test_harness 1.5.0", "zksync_config", "zksync_env_config", "zksync_object_store", + "zksync_prometheus_exporter", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_interface", "zksync_queued_job_processor", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -8314,6 +8288,16 @@ dependencies = [ "zksync_protobuf_config", ] +[[package]] +name = "zksync_prover_dal" +version = "0.1.0" +dependencies = [ + "sqlx", + "strum", + "zksync_basic_types", + "zksync_db_connection", +] + [[package]] name = "zksync_prover_fri" version = "0.1.0" @@ -8325,8 +8309,6 @@ dependencies = [ "ctrlc", "futures 0.3.30", "local-ip-address", - "prometheus_exporter", - "prover_dal", "regex", "reqwest", "serde", @@ -8335,17 +8317,19 @@ dependencies = [ "tracing", "vise", "vk_setup_data_generator_server_fri", - "vlog", "zkevm_test_harness 1.5.0", "zksync_config", "zksync_env_config", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_prover_config", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", "zksync_queued_job_processor", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -8358,21 +8342,21 @@ dependencies = [ "ctrlc", "futures 0.3.30", "log", - "prometheus_exporter", - "prover_dal", "reqwest", "serde", "tokio", "tracing", "vise", - "vlog", "zksync_config", "zksync_env_config", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_prover_config", + "zksync_prover_dal", "zksync_prover_interface", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -8390,7 +8374,6 @@ name = "zksync_prover_fri_utils" version = "0.1.0" dependencies = [ "anyhow", - "prover_dal", "regex", "reqwest", "serde", @@ -8398,6 +8381,7 @@ dependencies = [ "vise", "zksync_config", "zksync_object_store", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_types", "zksync_utils", @@ -8528,9 +8512,25 @@ dependencies = [ "thiserror", "tokio", "tracing", - "vlog", "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", "zksync_basic_types", + "zksync_vlog", +] + +[[package]] +name = "zksync_vlog" +version = "0.1.0" +dependencies = [ + "chrono", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "sentry", + "serde", + "serde_json", + "tracing", + "tracing-opentelemetry", + "tracing-subscriber", ] [[package]] @@ -8565,10 +8565,7 @@ dependencies = [ "ctrlc", "futures 0.3.30", "jemallocator", - "multivm", "once_cell", - "prometheus_exporter", - "prover_dal", "rand 0.8.5", "serde", "structopt", @@ -8577,16 +8574,18 @@ dependencies = [ "tracing", "vise", "vk_setup_data_generator_server_fri", - "vlog", "zk_evm 1.4.1", "zkevm_test_harness 1.5.0", "zksync_config", "zksync_core_leftovers", "zksync_dal", "zksync_env_config", + "zksync_multivm", "zksync_object_store", + "zksync_prometheus_exporter", "zksync_protobuf_config", "zksync_prover_config", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", "zksync_prover_interface", @@ -8595,6 +8594,7 @@ dependencies = [ "zksync_system_constants", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] @@ -8606,8 +8606,6 @@ dependencies = [ "bincode", "ctrlc", "futures 0.3.30", - "prometheus_exporter", - "prover_dal", "queues", "serde", "structopt", @@ -8615,15 +8613,17 @@ dependencies = [ "tracing", "vise", "vk_setup_data_generator_server_fri", - "vlog", "zksync_config", "zksync_env_config", "zksync_object_store", + "zksync_prometheus_exporter", + "zksync_prover_dal", "zksync_prover_fri_types", "zksync_prover_fri_utils", "zksync_queued_job_processor", "zksync_types", "zksync_utils", + "zksync_vlog", ] [[package]] diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 87021c27a7fb..4d05d986aab2 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -47,11 +47,9 @@ jemallocator = "0.5" local-ip-address = "0.5.0" log = "0.4.20" md5 = "0.7.0" -multivm = { path = "../core/lib/multivm", version = "0.1.0" } once_cell = "1.18" -prometheus_exporter = { path = "../core/lib/prometheus_exporter" } proptest = "1.2.0" -prover_dal = { path = "prover_dal" } +zksync_prover_dal = { path = "prover_dal" } queues = "1.1.0" rand = "0.8" regex = "1.10.4" @@ -72,7 +70,9 @@ tracing-subscriber = { version = "0.3" } vise = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "a5bb80c9ce7168663114ee30e794d6dc32159ee4" } vk_setup_data_generator_server_fri = { path = "vk_setup_data_generator_server_fri" } zksync_prover_config = { path = "config" } -vlog = { path = "../core/lib/vlog" } +zksync_multivm = { path = "../core/lib/multivm", version = "0.1.0" } +zksync_prometheus_exporter = { path = "../core/lib/prometheus_exporter" } +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" } diff --git a/prover/proof_fri_compressor/Cargo.toml b/prover/proof_fri_compressor/Cargo.toml index dd1aad902da3..5f032ed245ad 100644 --- a/prover/proof_fri_compressor/Cargo.toml +++ b/prover/proof_fri_compressor/Cargo.toml @@ -12,17 +12,17 @@ categories.workspace = true [dependencies] vise.workspace = true zksync_types.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_config.workspace = true zksync_env_config.workspace = true zksync_object_store.workspace = true zksync_prover_interface.workspace = true zksync_utils.workspace = true -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true zksync_prover_fri_types.workspace = true zksync_queued_job_processor.workspace = true vk_setup_data_generator_server_fri.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true zkevm_test_harness_1_3_3.workspace = true circuit_sequencer_api.workspace = true diff --git a/prover/proof_fri_compressor/src/compressor.rs b/prover/proof_fri_compressor/src/compressor.rs index aba03a61497b..3306187b2bc3 100644 --- a/prover/proof_fri_compressor/src/compressor.rs +++ b/prover/proof_fri_compressor/src/compressor.rs @@ -3,7 +3,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; use async_trait::async_trait; use circuit_sequencer_api::proof::FinalProof; -use prover_dal::{ConnectionPool, Prover, ProverDal}; use tokio::task::JoinHandle; #[cfg(feature = "gpu")] use wrapper_prover::{Bn256, GPUWrapperConfigs, WrapperProver, DEFAULT_WRAPPER_CONFIG}; @@ -23,6 +22,7 @@ use zkevm_test_harness_1_3_3::{ witness::oracle::VmWitnessOracle, }; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, diff --git a/prover/proof_fri_compressor/src/main.rs b/prover/proof_fri_compressor/src/main.rs index 61b72d790f0a..7c79172b45c1 100644 --- a/prover/proof_fri_compressor/src/main.rs +++ b/prover/proof_fri_compressor/src/main.rs @@ -3,13 +3,13 @@ use std::{env, time::Duration}; use anyhow::Context as _; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::{ConnectionPool, Prover}; use structopt::StructOpt; use tokio::sync::{oneshot, watch}; use zksync_config::configs::{DatabaseSecrets, FriProofCompressorConfig, ObservabilityConfig}; use zksync_env_config::{object_store::ProverObjectStoreConfig, FromEnv}; use zksync_object_store::ObjectStoreFactory; +use zksync_prometheus_exporter::PrometheusExporterConfig; +use zksync_prover_dal::{ConnectionPool, Prover}; use zksync_prover_fri_types::PROVER_PROTOCOL_SEMANTIC_VERSION; use zksync_queued_job_processor::JobProcessor; use zksync_utils::wait_for_tasks::ManagedTasks; @@ -37,12 +37,12 @@ struct Opt { async fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url) diff --git a/prover/prover_cli/Cargo.toml b/prover/prover_cli/Cargo.toml index cca26f76113a..c5ec43c47cb1 100644 --- a/prover/prover_cli/Cargo.toml +++ b/prover/prover_cli/Cargo.toml @@ -25,7 +25,7 @@ zksync_basic_types.workspace = true zksync_types.workspace = true zksync_prover_fri_types.workspace = true zksync_prover_interface.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_eth_client.workspace = true zksync_contracts.workspace = true zksync_dal.workspace = true @@ -39,4 +39,4 @@ zkevm_test_harness = { workspace = true, optional = true, features = ["verbose_c [features] # enable verbose circuits, if you want to use debug_circuit command (as it is quite heavy dependency). -verbose_circuits = ["zkevm_test_harness"] \ No newline at end of file +verbose_circuits = ["zkevm_test_harness"] diff --git a/prover/prover_cli/src/commands/delete.rs b/prover/prover_cli/src/commands/delete.rs index 7df869b1311b..436bb10e10cb 100644 --- a/prover/prover_cli/src/commands/delete.rs +++ b/prover/prover_cli/src/commands/delete.rs @@ -1,7 +1,7 @@ use anyhow::Context; use clap::Args as ClapArgs; use dialoguer::{theme::ColorfulTheme, Input}; -use prover_dal::{Connection, ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{Connection, ConnectionPool, Prover, ProverDal}; use zksync_types::L1BatchNumber; use crate::cli::ProverCLIConfig; diff --git a/prover/prover_cli/src/commands/requeue.rs b/prover/prover_cli/src/commands/requeue.rs index d529aebcc162..a9d967be5ba9 100644 --- a/prover/prover_cli/src/commands/requeue.rs +++ b/prover/prover_cli/src/commands/requeue.rs @@ -1,6 +1,6 @@ use anyhow::Context; use clap::Args as ClapArgs; -use prover_dal::{ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_types::{basic_fri_types::AggregationRound, prover_dal::StuckJobs, L1BatchNumber}; use crate::cli::ProverCLIConfig; diff --git a/prover/prover_cli/src/commands/restart.rs b/prover/prover_cli/src/commands/restart.rs index 3b9a99c7431f..75beafd7100c 100644 --- a/prover/prover_cli/src/commands/restart.rs +++ b/prover/prover_cli/src/commands/restart.rs @@ -1,10 +1,10 @@ use anyhow::Context; use clap::Args as ClapArgs; -use prover_dal::{ - fri_witness_generator_dal::FriWitnessJobStatus, Connection, ConnectionPool, Prover, ProverDal, -}; use zksync_config::configs::DatabaseSecrets; use zksync_env_config::FromEnv; +use zksync_prover_dal::{ + fri_witness_generator_dal::FriWitnessJobStatus, Connection, ConnectionPool, Prover, ProverDal, +}; use zksync_types::{basic_fri_types::AggregationRound, L1BatchNumber}; #[derive(ClapArgs)] diff --git a/prover/prover_cli/src/commands/status/batch.rs b/prover/prover_cli/src/commands/status/batch.rs index dc23bf046683..84a8e7184a65 100644 --- a/prover/prover_cli/src/commands/status/batch.rs +++ b/prover/prover_cli/src/commands/status/batch.rs @@ -4,7 +4,7 @@ use anyhow::Context as _; use circuit_definitions::zkevm_circuits::scheduler::aux::BaseLayerCircuitType; use clap::Args as ClapArgs; use colored::*; -use prover_dal::{Connection, ConnectionPool, Prover, ProverDal}; +use zksync_prover_dal::{Connection, ConnectionPool, Prover, ProverDal}; use zksync_types::{ basic_fri_types::AggregationRound, prover_dal::{ diff --git a/prover/prover_cli/src/commands/status/l1.rs b/prover/prover_cli/src/commands/status/l1.rs index d02e545a4178..128005c309c6 100644 --- a/prover/prover_cli/src/commands/status/l1.rs +++ b/prover/prover_cli/src/commands/status/l1.rs @@ -1,5 +1,4 @@ use anyhow::Context; -use prover_dal::{Prover, ProverDal}; use zksync_basic_types::{ protocol_version::{L1VerifierConfig, VerifierParams}, L1BatchNumber, H256, U256, @@ -14,6 +13,7 @@ use zksync_eth_client::{ clients::{Client, L1}, CallFunctionArgs, }; +use zksync_prover_dal::{Prover, ProverDal}; use crate::helper; diff --git a/prover/prover_dal/Cargo.toml b/prover/prover_dal/Cargo.toml index bc07ce18393c..7f6b6f0116ce 100644 --- a/prover/prover_dal/Cargo.toml +++ b/prover/prover_dal/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "prover_dal" +name = "zksync_prover_dal" version.workspace = true edition.workspace = true authors.workspace = true diff --git a/prover/prover_fri/Cargo.toml b/prover/prover_fri/Cargo.toml index 9bce1f2581b8..5fa663e3de63 100644 --- a/prover/prover_fri/Cargo.toml +++ b/prover/prover_fri/Cargo.toml @@ -12,11 +12,11 @@ categories.workspace = true [dependencies] vise.workspace = true zksync_types.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_config.workspace = true zksync_env_config.workspace = true -prometheus_exporter.workspace = true -vlog.workspace = true +zksync_prometheus_exporter.workspace = true +zksync_vlog.workspace = true zksync_object_store.workspace = true zksync_queued_job_processor.workspace = true zksync_prover_fri_utils.workspace = true diff --git a/prover/prover_fri/src/gpu_prover_availability_checker.rs b/prover/prover_fri/src/gpu_prover_availability_checker.rs index 027c7a4b07a8..4b51b26e5d38 100644 --- a/prover/prover_fri/src/gpu_prover_availability_checker.rs +++ b/prover/prover_fri/src/gpu_prover_availability_checker.rs @@ -2,8 +2,8 @@ pub mod availability_checker { use std::{sync::Arc, time::Duration}; - use prover_dal::{ConnectionPool, Prover, ProverDal}; use tokio::sync::Notify; + use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_types::prover_dal::{GpuProverInstanceStatus, SocketAddress}; use crate::metrics::{KillingReason, METRICS}; diff --git a/prover/prover_fri/src/gpu_prover_job_processor.rs b/prover/prover_fri/src/gpu_prover_job_processor.rs index 09493627bca4..cbd363e9b4f4 100644 --- a/prover/prover_fri/src/gpu_prover_job_processor.rs +++ b/prover/prover_fri/src/gpu_prover_job_processor.rs @@ -3,7 +3,6 @@ pub mod gpu_prover { use std::{collections::HashMap, sync::Arc, time::Instant}; use anyhow::Context as _; - use prover_dal::{ConnectionPool, ProverDal}; use shivini::{ gpu_proof_config::GpuProofConfig, gpu_prove_from_external_witness_data, ProverContext, }; @@ -11,6 +10,7 @@ pub mod gpu_prover { use zksync_config::configs::{fri_prover_group::FriProverGroupConfig, FriProverConfig}; use zksync_env_config::FromEnv; use zksync_object_store::ObjectStore; + use zksync_prover_dal::{ConnectionPool, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ base_layer_proof_config, @@ -56,7 +56,7 @@ pub mod gpu_prover { blob_store: Arc, public_blob_store: Option>, config: Arc, - prover_connection_pool: ConnectionPool, + prover_connection_pool: ConnectionPool, setup_load_mode: SetupLoadMode, // Only pick jobs for the configured circuit id and aggregation rounds. // Empty means all jobs are picked. @@ -74,7 +74,7 @@ pub mod gpu_prover { blob_store: Arc, public_blob_store: Option>, config: FriProverConfig, - prover_connection_pool: ConnectionPool, + prover_connection_pool: ConnectionPool, setup_load_mode: SetupLoadMode, circuit_ids_for_round_to_be_proven: Vec, witness_vector_queue: SharedWitnessVectorQueue, diff --git a/prover/prover_fri/src/main.rs b/prover/prover_fri/src/main.rs index ab2a4d1575c5..fa439b35b2c7 100644 --- a/prover/prover_fri/src/main.rs +++ b/prover/prover_fri/src/main.rs @@ -5,8 +5,6 @@ use std::{future::Future, sync::Arc, time::Duration}; use anyhow::Context as _; use clap::Parser; use local_ip_address::local_ip; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::{ConnectionPool, Prover, ProverDal}; use tokio::{ sync::{oneshot, watch::Receiver, Notify}, task::JoinHandle, @@ -14,7 +12,9 @@ use tokio::{ use zksync_config::configs::{DatabaseSecrets, FriProverConfig}; use zksync_env_config::FromEnv; use zksync_object_store::{ObjectStore, ObjectStoreFactory}; +use zksync_prometheus_exporter::PrometheusExporterConfig; use zksync_prover_config::{load_database_secrets, load_general_config}; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::PROVER_PROTOCOL_SEMANTIC_VERSION; use zksync_prover_fri_utils::{get_all_circuit_id_round_tuples_for, region_fetcher::get_zone}; use zksync_queued_job_processor::JobProcessor; @@ -63,12 +63,12 @@ async fn main() -> anyhow::Result<()> { let observability_config = general_config .observability .context("observability config")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url) diff --git a/prover/prover_fri/src/prover_job_processor.rs b/prover/prover_fri/src/prover_job_processor.rs index 8cdfc91247fa..f06f1bbab939 100644 --- a/prover/prover_fri/src/prover_job_processor.rs +++ b/prover/prover_fri/src/prover_job_processor.rs @@ -1,12 +1,12 @@ use std::{collections::HashMap, sync::Arc, time::Instant}; use anyhow::Context as _; -use prover_dal::{ConnectionPool, ProverDal}; use tokio::task::JoinHandle; use zkevm_test_harness::prover_utils::{prove_base_layer_circuit, prove_recursion_layer_circuit}; use zksync_config::configs::{fri_prover_group::FriProverGroupConfig, FriProverConfig}; use zksync_env_config::FromEnv; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ base_layer_proof_config, @@ -43,7 +43,7 @@ pub struct Prover { blob_store: Arc, public_blob_store: Option>, config: Arc, - prover_connection_pool: ConnectionPool, + prover_connection_pool: ConnectionPool, setup_load_mode: SetupLoadMode, // Only pick jobs for the configured circuit id and aggregation rounds. // Empty means all jobs are picked. @@ -57,7 +57,7 @@ impl Prover { blob_store: Arc, public_blob_store: Option>, config: FriProverConfig, - prover_connection_pool: ConnectionPool, + prover_connection_pool: ConnectionPool, setup_load_mode: SetupLoadMode, circuit_ids_for_round_to_be_proven: Vec, protocol_version: ProtocolSemanticVersion, diff --git a/prover/prover_fri/src/socket_listener.rs b/prover/prover_fri/src/socket_listener.rs index e034b1fd9276..01ac9b5ab108 100644 --- a/prover/prover_fri/src/socket_listener.rs +++ b/prover/prover_fri/src/socket_listener.rs @@ -3,13 +3,13 @@ pub mod gpu_socket_listener { use std::{net::SocketAddr, sync::Arc, time::Instant}; use anyhow::Context as _; - use prover_dal::{ConnectionPool, Prover, ProverDal}; use tokio::{ io::copy, net::{TcpListener, TcpStream}, sync::{watch, Notify}, }; use zksync_object_store::bincode; + use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::WitnessVectorArtifacts; use zksync_types::{ protocol_version::ProtocolSemanticVersion, diff --git a/prover/prover_fri/src/utils.rs b/prover/prover_fri/src/utils.rs index e52b66ed983f..15a2a6c18bb2 100644 --- a/prover/prover_fri/src/utils.rs +++ b/prover/prover_fri/src/utils.rs @@ -2,10 +2,10 @@ use std::{sync::Arc, time::Instant}; -use prover_dal::{Connection, Prover, ProverDal}; use tokio::sync::Mutex; use zkevm_test_harness::prover_utils::{verify_base_layer_proof, verify_recursion_layer_proof}; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Connection, Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::{ diff --git a/prover/prover_fri_gateway/Cargo.toml b/prover/prover_fri_gateway/Cargo.toml index 6a98bd8f0067..a95cab63a180 100644 --- a/prover/prover_fri_gateway/Cargo.toml +++ b/prover/prover_fri_gateway/Cargo.toml @@ -12,15 +12,15 @@ categories.workspace = true [dependencies] vise.workspace = true zksync_types.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_config.workspace = true zksync_env_config.workspace = true zksync_object_store.workspace = true zksync_prover_interface.workspace = true zksync_prover_config.workspace = true zksync_utils.workspace = true -prometheus_exporter.workspace = true -vlog.workspace = true +zksync_prometheus_exporter.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true tracing.workspace = true diff --git a/prover/prover_fri_gateway/src/api_data_fetcher.rs b/prover/prover_fri_gateway/src/api_data_fetcher.rs index 6a95acc0cd0b..f2492588c739 100644 --- a/prover/prover_fri_gateway/src/api_data_fetcher.rs +++ b/prover/prover_fri_gateway/src/api_data_fetcher.rs @@ -1,11 +1,11 @@ use std::{sync::Arc, time::Duration}; use async_trait::async_trait; -use prover_dal::{ConnectionPool, Prover}; use reqwest::Client; use serde::{de::DeserializeOwned, Serialize}; use tokio::{sync::watch, time::sleep}; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover}; use crate::metrics::METRICS; diff --git a/prover/prover_fri_gateway/src/main.rs b/prover/prover_fri_gateway/src/main.rs index f7e7af763afb..58a3a61cf568 100644 --- a/prover/prover_fri_gateway/src/main.rs +++ b/prover/prover_fri_gateway/src/main.rs @@ -2,13 +2,13 @@ use std::time::Duration; use anyhow::Context as _; use clap::Parser; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::{ConnectionPool, Prover}; use reqwest::Client; use tokio::sync::{oneshot, watch}; use zksync_env_config::object_store::ProverObjectStoreConfig; use zksync_object_store::ObjectStoreFactory; +use zksync_prometheus_exporter::PrometheusExporterConfig; use zksync_prover_config::{load_database_secrets, load_general_config}; +use zksync_prover_dal::{ConnectionPool, Prover}; use zksync_prover_interface::api::{ProofGenerationDataRequest, SubmitProofRequest}; use zksync_utils::wait_for_tasks::ManagedTasks; @@ -30,12 +30,12 @@ async fn main() -> anyhow::Result<()> { .observability .context("observability config")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url) diff --git a/prover/prover_fri_gateway/src/proof_gen_data_fetcher.rs b/prover/prover_fri_gateway/src/proof_gen_data_fetcher.rs index 3973ff0eea1d..a2e213a4e24a 100644 --- a/prover/prover_fri_gateway/src/proof_gen_data_fetcher.rs +++ b/prover/prover_fri_gateway/src/proof_gen_data_fetcher.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use prover_dal::ProverDal; +use zksync_prover_dal::ProverDal; use zksync_prover_interface::api::{ ProofGenerationData, ProofGenerationDataRequest, ProofGenerationDataResponse, }; diff --git a/prover/prover_fri_gateway/src/proof_submitter.rs b/prover/prover_fri_gateway/src/proof_submitter.rs index 6ed7b6d5c1db..8b20ab67b516 100644 --- a/prover/prover_fri_gateway/src/proof_submitter.rs +++ b/prover/prover_fri_gateway/src/proof_submitter.rs @@ -1,5 +1,5 @@ use async_trait::async_trait; -use prover_dal::ProverDal; +use zksync_prover_dal::ProverDal; use zksync_prover_interface::api::{SubmitProofRequest, SubmitProofResponse}; use zksync_types::{prover_dal::ProofCompressionJobStatus, L1BatchNumber}; diff --git a/prover/prover_fri_utils/Cargo.toml b/prover/prover_fri_utils/Cargo.toml index c1834c596619..06b3af54cd3b 100644 --- a/prover/prover_fri_utils/Cargo.toml +++ b/prover/prover_fri_utils/Cargo.toml @@ -17,7 +17,7 @@ zksync_object_store.workspace = true zksync_config.workspace = true zksync_types.workspace = true zksync_prover_fri_types.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_utils.workspace = true tracing.workspace = true diff --git a/prover/prover_fri_utils/src/lib.rs b/prover/prover_fri_utils/src/lib.rs index 1a1bfe8bb42d..0873d5056285 100644 --- a/prover/prover_fri_utils/src/lib.rs +++ b/prover/prover_fri_utils/src/lib.rs @@ -1,7 +1,7 @@ use std::time::Instant; -use prover_dal::{Connection, Prover, ProverDal}; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Connection, Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ circuit_definitions::recursion_layer::{ diff --git a/prover/vk_setup_data_generator_server_fri/Cargo.toml b/prover/vk_setup_data_generator_server_fri/Cargo.toml index c1d72cf6ba24..edae9764438f 100644 --- a/prover/vk_setup_data_generator_server_fri/Cargo.toml +++ b/prover/vk_setup_data_generator_server_fri/Cargo.toml @@ -20,7 +20,7 @@ path = "src/lib.rs" [dependencies] -vlog.workspace = true +zksync_vlog.workspace = true zksync_types.workspace = true zksync_utils.workspace = true zksync_prover_fri_types.workspace = true diff --git a/prover/witness_generator/Cargo.toml b/prover/witness_generator/Cargo.toml index 9dc054d23c04..ef79ba92e76d 100644 --- a/prover/witness_generator/Cargo.toml +++ b/prover/witness_generator/Cargo.toml @@ -11,17 +11,17 @@ categories.workspace = true [dependencies] vise.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_dal.workspace = true zksync_config.workspace = true zksync_prover_interface.workspace = true zksync_prover_config.workspace = true zksync_env_config.workspace = true zksync_system_constants.workspace = true -prometheus_exporter.workspace = true -vlog.workspace = true +zksync_prometheus_exporter.workspace = true +zksync_vlog.workspace = true zksync_queued_job_processor.workspace = true -multivm.workspace = true +zksync_multivm.workspace = true zksync_object_store.workspace = true zksync_types.workspace = true zksync_state.workspace = true diff --git a/prover/witness_generator/src/basic_circuits.rs b/prover/witness_generator/src/basic_circuits.rs index 65d3b976c086..af21fe909712 100644 --- a/prover/witness_generator/src/basic_circuits.rs +++ b/prover/witness_generator/src/basic_circuits.rs @@ -12,15 +12,15 @@ use circuit_definitions::{ encodings::recursion_request::RecursionQueueSimulator, zkevm_circuits::fsm_input_output::ClosedFormInputCompactFormWitness, }; -use multivm::vm_latest::{ - constants::MAX_CYCLES_FOR_TX, HistoryDisabled, StorageOracle as VmStorageOracle, -}; -use prover_dal::{ConnectionPool, Prover, ProverDal}; use tracing::Instrument; use zkevm_test_harness::geometry_config::get_geometry_config; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_dal::{Core, CoreDal}; +use zksync_multivm::vm_latest::{ + constants::MAX_CYCLES_FOR_TX, HistoryDisabled, StorageOracle as VmStorageOracle, +}; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::{ diff --git a/prover/witness_generator/src/leaf_aggregation.rs b/prover/witness_generator/src/leaf_aggregation.rs index 2695ec198888..112d07498837 100644 --- a/prover/witness_generator/src/leaf_aggregation.rs +++ b/prover/witness_generator/src/leaf_aggregation.rs @@ -3,7 +3,6 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; use async_trait::async_trait; use circuit_definitions::circuit_definitions::recursion_layer::base_circuit_type_into_recursive_leaf_circuit_type; -use prover_dal::{Prover, ProverDal}; use zkevm_test_harness::{ witness::recursive_aggregation::{compute_leaf_params, create_leaf_witnesses}, zkevm_circuits::scheduler::aux::BaseLayerCircuitType, @@ -11,6 +10,7 @@ use zkevm_test_harness::{ use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_dal::ConnectionPool; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, diff --git a/prover/witness_generator/src/main.rs b/prover/witness_generator/src/main.rs index 6a4cc4fc33eb..ab58fc1115db 100644 --- a/prover/witness_generator/src/main.rs +++ b/prover/witness_generator/src/main.rs @@ -4,14 +4,14 @@ use std::time::{Duration, Instant}; use anyhow::{anyhow, Context as _}; use futures::{channel::mpsc, executor::block_on, SinkExt, StreamExt}; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::{ConnectionPool, Prover, ProverDal}; use structopt::StructOpt; use tokio::sync::watch; use zksync_config::ObjectStoreConfig; use zksync_env_config::{object_store::ProverObjectStoreConfig, FromEnv}; use zksync_object_store::ObjectStoreFactory; +use zksync_prometheus_exporter::PrometheusExporterConfig; use zksync_prover_config::{load_database_secrets, load_general_config}; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_queued_job_processor::JobProcessor; use zksync_types::basic_fri_types::AggregationRound; use zksync_utils::wait_for_tasks::ManagedTasks; @@ -78,12 +78,12 @@ async fn main() -> anyhow::Result<()> { let observability_config = general_config .observability .context("observability config")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url) diff --git a/prover/witness_generator/src/node_aggregation.rs b/prover/witness_generator/src/node_aggregation.rs index 209ae5ef7749..0af59890504d 100644 --- a/prover/witness_generator/src/node_aggregation.rs +++ b/prover/witness_generator/src/node_aggregation.rs @@ -2,13 +2,13 @@ use std::{sync::Arc, time::Instant}; use anyhow::Context as _; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zkevm_test_harness::witness::recursive_aggregation::{ compute_node_vk_commitment, create_node_witnesses, }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_dal::ConnectionPool; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, diff --git a/prover/witness_generator/src/recursion_tip.rs b/prover/witness_generator/src/recursion_tip.rs index a44661d55aaf..b6c9cd7173dd 100644 --- a/prover/witness_generator/src/recursion_tip.rs +++ b/prover/witness_generator/src/recursion_tip.rs @@ -9,7 +9,6 @@ use circuit_definitions::{ }, recursion_layer_proof_config, }; -use prover_dal::{Prover, ProverDal}; use zkevm_test_harness::{ boojum::{ field::{ @@ -39,6 +38,7 @@ use zkevm_test_harness::{ use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_dal::ConnectionPool; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_prover_fri_types::{ get_current_pod_name, keys::{ClosedFormInputKey, FriCircuitKey}, diff --git a/prover/witness_generator/src/scheduler.rs b/prover/witness_generator/src/scheduler.rs index 8585c0c2f2b4..a6173c813586 100644 --- a/prover/witness_generator/src/scheduler.rs +++ b/prover/witness_generator/src/scheduler.rs @@ -2,13 +2,13 @@ use std::{convert::TryInto, sync::Arc, time::Instant}; use anyhow::Context as _; use async_trait::async_trait; -use prover_dal::{Prover, ProverDal}; use zkevm_test_harness::zkevm_circuits::recursion::{ leaf_layer::input::RecursionLeafParametersWitness, NUM_BASE_LAYER_CIRCUITS, }; use zksync_config::configs::FriWitnessGeneratorConfig; use zksync_dal::ConnectionPool; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::{ boojum::{ diff --git a/prover/witness_generator/src/utils.rs b/prover/witness_generator/src/utils.rs index ae8a33519806..a1046f258fc1 100644 --- a/prover/witness_generator/src/utils.rs +++ b/prover/witness_generator/src/utils.rs @@ -7,12 +7,12 @@ use circuit_definitions::circuit_definitions::{ base_layer::ZkSyncBaseLayerCircuit, recursion_layer::{ZkSyncRecursionLayerStorageType, ZkSyncRecursionProof}, }; -use multivm::utils::get_used_bootloader_memory_bytes; use once_cell::sync::Lazy; use zkevm_test_harness::{ boojum::field::goldilocks::GoldilocksField, empty_node_proof, zkevm_circuits::scheduler::aux::BaseLayerCircuitType, }; +use zksync_multivm::utils::get_used_bootloader_memory_bytes; use zksync_object_store::{serialize_using_bincode, Bucket, ObjectStore, StoredObject}; use zksync_prover_fri_types::{ circuit_definitions::{ diff --git a/prover/witness_vector_generator/Cargo.toml b/prover/witness_vector_generator/Cargo.toml index 0bd23270cf6e..f04bc9b9c286 100644 --- a/prover/witness_vector_generator/Cargo.toml +++ b/prover/witness_vector_generator/Cargo.toml @@ -12,17 +12,17 @@ categories.workspace = true [dependencies] vise.workspace = true zksync_types.workspace = true -prover_dal.workspace = true +zksync_prover_dal.workspace = true zksync_config.workspace = true zksync_env_config.workspace = true zksync_object_store.workspace = true zksync_prover_fri_utils.workspace = true zksync_utils.workspace = true -prometheus_exporter.workspace = true +zksync_prometheus_exporter.workspace = true zksync_prover_fri_types.workspace = true zksync_queued_job_processor.workspace = true vk_setup_data_generator_server_fri.workspace = true -vlog.workspace = true +zksync_vlog.workspace = true anyhow.workspace = true tracing.workspace = true diff --git a/prover/witness_vector_generator/src/generator.rs b/prover/witness_vector_generator/src/generator.rs index bc03593e0bfb..b7b9dcd9f763 100644 --- a/prover/witness_vector_generator/src/generator.rs +++ b/prover/witness_vector_generator/src/generator.rs @@ -6,10 +6,10 @@ use std::{ use anyhow::Context as _; use async_trait::async_trait; -use prover_dal::{ConnectionPool, Prover, ProverDal}; use tokio::{task::JoinHandle, time::sleep}; use zksync_config::configs::FriWitnessVectorGeneratorConfig; use zksync_object_store::ObjectStore; +use zksync_prover_dal::{ConnectionPool, Prover, ProverDal}; use zksync_prover_fri_types::{ circuit_definitions::boojum::field::goldilocks::GoldilocksField, CircuitWrapper, ProverJob, WitnessVectorArtifacts, diff --git a/prover/witness_vector_generator/src/main.rs b/prover/witness_vector_generator/src/main.rs index b319c80e4810..1226c3330af0 100644 --- a/prover/witness_vector_generator/src/main.rs +++ b/prover/witness_vector_generator/src/main.rs @@ -3,8 +3,6 @@ use std::time::Duration; use anyhow::Context as _; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::ConnectionPool; use structopt::StructOpt; use tokio::sync::{oneshot, watch}; use zksync_config::configs::{ @@ -13,6 +11,8 @@ use zksync_config::configs::{ }; use zksync_env_config::{object_store::ProverObjectStoreConfig, FromEnv}; use zksync_object_store::ObjectStoreFactory; +use zksync_prometheus_exporter::PrometheusExporterConfig; +use zksync_prover_dal::ConnectionPool; use zksync_prover_fri_types::PROVER_PROTOCOL_SEMANTIC_VERSION; use zksync_prover_fri_utils::{get_all_circuit_id_round_tuples_for, region_fetcher::get_zone}; use zksync_queued_job_processor::JobProcessor; @@ -38,12 +38,12 @@ struct Opt { async fn main() -> anyhow::Result<()> { let observability_config = ObservabilityConfig::from_env().context("ObservabilityConfig::from_env()")?; - let log_format: vlog::LogFormat = observability_config + let log_format: zksync_vlog::LogFormat = observability_config .log_format .parse() .context("Invalid log format")?; - let mut builder = vlog::ObservabilityBuilder::new().with_log_format(log_format); + let mut builder = zksync_vlog::ObservabilityBuilder::new().with_log_format(log_format); if let Some(sentry_url) = &observability_config.sentry_url { builder = builder .with_sentry_url(sentry_url)