diff --git a/.github/workflows/ci-core-reusable.yml b/.github/workflows/ci-core-reusable.yml index b15bc0c41997..d860d79e06ac 100644 --- a/.github/workflows/ci-core-reusable.yml +++ b/.github/workflows/ci-core-reusable.yml @@ -205,7 +205,7 @@ jobs: # `sleep 5` because we need to wait until server started properly - name: Run server run: | - ci_run zk server --use-node-framework --components=$SERVER_COMPONENTS &>server.log & + ci_run zk server --components=$SERVER_COMPONENTS &>server.log & ci_run sleep 5 - name: Run contract verifier diff --git a/.github/workflows/ci-zk-toolbox-reusable.yml b/.github/workflows/ci-zk-toolbox-reusable.yml index f3238566eeec..66e54bfa98a4 100644 --- a/.github/workflows/ci-zk-toolbox-reusable.yml +++ b/.github/workflows/ci-zk-toolbox-reusable.yml @@ -90,7 +90,7 @@ jobs: - name: Run server run: | - ci_run zk_inception server --ignore-prerequisites -a --use-node-framework --verbose &>server.log & + ci_run zk_inception server --ignore-prerequisites -a --verbose &>server.log & ci_run sleep 5 - name: Run integration tests diff --git a/Cargo.lock b/Cargo.lock index 1be8739e881d..b013517e0cc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -96,21 +96,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "allocator-api2" version = "0.2.16" @@ -255,22 +240,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" -[[package]] -name = "async-compression" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" -dependencies = [ - "brotli", - "flate2", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", - "zstd", - "zstd-safe", -] - [[package]] name = "async-lock" version = "3.2.0" @@ -743,27 +712,6 @@ dependencies = [ "syn_derive", ] -[[package]] -name = "brotli" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.14.0" @@ -2619,16 +2567,6 @@ dependencies = [ "hashbrown 0.14.2", ] -[[package]] -name = "hdrhistogram" -version = "7.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" -dependencies = [ - "byteorder", - "num-traits", -] - [[package]] name = "heck" version = "0.3.3" @@ -2972,16 +2910,6 @@ dependencies = [ "serde", ] -[[package]] -name = "iri-string" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21859b667d66a4c1dacd9df0863b3efb65785474255face87f5bca39dd8407c0" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "itertools" version = "0.10.5" @@ -6849,7 +6777,6 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "hdrhistogram", "indexmap 1.9.3", "pin-project", "pin-project-lite", @@ -6868,8 +6795,6 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "async-compression", - "base64 0.21.5", "bitflags 2.4.1", "bytes", "futures-core", @@ -6877,19 +6802,10 @@ dependencies = [ "http", "http-body", "http-range-header", - "httpdate", - "iri-string", - "mime", - "mime_guess", - "percent-encoding", "pin-project-lite", "tokio", - "tokio-util", - "tower", "tower-layer", "tower-service", - "tracing", - "uuid", ] [[package]] @@ -7182,7 +7098,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ - "getrandom", "serde", ] @@ -8335,93 +8250,13 @@ name = "zksync_core_leftovers" version = "0.1.0" dependencies = [ "anyhow", - "assert_matches", - "async-trait", - "axum", - "backon", - "chrono", "ctrlc", - "dashmap", - "futures 0.3.28", - "governor", - "hex", - "itertools 0.10.5", - "jsonrpsee", - "lru", - "multivm", - "once_cell", - "pin-project-lite", - "prometheus_exporter", - "prost 0.12.1", - "prover_dal", - "rand 0.8.5", - "reqwest", - "secrecy", - "serde", - "serde_json", "serde_yaml", - "tempfile", - "test-casing", - "test-log", - "thiserror", - "thread_local", "tokio", - "tower", - "tower-http", - "tracing", - "vise", - "vlog", - "vm_utils", - "zksync_circuit_breaker", - "zksync_commitment_generator", - "zksync_concurrency", "zksync_config", - "zksync_consensus_bft", - "zksync_consensus_crypto", - "zksync_consensus_executor", - "zksync_consensus_network", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_contract_verification_server", - "zksync_contracts", "zksync_dal", - "zksync_db_connection", - "zksync_eth_client", - "zksync_eth_sender", - "zksync_eth_signer", - "zksync_eth_watch", - "zksync_health_check", - "zksync_house_keeper", - "zksync_l1_contract_interface", - "zksync_mempool", - "zksync_merkle_tree", - "zksync_metadata_calculator", - "zksync_mini_merkle_tree", - "zksync_node_api_server", - "zksync_node_consensus", - "zksync_node_fee_model", "zksync_node_genesis", - "zksync_node_sync", - "zksync_node_test_utils", - "zksync_object_store", - "zksync_proof_data_handler", "zksync_protobuf", - "zksync_protobuf_build", - "zksync_protobuf_config", - "zksync_prover_interface", - "zksync_queued_job_processor", - "zksync_shared_metrics", - "zksync_state", - "zksync_state_keeper", - "zksync_storage", - "zksync_system_constants", - "zksync_tee_verifier", - "zksync_tee_verifier_input_producer", - "zksync_test_account", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", ] [[package]] @@ -9500,24 +9335,6 @@ dependencies = [ "zksync_types", ] -[[package]] -name = "zstd" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" -dependencies = [ - "zstd-sys", -] - [[package]] name = "zstd-sys" version = "2.0.9+zstd.1.5.5" diff --git a/core/bin/zksync_server/src/main.rs b/core/bin/zksync_server/src/main.rs index 1c54895863c0..dfb11b55da92 100644 --- a/core/bin/zksync_server/src/main.rs +++ b/core/bin/zksync_server/src/main.rs @@ -1,4 +1,4 @@ -use std::{str::FromStr, time::Duration}; +use std::str::FromStr; use anyhow::Context as _; use clap::Parser; @@ -20,14 +20,12 @@ use zksync_config::{ GenesisConfig, ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, }; use zksync_core_leftovers::{ - genesis_init, initialize_components, is_genesis_needed, setup_sigint_handler, + genesis_init, is_genesis_needed, temp_config_store::{decode_yaml_repr, TempConfigStore}, Component, Components, }; use zksync_env_config::FromEnv; use zksync_eth_client::clients::Client; -use zksync_storage::RocksDB; -use zksync_utils::wait_for_tasks::ManagedTasks; use crate::node_builder::MainNodeBuilder; @@ -67,7 +65,8 @@ struct Cli { /// Path to the yaml with genesis. If set, it will be used instead of env vars. #[arg(long)] genesis_path: Option, - /// Run the node using the node framework. + /// Used to enable node framework. + /// Now the node framework is used by default and this argument is left for backward compatibility. #[arg(long)] use_node_framework: bool, } @@ -88,8 +87,7 @@ impl FromStr for ComponentsToRun { } } -#[tokio::main] -async fn main() -> anyhow::Result<()> { +fn main() -> anyhow::Result<()> { let opt = Cli::parse(); // Load env config and use it if file config is not provided @@ -181,32 +179,10 @@ async fn main() -> anyhow::Result<()> { } }; - let database_secrets = secrets.database.clone().context("DatabaseSecrets")?; - - if opt.genesis || is_genesis_needed(&database_secrets).await { - genesis_init(genesis.clone(), &database_secrets) - .await - .context("genesis_init")?; - - if let Some(ecosystem_contracts) = &contracts_config.ecosystem_contracts { - let l1_secrets = secrets.l1.as_ref().context("l1_screts")?; - let query_client = Client::http(l1_secrets.l1_rpc_url.clone()) - .context("Ethereum client")? - .for_network(genesis.l1_chain_id.into()) - .build(); - zksync_node_genesis::save_set_chain_id_tx( - &query_client, - contracts_config.diamond_proxy_addr, - ecosystem_contracts.state_transition_proxy_addr, - &database_secrets, - ) - .await - .context("Failed to save SetChainId upgrade transaction")?; - } - - if opt.genesis { - return Ok(()); - } + run_genesis_if_needed(opt.genesis, &genesis, &contracts_config, &secrets)?; + if opt.genesis { + // If genesis is requested, we don't need to run the node. + return Ok(()); } let components = if opt.rebuild_tree { @@ -215,69 +191,55 @@ async fn main() -> anyhow::Result<()> { opt.components.0 }; - // If the node framework is used, run the node. - if opt.use_node_framework { - // We run the node from a different thread, since the current thread is in tokio context. - std::thread::spawn(move || -> anyhow::Result<()> { - let node = MainNodeBuilder::new( - configs, - wallets, - genesis, - contracts_config, - secrets, - consensus, - ) - .build(components)?; - node.run()?; - Ok(()) - }) - .join() - .expect("Failed to run the node")?; - - return Ok(()); - } - - // Run core actors. - let sigint_receiver = setup_sigint_handler(); - let (core_task_handles, stop_sender, health_check_handle) = initialize_components( - &configs, - &wallets, - &genesis, - &contracts_config, - &components, - &secrets, + let node = MainNodeBuilder::new( + configs, + wallets, + genesis, + contracts_config, + secrets, consensus, ) - .await - .context("Unable to start Core actors")?; - - tracing::info!("Running {} core task handlers", core_task_handles.len()); - - let mut tasks = ManagedTasks::new(core_task_handles); - tokio::select! { - _ = tasks.wait_single() => {}, - _ = sigint_receiver => { - tracing::info!("Stop signal received, shutting down"); - }, - } - - stop_sender.send(true).ok(); - tokio::task::spawn_blocking(RocksDB::await_rocksdb_termination) - .await - .context("error waiting for RocksDB instances to drop")?; - let complete_timeout = - if components.contains(&Component::HttpApi) || components.contains(&Component::WsApi) { - // Increase timeout because of complicated graceful shutdown procedure for API servers. - Duration::from_secs(30) - } else { - Duration::from_secs(5) - }; - tasks.complete(complete_timeout).await; - health_check_handle.stop().await; - tracing::info!("Stopped"); + .build(components)?; + node.run()?; Ok(()) } +fn run_genesis_if_needed( + force_genesis: bool, + genesis: &GenesisConfig, + contracts_config: &ContractsConfig, + secrets: &Secrets, +) -> anyhow::Result<()> { + let tokio_runtime = tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build()?; + tokio_runtime.block_on(async move { + let database_secrets = secrets.database.clone().context("DatabaseSecrets")?; + if force_genesis || is_genesis_needed(&database_secrets).await { + genesis_init(genesis.clone(), &database_secrets) + .await + .context("genesis_init")?; + + if let Some(ecosystem_contracts) = &contracts_config.ecosystem_contracts { + let l1_secrets = secrets.l1.as_ref().context("l1_screts")?; + let query_client = Client::http(l1_secrets.l1_rpc_url.clone()) + .context("Ethereum client")? + .for_network(genesis.l1_chain_id.into()) + .build(); + zksync_node_genesis::save_set_chain_id_tx( + &query_client, + contracts_config.diamond_proxy_addr, + ecosystem_contracts.state_transition_proxy_addr, + &database_secrets, + ) + .await + .context("Failed to save SetChainId upgrade transaction")?; + } + } + Ok(()) + }) +} + fn load_env_config() -> anyhow::Result { Ok(TempConfigStore { postgres_config: PostgresConfig::from_env().ok(), diff --git a/core/lib/zksync_core_leftovers/Cargo.toml b/core/lib/zksync_core_leftovers/Cargo.toml index c394342c6996..83e22fc6a5eb 100644 --- a/core/lib/zksync_core_leftovers/Cargo.toml +++ b/core/lib/zksync_core_leftovers/Cargo.toml @@ -10,106 +10,12 @@ keywords.workspace = true categories.workspace = true [dependencies] -vise.workspace = true -zksync_state.workspace = true -vm_utils.workspace = true -zksync_types.workspace = true zksync_dal.workspace = true -prover_dal.workspace = true -zksync_db_connection.workspace = true zksync_config.workspace = true -zksync_protobuf_config.workspace = true -zksync_utils.workspace = true -zksync_contracts.workspace = true -zksync_system_constants.workspace = true -zksync_eth_client.workspace = true -zksync_eth_signer.workspace = true -zksync_l1_contract_interface.workspace = true -zksync_mempool.workspace = true -zksync_circuit_breaker.workspace = true -zksync_storage.workspace = true -zksync_tee_verifier.workspace = true -zksync_merkle_tree.workspace = true -zksync_mini_merkle_tree.workspace = true -prometheus_exporter.workspace = true -zksync_prover_interface.workspace = true -zksync_queued_job_processor.workspace = true -zksync_web3_decl = { workspace = true, features = ["server"] } -zksync_object_store.workspace = true -zksync_health_check.workspace = true -vlog.workspace = true -zksync_eth_watch.workspace = true -zksync_shared_metrics.workspace = true -zksync_proof_data_handler.workspace = true -zksync_commitment_generator.workspace = true -zksync_house_keeper.workspace = true -zksync_node_genesis.workspace = true -zksync_eth_sender.workspace = true -zksync_node_fee_model.workspace = true -zksync_state_keeper.workspace = true -zksync_metadata_calculator.workspace = true -zksync_node_sync.workspace = true -zksync_node_consensus.workspace = true -zksync_contract_verification_server.workspace = true -zksync_node_api_server.workspace = true -zksync_tee_verifier_input_producer.workspace = true -multivm.workspace = true - -# Consensus dependenices -zksync_concurrency.workspace = true -zksync_consensus_crypto.workspace = true -zksync_consensus_network.workspace = true -zksync_consensus_roles.workspace = true -zksync_consensus_storage.workspace = true -zksync_consensus_executor.workspace = true -zksync_consensus_bft.workspace = true -zksync_consensus_utils.workspace = true zksync_protobuf.workspace = true +zksync_node_genesis.workspace = true -prost.workspace = true -secrecy.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_json.workspace = true +anyhow.workspace = true +tokio = { workspace = true, features = ["time"] } serde_yaml.workspace = true -itertools.workspace = true ctrlc.workspace = true -rand.workspace = true - -tokio = { workspace = true, features = ["time"] } -futures = { workspace = true, features = ["compat"] } -pin-project-lite.workspace = true -chrono = { workspace = true, features = ["serde"] } -anyhow.workspace = true -thiserror.workspace = true -async-trait.workspace = true -thread_local.workspace = true - -reqwest = { workspace = true, features = ["blocking", "json"] } -hex.workspace = true -lru.workspace = true -governor.workspace = true -tower-http = { workspace = true, features = ["full"] } -tower = { workspace = true, features = ["full"] } -axum = { workspace = true, features = [ - "http1", - "json", - "tokio", -] } -once_cell.workspace = true -dashmap.workspace = true - -tracing.workspace = true - -[dev-dependencies] -zksync_test_account.workspace = true -zksync_node_test_utils.workspace = true - -assert_matches.workspace = true -jsonrpsee.workspace = true -tempfile.workspace = true -test-casing.workspace = true -test-log.workspace = true -backon.workspace = true - -[build-dependencies] -zksync_protobuf_build.workspace = true diff --git a/core/lib/zksync_core_leftovers/src/lib.rs b/core/lib/zksync_core_leftovers/src/lib.rs index b4194f99f450..8e85bad9cc33 100644 --- a/core/lib/zksync_core_leftovers/src/lib.rs +++ b/core/lib/zksync_core_leftovers/src/lib.rs @@ -1,80 +1,12 @@ #![allow(clippy::upper_case_acronyms, clippy::derive_partial_eq_without_eq)] -use std::{ - net::Ipv4Addr, - str::FromStr, - sync::Arc, - time::{Duration, Instant}, -}; +use std::str::FromStr; use anyhow::Context as _; -use prometheus_exporter::PrometheusExporterConfig; -use prover_dal::Prover; -use tokio::{ - sync::{oneshot, watch}, - task::JoinHandle, -}; -use zksync_circuit_breaker::{ - l1_txs::FailedL1TransactionChecker, replication_lag::ReplicationLagChecker, - CircuitBreakerChecker, CircuitBreakers, -}; -use zksync_commitment_generator::{ - validation_task::L1BatchCommitmentModeValidationTask, CommitmentGenerator, -}; -use zksync_concurrency::{ctx, scope}; -use zksync_config::{ - configs::{ - api::{MerkleTreeApiConfig, Web3JsonRpcConfig}, - chain::{CircuitBreakerConfig, MempoolConfig, OperationsManagerConfig, StateKeeperConfig}, - consensus::ConsensusConfig, - database::{MerkleTreeConfig, MerkleTreeMode}, - wallets, - wallets::Wallets, - ContractsConfig, DatabaseSecrets, GeneralConfig, Secrets, - }, - ApiConfig, DBConfig, EthWatchConfig, GenesisConfig, -}; -use zksync_contracts::governance_contract; -use zksync_dal::{metrics::PostgresMetrics, ConnectionPool, Core, CoreDal}; -use zksync_db_connection::healthcheck::ConnectionPoolHealthCheck; -use zksync_eth_client::{clients::PKSigningClient, BoundEthInterface}; -use zksync_eth_sender::{Aggregator, EthTxAggregator, EthTxManager}; -use zksync_eth_watch::{EthHttpQueryClient, EthWatch}; -use zksync_health_check::{AppHealthCheck, HealthStatus, ReactiveHealthCheck}; -use zksync_house_keeper::{ - blocks_state_reporter::L1BatchMetricsReporter, - periodic_job::PeriodicJob, - prover::{ - FriGpuProverArchiver, FriProofCompressorJobRetryManager, FriProofCompressorQueueReporter, - FriProverJobRetryManager, FriProverJobsArchiver, FriProverQueueReporter, - FriWitnessGeneratorJobRetryManager, FriWitnessGeneratorQueueReporter, - WaitingToQueuedFriWitnessJobMover, - }, -}; -use zksync_metadata_calculator::{ - api_server::TreeApiHttpClient, MetadataCalculator, MetadataCalculatorConfig, -}; -use zksync_node_api_server::{ - healthcheck::HealthCheckHandle, - tx_sender::{build_tx_sender, TxSenderConfig}, - web3::{self, mempool_cache::MempoolCache, state::InternalApiConfig, Namespace}, -}; -use zksync_node_fee_model::{ - l1_gas_price::GasAdjusterSingleton, BatchFeeModelInputProvider, MainNodeFeeInputProvider, -}; +use tokio::sync::oneshot; +use zksync_config::{configs::DatabaseSecrets, GenesisConfig}; +use zksync_dal::{ConnectionPool, Core, CoreDal as _}; use zksync_node_genesis::{ensure_genesis_state, GenesisParams}; -use zksync_object_store::{ObjectStore, ObjectStoreFactory}; -use zksync_queued_job_processor::JobProcessor; -use zksync_shared_metrics::{InitStage, APP_METRICS}; -use zksync_state::{PostgresStorageCaches, RocksdbStorageOptions}; -use zksync_state_keeper::{ - create_state_keeper, io::seal_logic::l2_block_seal_subtasks::L2BlockSealProcess, - AsyncRocksdbCache, MempoolFetcher, MempoolGuard, OutputHandler, StateKeeperPersistence, - TreeWritesPersistence, -}; -use zksync_tee_verifier_input_producer::TeeVerifierInputProducer; -use zksync_types::{ethabi::Contract, fee_model::FeeModelConfig, Address, L2ChainId}; -use zksync_web3_decl::client::{Client, DynClient, L1}; pub mod temp_config_store; @@ -199,1203 +131,3 @@ impl FromStr for Components { } } } - -pub async fn initialize_components( - configs: &GeneralConfig, - wallets: &Wallets, - genesis_config: &GenesisConfig, - contracts_config: &ContractsConfig, - components: &[Component], - secrets: &Secrets, - consensus_config: Option, -) -> anyhow::Result<( - Vec>>, - watch::Sender, - HealthCheckHandle, -)> { - tracing::info!("Starting the components: {components:?}"); - let l2_chain_id = genesis_config.l2_chain_id; - let db_config = configs.db_config.clone().context("db_config")?; - let postgres_config = configs.postgres_config.clone().context("postgres_config")?; - let database_secrets = secrets.database.clone().context("database_secrets")?; - - if let Some(threshold) = postgres_config.slow_query_threshold() { - ConnectionPool::::global_config().set_slow_query_threshold(threshold)?; - } - if let Some(threshold) = postgres_config.long_connection_threshold() { - ConnectionPool::::global_config().set_long_connection_threshold(threshold)?; - } - - let pool_size = postgres_config.max_connections()?; - let pool_size_master = postgres_config - .max_connections_master() - .unwrap_or(pool_size); - - let connection_pool = - ConnectionPool::::builder(database_secrets.master_url()?, pool_size_master) - .build() - .await - .context("failed to build connection_pool")?; - // We're most interested in setting acquire / statement timeouts for the API server, which puts the most load - // on Postgres. - let replica_connection_pool = - ConnectionPool::::builder(database_secrets.replica_url()?, pool_size) - .set_acquire_timeout(postgres_config.acquire_timeout()) - .set_statement_timeout(postgres_config.statement_timeout()) - .build() - .await - .context("failed to build replica_connection_pool")?; - - let health_check_config = configs - .api_config - .clone() - .context("api_config")? - .healthcheck; - - let app_health = Arc::new(AppHealthCheck::new( - health_check_config.slow_time_limit(), - health_check_config.hard_time_limit(), - )); - - let eth = configs.eth.clone().context("eth")?; - let l1_secrets = secrets.l1.clone().context("l1_secrets")?; - let circuit_breaker_config = configs - .circuit_breaker_config - .clone() - .context("circuit_breaker_config")?; - - let circuit_breaker_checker = CircuitBreakerChecker::new( - Arc::new( - circuit_breakers_for_components(components, &database_secrets, &circuit_breaker_config) - .await - .context("circuit_breakers_for_components")?, - ), - circuit_breaker_config.sync_interval(), - ); - circuit_breaker_checker.check().await.unwrap_or_else(|err| { - panic!("Circuit breaker triggered: {}", err); - }); - - let query_client = Client::http(l1_secrets.l1_rpc_url.clone()) - .context("Ethereum client")? - .for_network(genesis_config.l1_chain_id.into()) - .build(); - let query_client = Box::new(query_client); - let gas_adjuster_config = eth.gas_adjuster.context("gas_adjuster")?; - let sender = eth.sender.as_ref().context("sender")?; - - let mut gas_adjuster = GasAdjusterSingleton::new( - genesis_config.l1_chain_id, - l1_secrets.l1_rpc_url.clone(), - gas_adjuster_config, - sender.pubdata_sending_mode, - genesis_config.l1_batch_commit_data_generator_mode, - ); - - let (stop_sender, stop_receiver) = watch::channel(false); - - // Prometheus exporter and circuit breaker checker should run for every component configuration. - let prom_config = configs - .prometheus_config - .clone() - .context("prometheus_config")?; - let prom_config = PrometheusExporterConfig::pull(prom_config.listener_port); - - let (prometheus_health_check, prometheus_health_updater) = - ReactiveHealthCheck::new("prometheus_exporter"); - app_health.insert_component(prometheus_health_check)?; - let prometheus_task = prom_config.run(stop_receiver.clone()); - let prometheus_task = tokio::spawn(async move { - prometheus_health_updater.update(HealthStatus::Ready.into()); - let res = prometheus_task.await; - drop(prometheus_health_updater); - res - }); - - let mut task_futures: Vec>> = vec![ - prometheus_task, - tokio::spawn(circuit_breaker_checker.run(stop_receiver.clone())), - ]; - - if components.contains(&Component::WsApi) - || components.contains(&Component::HttpApi) - || components.contains(&Component::ContractVerificationApi) - { - let api_config = configs.api_config.clone().context("api_config")?; - let state_keeper_config = configs - .state_keeper_config - .clone() - .context("state_keeper_config")?; - let tx_sender_config = TxSenderConfig::new( - &state_keeper_config, - &api_config.web3_json_rpc, - wallets - .state_keeper - .clone() - .context("Fee account")? - .fee_account - .address(), - l2_chain_id, - ); - let internal_api_config = - InternalApiConfig::new(&api_config.web3_json_rpc, contracts_config, genesis_config); - - // Lazily initialize storage caches only when they are needed (e.g., skip their initialization - // if we only run the explorer APIs). This is required because the cache update task will - // terminate immediately if storage caches are dropped, which will lead to the (unexpected) - // program termination. - let mut storage_caches = None; - - let mempool_cache = MempoolCache::new(api_config.web3_json_rpc.mempool_cache_size()); - let mempool_cache_update_task = mempool_cache.update_task( - connection_pool.clone(), - api_config.web3_json_rpc.mempool_cache_update_interval(), - ); - task_futures.push(tokio::spawn( - mempool_cache_update_task.run(stop_receiver.clone()), - )); - - if components.contains(&Component::HttpApi) { - storage_caches = Some( - build_storage_caches( - &api_config.web3_json_rpc, - &replica_connection_pool, - &mut task_futures, - stop_receiver.clone(), - ) - .context("build_storage_caches()")?, - ); - - let started_at = Instant::now(); - tracing::info!("Initializing HTTP API"); - let bounded_gas_adjuster = gas_adjuster - .get_or_init() - .await - .context("gas_adjuster.get_or_init()")?; - let batch_fee_input_provider = Arc::new(MainNodeFeeInputProvider::new( - bounded_gas_adjuster, - FeeModelConfig::from_state_keeper_config(&state_keeper_config), - )); - run_http_api( - &mut task_futures, - &app_health, - &database_secrets, - &tx_sender_config, - &state_keeper_config, - &internal_api_config, - &api_config, - connection_pool.clone(), - replica_connection_pool.clone(), - stop_receiver.clone(), - batch_fee_input_provider, - state_keeper_config.save_call_traces, - storage_caches.clone().unwrap(), - mempool_cache.clone(), - ) - .await - .context("run_http_api")?; - - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::HttpApi].set(elapsed); - tracing::info!( - "Initialized HTTP API on port {:?} in {elapsed:?}", - api_config.web3_json_rpc.http_port - ); - } - - if components.contains(&Component::WsApi) { - let storage_caches = match storage_caches { - Some(storage_caches) => storage_caches, - None => build_storage_caches( - &configs.api_config.clone().context("api")?.web3_json_rpc, - &replica_connection_pool, - &mut task_futures, - stop_receiver.clone(), - ) - .context("build_storage_caches()")?, - }; - - let started_at = Instant::now(); - tracing::info!("initializing WS API"); - let bounded_gas_adjuster = gas_adjuster - .get_or_init() - .await - .context("gas_adjuster.get_or_init()")?; - let batch_fee_input_provider = Arc::new(MainNodeFeeInputProvider::new( - bounded_gas_adjuster, - FeeModelConfig::from_state_keeper_config(&state_keeper_config), - )); - run_ws_api( - &mut task_futures, - &app_health, - &database_secrets, - &tx_sender_config, - &state_keeper_config, - &internal_api_config, - &api_config, - batch_fee_input_provider, - connection_pool.clone(), - replica_connection_pool.clone(), - stop_receiver.clone(), - storage_caches, - mempool_cache, - ) - .await - .context("run_ws_api")?; - - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::WsApi].set(elapsed); - tracing::info!( - "Initialized WS API on port {} in {elapsed:?}", - api_config.web3_json_rpc.ws_port - ); - } - - if components.contains(&Component::ContractVerificationApi) { - let started_at = Instant::now(); - tracing::info!("initializing contract verification REST API"); - task_futures.push(tokio::spawn( - zksync_contract_verification_server::start_server( - connection_pool.clone(), - replica_connection_pool.clone(), - configs - .contract_verifier - .clone() - .context("Contract verifier")?, - stop_receiver.clone(), - ), - )); - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::ContractVerificationApi].set(elapsed); - tracing::info!("initialized contract verification REST API in {elapsed:?}"); - } - } - - let object_store_config = configs - .core_object_store - .clone() - .context("core_object_store_config")?; - let store_factory = ObjectStoreFactory::new(object_store_config); - - if components.contains(&Component::StateKeeper) { - let started_at = Instant::now(); - tracing::info!("initializing State Keeper"); - let bounded_gas_adjuster = gas_adjuster - .get_or_init() - .await - .context("gas_adjuster.get_or_init()")?; - let state_keeper_config = configs - .state_keeper_config - .clone() - .context("state_keeper_config")?; - let batch_fee_input_provider = Arc::new(MainNodeFeeInputProvider::new( - bounded_gas_adjuster, - FeeModelConfig::from_state_keeper_config(&state_keeper_config), - )); - add_state_keeper_to_task_futures( - &mut task_futures, - &database_secrets, - contracts_config, - state_keeper_config, - wallets - .state_keeper - .clone() - .context("State keeper wallets")?, - l2_chain_id, - &db_config, - &configs.mempool_config.clone().context("mempool_config")?, - batch_fee_input_provider, - stop_receiver.clone(), - ) - .await - .context("add_state_keeper_to_task_futures()")?; - - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::StateKeeper].set(elapsed); - tracing::info!("initialized State Keeper in {elapsed:?}"); - } - - let diamond_proxy_addr = contracts_config.diamond_proxy_addr; - let state_transition_manager_addr = contracts_config - .ecosystem_contracts - .as_ref() - .map(|a| a.state_transition_proxy_addr); - - if components.contains(&Component::Consensus) { - let cfg = consensus_config - .clone() - .context("consensus component's config is missing")?; - let secrets = secrets - .consensus - .clone() - .context("consensus component's secrets are missing")?; - let started_at = Instant::now(); - tracing::info!("initializing Consensus"); - let pool = connection_pool.clone(); - let mut stop_receiver = stop_receiver.clone(); - task_futures.push(tokio::spawn(async move { - // We instantiate the root context here, since the consensus task is the only user of the - // structured concurrency framework. - // Note, however, that awaiting for the `stop_receiver` is related to the root context behavior, - // not the consensus task itself. There may have been any number of tasks running in the root context, - // but we only need to wait for stop signal once, and it will be propagated to all child contexts. - let root_ctx = ctx::root(); - scope::run!(&root_ctx, |ctx, s| async move { - s.spawn_bg(zksync_node_consensus::era::run_main_node( - ctx, cfg, secrets, pool, - )); - let _ = stop_receiver.wait_for(|stop| *stop).await?; - Ok(()) - }) - .await - })); - - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::Consensus].set(elapsed); - tracing::info!("initialized Consensus in {elapsed:?}"); - } - - if components.contains(&Component::EthWatcher) { - let started_at = Instant::now(); - tracing::info!("initializing ETH-Watcher"); - let eth_watch_pool = ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build eth_watch_pool")?; - let governance = (governance_contract(), contracts_config.governance_addr); - let eth_watch_config = configs - .eth - .clone() - .context("eth_config")? - .watcher - .context("watcher")?; - task_futures.push( - start_eth_watch( - eth_watch_config, - eth_watch_pool, - query_client.clone(), - diamond_proxy_addr, - state_transition_manager_addr, - governance, - stop_receiver.clone(), - ) - .await - .context("start_eth_watch()")?, - ); - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::EthWatcher].set(elapsed); - tracing::info!("initialized ETH-Watcher in {elapsed:?}"); - } - - if components.contains(&Component::EthTxAggregator) { - let started_at = Instant::now(); - tracing::info!("initializing ETH-TxAggregator"); - let eth_sender_pool = ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build eth_sender_pool")?; - - let eth_sender_wallets = wallets.eth_sender.clone().context("eth_sender")?; - let operator_private_key = eth_sender_wallets.operator.private_key(); - let diamond_proxy_addr = contracts_config.diamond_proxy_addr; - let default_priority_fee_per_gas = eth - .gas_adjuster - .as_ref() - .context("gas_adjuster")? - .default_priority_fee_per_gas; - let l1_chain_id = genesis_config.l1_chain_id; - - let eth_client = PKSigningClient::new_raw( - operator_private_key.clone(), - diamond_proxy_addr, - default_priority_fee_per_gas, - l1_chain_id, - query_client.clone(), - ); - - let l1_batch_commit_data_generator_mode = - genesis_config.l1_batch_commit_data_generator_mode; - // Run the task synchronously: the main node is expected to have a stable Ethereum client connection, - // and the cost of detecting an incorrect mode with a delay is higher. - L1BatchCommitmentModeValidationTask::new( - contracts_config.diamond_proxy_addr, - l1_batch_commit_data_generator_mode, - query_client.clone(), - ) - .exit_on_success() - .run(stop_receiver.clone()) - .await?; - - let operator_blobs_address = eth_sender_wallets.blob_operator.map(|x| x.address()); - - let sender_config = eth.sender.clone().context("eth_sender")?; - let eth_tx_aggregator_actor = EthTxAggregator::new( - eth_sender_pool, - sender_config.clone(), - Aggregator::new( - sender_config.clone(), - store_factory.create_store().await?, - operator_blobs_address.is_some(), - l1_batch_commit_data_generator_mode, - ), - Box::new(eth_client), - contracts_config.validator_timelock_addr, - contracts_config.l1_multicall3_addr, - diamond_proxy_addr, - l2_chain_id, - operator_blobs_address, - ) - .await; - task_futures.push(tokio::spawn( - eth_tx_aggregator_actor.run(stop_receiver.clone()), - )); - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::EthTxAggregator].set(elapsed); - tracing::info!("initialized ETH-TxAggregator in {elapsed:?}"); - } - - if components.contains(&Component::EthTxManager) { - let started_at = Instant::now(); - tracing::info!("initializing ETH-TxManager"); - let eth_manager_pool = ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build eth_manager_pool")?; - let eth_sender = configs.eth.clone().context("eth_sender_config")?; - let eth_sender_wallets = wallets.eth_sender.clone().context("eth_sender")?; - let operator_private_key = eth_sender_wallets.operator.private_key(); - let diamond_proxy_addr = contracts_config.diamond_proxy_addr; - let default_priority_fee_per_gas = eth - .gas_adjuster - .as_ref() - .context("gas_adjuster")? - .default_priority_fee_per_gas; - let l1_chain_id = genesis_config.l1_chain_id; - - let eth_client = PKSigningClient::new_raw( - operator_private_key.clone(), - diamond_proxy_addr, - default_priority_fee_per_gas, - l1_chain_id, - query_client.clone(), - ); - - let eth_client_blobs = if let Some(blob_operator) = eth_sender_wallets.blob_operator { - let operator_blob_private_key = blob_operator.private_key().clone(); - let client = Box::new(PKSigningClient::new_raw( - operator_blob_private_key, - diamond_proxy_addr, - default_priority_fee_per_gas, - l1_chain_id, - query_client, - )); - Some(client as Box) - } else { - None - }; - - let eth_tx_manager_actor = EthTxManager::new( - eth_manager_pool, - eth_sender.sender.clone().context("eth_sender")?, - gas_adjuster - .get_or_init() - .await - .context("gas_adjuster.get_or_init()")?, - Box::new(eth_client), - eth_client_blobs, - ); - task_futures.extend([tokio::spawn( - eth_tx_manager_actor.run(stop_receiver.clone()), - )]); - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::EthTxManager].set(elapsed); - tracing::info!("initialized ETH-TxManager in {elapsed:?}"); - } - - add_trees_to_task_futures( - configs, - secrets, - &mut task_futures, - &app_health, - components, - &store_factory, - stop_receiver.clone(), - ) - .await - .context("add_trees_to_task_futures()")?; - - if components.contains(&Component::TeeVerifierInputProducer) { - let singleton_connection_pool = - ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build singleton connection_pool")?; - add_tee_verifier_input_producer_to_task_futures( - &mut task_futures, - &singleton_connection_pool, - &store_factory, - l2_chain_id, - stop_receiver.clone(), - ) - .await - .context("add_tee_verifier_input_producer_to_task_futures()")?; - } - - if components.contains(&Component::Housekeeper) { - add_house_keeper_to_task_futures( - configs, - secrets, - &mut task_futures, - stop_receiver.clone(), - ) - .await - .context("add_house_keeper_to_task_futures()")?; - } - - if components.contains(&Component::ProofDataHandler) { - task_futures.push(tokio::spawn(zksync_proof_data_handler::run_server( - configs - .proof_data_handler_config - .clone() - .context("proof_data_handler_config")?, - store_factory.create_store().await?, - connection_pool.clone(), - genesis_config.l1_batch_commit_data_generator_mode, - stop_receiver.clone(), - ))); - } - - if components.contains(&Component::CommitmentGenerator) { - let pool_size = CommitmentGenerator::default_parallelism().get(); - let commitment_generator_pool = - ConnectionPool::::builder(database_secrets.master_url()?, pool_size) - .build() - .await - .context("failed to build commitment_generator_pool")?; - let commitment_generator = CommitmentGenerator::new( - commitment_generator_pool, - genesis_config.l1_batch_commit_data_generator_mode, - ); - app_health.insert_component(commitment_generator.health_check())?; - task_futures.push(tokio::spawn( - commitment_generator.run(stop_receiver.clone()), - )); - } - - // Run healthcheck server for all components. - let db_health_check = ConnectionPoolHealthCheck::new(replica_connection_pool); - app_health.insert_custom_component(Arc::new(db_health_check))?; - let health_check_handle = - HealthCheckHandle::spawn_server(health_check_config.bind_addr(), app_health); - - if let Some(task) = gas_adjuster.run_if_initialized(stop_receiver.clone()) { - task_futures.push(task); - } - - Ok((task_futures, stop_sender, health_check_handle)) -} - -#[allow(clippy::too_many_arguments)] -async fn add_state_keeper_to_task_futures( - task_futures: &mut Vec>>, - database_secrets: &DatabaseSecrets, - contracts_config: &ContractsConfig, - state_keeper_config: StateKeeperConfig, - state_keeper_wallets: wallets::StateKeeper, - l2chain_id: L2ChainId, - db_config: &DBConfig, - mempool_config: &MempoolConfig, - batch_fee_input_provider: Arc, - stop_receiver: watch::Receiver, -) -> anyhow::Result<()> { - let state_keeper_pool = ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build state_keeper_pool")?; - let mempool = { - let mut storage = state_keeper_pool - .connection() - .await - .context("Access storage to build mempool")?; - let mempool = MempoolGuard::from_storage(&mut storage, mempool_config.capacity).await; - mempool.register_metrics(); - mempool - }; - - // L2 Block sealing process is parallelized, so we have to provide enough pooled connections. - let persistence_pool = ConnectionPool::::builder( - database_secrets.master_url()?, - L2BlockSealProcess::subtasks_len(), - ) - .build() - .await - .context("failed to build l2_block_sealer_pool")?; - let (persistence, l2_block_sealer) = StateKeeperPersistence::new( - persistence_pool.clone(), - contracts_config - .l2_shared_bridge_addr - .context("`l2_shared_bridge_addr` config is missing")?, - state_keeper_config.l2_block_seal_queue_capacity, - ); - task_futures.push(tokio::spawn(l2_block_sealer.run())); - - // One (potentially held long-term) connection for `AsyncCatchupTask` and another connection - // to access `AsyncRocksdbCache` as a storage. - let async_cache_pool = ConnectionPool::::builder(database_secrets.master_url()?, 2) - .build() - .await - .context("failed to build async_cache_pool")?; - let cache_options = RocksdbStorageOptions { - block_cache_capacity: db_config - .experimental - .state_keeper_db_block_cache_capacity(), - max_open_files: db_config.experimental.state_keeper_db_max_open_files, - }; - let (async_cache, async_catchup_task) = AsyncRocksdbCache::new( - async_cache_pool, - db_config.state_keeper_db_path.clone(), - cache_options, - ); - - let tree_writes_persistence = TreeWritesPersistence::new(persistence_pool); - let output_handler = - OutputHandler::new(Box::new(persistence)).with_handler(Box::new(tree_writes_persistence)); - let state_keeper = create_state_keeper( - state_keeper_config, - state_keeper_wallets, - async_cache, - l2chain_id, - mempool_config, - state_keeper_pool, - mempool.clone(), - batch_fee_input_provider.clone(), - output_handler, - stop_receiver.clone(), - ) - .await; - - let mut stop_receiver_clone = stop_receiver.clone(); - task_futures.push(tokio::task::spawn(async move { - let result = async_catchup_task.run(stop_receiver_clone.clone()).await; - stop_receiver_clone.changed().await?; - result - })); - task_futures.push(tokio::spawn(state_keeper.run())); - - let mempool_fetcher_pool = ConnectionPool::::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build mempool_fetcher_pool")?; - let mempool_fetcher = MempoolFetcher::new( - mempool, - batch_fee_input_provider, - mempool_config, - mempool_fetcher_pool, - ); - let mempool_fetcher_handle = tokio::spawn(mempool_fetcher.run(stop_receiver)); - task_futures.push(mempool_fetcher_handle); - Ok(()) -} - -pub async fn start_eth_watch( - config: EthWatchConfig, - pool: ConnectionPool, - eth_gateway: Box>, - diamond_proxy_addr: Address, - state_transition_manager_addr: Option
, - governance: (Contract, Address), - stop_receiver: watch::Receiver, -) -> anyhow::Result>> { - let eth_client = EthHttpQueryClient::new( - eth_gateway, - diamond_proxy_addr, - state_transition_manager_addr, - governance.1, - config.confirmations_for_eth_event, - ); - - let eth_watch = EthWatch::new( - diamond_proxy_addr, - &governance.0, - Box::new(eth_client), - pool, - config.poll_interval(), - ) - .await?; - - Ok(tokio::spawn(eth_watch.run(stop_receiver))) -} - -async fn add_trees_to_task_futures( - configs: &GeneralConfig, - secrets: &Secrets, - task_futures: &mut Vec>>, - app_health: &AppHealthCheck, - components: &[Component], - store_factory: &ObjectStoreFactory, - stop_receiver: watch::Receiver, -) -> anyhow::Result<()> { - if !components.contains(&Component::Tree) { - anyhow::ensure!( - !components.contains(&Component::TreeApi), - "Merkle tree API cannot be started without a tree component" - ); - return Ok(()); - } - - let db_config = configs.db_config.clone().context("db_config")?; - let database_secrets = secrets.database.clone().context("database_secrets")?; - let operation_config = configs - .operations_manager_config - .clone() - .context("operations_manager_config")?; - let api_config = configs - .api_config - .clone() - .context("api_config")? - .merkle_tree; - let api_config = components - .contains(&Component::TreeApi) - .then_some(&api_config); - - let object_store = match db_config.merkle_tree.mode { - MerkleTreeMode::Lightweight => None, - MerkleTreeMode::Full => Some(store_factory.create_store().await?), - }; - - run_tree( - task_futures, - app_health, - &database_secrets, - &db_config.merkle_tree, - api_config, - &operation_config, - object_store, - stop_receiver, - ) - .await - .context("run_tree()") -} - -#[allow(clippy::too_many_arguments)] -async fn run_tree( - task_futures: &mut Vec>>, - app_health: &AppHealthCheck, - database_secrets: &DatabaseSecrets, - merkle_tree_config: &MerkleTreeConfig, - api_config: Option<&MerkleTreeApiConfig>, - operation_manager: &OperationsManagerConfig, - object_store: Option>, - stop_receiver: watch::Receiver, -) -> anyhow::Result<()> { - let started_at = Instant::now(); - let mode_str = if matches!(merkle_tree_config.mode, MerkleTreeMode::Full) { - "full" - } else { - "lightweight" - }; - tracing::info!("Initializing Merkle tree in {mode_str} mode"); - - let config = MetadataCalculatorConfig::for_main_node(merkle_tree_config, operation_manager); - let pool = ConnectionPool::singleton(database_secrets.master_url()?) - .build() - .await - .context("failed to build connection pool for Merkle tree")?; - // The number of connections in a recovery pool is based on the mainnet recovery runs. It doesn't need - // to be particularly accurate at this point, since the main node isn't expected to recover from a snapshot. - let recovery_pool = ConnectionPool::builder(database_secrets.replica_url()?, 10) - .build() - .await - .context("failed to build connection pool for Merkle tree recovery")?; - let metadata_calculator = MetadataCalculator::new(config, object_store, pool) - .await - .context("failed initializing metadata_calculator")? - .with_recovery_pool(recovery_pool); - - if let Some(api_config) = api_config { - let address = (Ipv4Addr::UNSPECIFIED, api_config.port).into(); - let tree_reader = metadata_calculator.tree_reader(); - let stop_receiver = stop_receiver.clone(); - task_futures.push(tokio::spawn(async move { - tree_reader - .wait() - .await - .context("Cannot initialize tree reader")? - .run_api_server(address, stop_receiver) - .await - })); - } - - let tree_health_check = metadata_calculator.tree_health_check(); - app_health.insert_custom_component(Arc::new(tree_health_check))?; - let tree_task = tokio::spawn(metadata_calculator.run(stop_receiver)); - task_futures.push(tree_task); - - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::Tree].set(elapsed); - tracing::info!("Initialized {mode_str} tree in {elapsed:?}"); - Ok(()) -} - -async fn add_tee_verifier_input_producer_to_task_futures( - task_futures: &mut Vec>>, - connection_pool: &ConnectionPool, - store_factory: &ObjectStoreFactory, - l2_chain_id: L2ChainId, - stop_receiver: watch::Receiver, -) -> anyhow::Result<()> { - let started_at = Instant::now(); - tracing::info!("initializing TeeVerifierInputProducer"); - let producer = TeeVerifierInputProducer::new( - connection_pool.clone(), - store_factory.create_store().await?, - l2_chain_id, - ) - .await?; - task_futures.push(tokio::spawn(producer.run(stop_receiver, None))); - tracing::info!( - "Initialized TeeVerifierInputProducer in {:?}", - started_at.elapsed() - ); - let elapsed = started_at.elapsed(); - APP_METRICS.init_latency[&InitStage::TeeVerifierInputProducer].set(elapsed); - Ok(()) -} - -async fn add_house_keeper_to_task_futures( - configs: &GeneralConfig, - secrets: &Secrets, - task_futures: &mut Vec>>, - stop_receiver: watch::Receiver, -) -> anyhow::Result<()> { - let house_keeper_config = configs - .house_keeper_config - .clone() - .context("house_keeper_config")?; - let postgres_config = configs.postgres_config.clone().context("postgres_config")?; - let secrets = secrets.database.clone().context("database_secrets")?; - let connection_pool = - ConnectionPool::::builder(secrets.replica_url()?, postgres_config.max_connections()?) - .build() - .await - .context("failed to build a connection pool")?; - - let pool_for_metrics = connection_pool.clone(); - let mut stop_receiver_for_metrics = stop_receiver.clone(); - task_futures.push(tokio::spawn(async move { - tokio::select! { - () = PostgresMetrics::run_scraping(pool_for_metrics, Duration::from_secs(60)) => { - tracing::warn!("Postgres metrics scraping unexpectedly stopped"); - } - _ = stop_receiver_for_metrics.changed() => { - tracing::info!("Stop signal received, Postgres metrics scraping is shutting down"); - } - } - Ok(()) - })); - - let l1_batch_metrics_reporter = L1BatchMetricsReporter::new( - house_keeper_config.l1_batch_metrics_reporting_interval_ms, - connection_pool.clone(), - ); - - let prover_connection_pool = ConnectionPool::::builder( - secrets.prover_url()?, - postgres_config.max_connections()?, - ) - .build() - .await - .context("failed to build a prover_connection_pool")?; - let task = l1_batch_metrics_reporter.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - // All FRI Prover related components are configured below. - let fri_prover_config = configs.prover_config.clone().context("fri_prover_config")?; - let fri_prover_job_retry_manager = FriProverJobRetryManager::new( - fri_prover_config.max_attempts, - fri_prover_config.proof_generation_timeout(), - house_keeper_config.prover_job_retrying_interval_ms, - prover_connection_pool.clone(), - ); - let task = fri_prover_job_retry_manager.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - let fri_witness_gen_config = configs - .witness_generator - .clone() - .context("fri_witness_generator_config")?; - let fri_witness_gen_job_retry_manager = FriWitnessGeneratorJobRetryManager::new( - fri_witness_gen_config.max_attempts, - fri_witness_gen_config.witness_generation_timeouts(), - house_keeper_config.witness_generator_job_retrying_interval_ms, - prover_connection_pool.clone(), - ); - let task = fri_witness_gen_job_retry_manager.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - let waiting_to_queued_fri_witness_job_mover = WaitingToQueuedFriWitnessJobMover::new( - house_keeper_config.witness_job_moving_interval_ms, - prover_connection_pool.clone(), - ); - let task = waiting_to_queued_fri_witness_job_mover.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - let fri_witness_generator_stats_reporter = FriWitnessGeneratorQueueReporter::new( - prover_connection_pool.clone(), - house_keeper_config.witness_generator_stats_reporting_interval_ms, - ); - let task = fri_witness_generator_stats_reporter.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - // TODO(PLA-862): remove after fields become required - if let Some((archiving_interval, archive_after)) = - house_keeper_config.prover_job_archiver_params() - { - let fri_prover_jobs_archiver = FriProverJobsArchiver::new( - prover_connection_pool.clone(), - archiving_interval, - archive_after, - ); - let task = fri_prover_jobs_archiver.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - } - - if let Some((archiving_interval, archive_after)) = - house_keeper_config.fri_gpu_prover_archiver_params() - { - let fri_gpu_prover_jobs_archiver = FriGpuProverArchiver::new( - prover_connection_pool.clone(), - archiving_interval, - archive_after, - ); - let task = fri_gpu_prover_jobs_archiver.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - } - - let fri_prover_group_config = configs - .prover_group_config - .clone() - .context("fri_prover_group_config")?; - let fri_prover_stats_reporter = FriProverQueueReporter::new( - house_keeper_config.prover_stats_reporting_interval_ms, - prover_connection_pool.clone(), - connection_pool.clone(), - fri_prover_group_config, - ); - let task = fri_prover_stats_reporter.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - let proof_compressor_config = configs - .proof_compressor_config - .clone() - .context("fri_proof_compressor_config")?; - let fri_proof_compressor_stats_reporter = FriProofCompressorQueueReporter::new( - house_keeper_config.proof_compressor_stats_reporting_interval_ms, - prover_connection_pool.clone(), - ); - let task = fri_proof_compressor_stats_reporter.run(stop_receiver.clone()); - task_futures.push(tokio::spawn(task)); - - let fri_proof_compressor_retry_manager = FriProofCompressorJobRetryManager::new( - proof_compressor_config.max_attempts, - proof_compressor_config.generation_timeout(), - house_keeper_config.proof_compressor_job_retrying_interval_ms, - prover_connection_pool.clone(), - ); - let task = fri_proof_compressor_retry_manager.run(stop_receiver); - task_futures.push(tokio::spawn(task)); - Ok(()) -} - -fn build_storage_caches( - rpc_config: &Web3JsonRpcConfig, - replica_connection_pool: &ConnectionPool, - task_futures: &mut Vec>>, - stop_receiver: watch::Receiver, -) -> anyhow::Result { - let factory_deps_capacity = rpc_config.factory_deps_cache_size() as u64; - let initial_writes_capacity = rpc_config.initial_writes_cache_size() as u64; - let values_capacity = rpc_config.latest_values_cache_size() as u64; - let mut storage_caches = - PostgresStorageCaches::new(factory_deps_capacity, initial_writes_capacity); - - if values_capacity > 0 { - let values_cache_task = storage_caches - .configure_storage_values_cache(values_capacity, replica_connection_pool.clone()); - task_futures.push(tokio::task::spawn(values_cache_task.run(stop_receiver))); - } - Ok(storage_caches) -} - -#[allow(clippy::too_many_arguments)] -async fn run_http_api( - task_futures: &mut Vec>>, - app_health: &AppHealthCheck, - database_secrets: &DatabaseSecrets, - tx_sender_config: &TxSenderConfig, - state_keeper_config: &StateKeeperConfig, - internal_api: &InternalApiConfig, - api_config: &ApiConfig, - master_connection_pool: ConnectionPool, - replica_connection_pool: ConnectionPool, - stop_receiver: watch::Receiver, - batch_fee_model_input_provider: Arc, - with_debug_namespace: bool, - storage_caches: PostgresStorageCaches, - mempool_cache: MempoolCache, -) -> anyhow::Result<()> { - let (tx_sender, vm_barrier) = build_tx_sender( - tx_sender_config, - &api_config.web3_json_rpc, - state_keeper_config, - replica_connection_pool.clone(), - master_connection_pool, - batch_fee_model_input_provider, - storage_caches, - ) - .await?; - - let mut namespaces = Namespace::DEFAULT.to_vec(); - if with_debug_namespace { - namespaces.push(Namespace::Debug) - } - namespaces.push(Namespace::Snapshots); - - let updaters_pool = ConnectionPool::::builder(database_secrets.replica_url()?, 2) - .build() - .await - .context("failed to build updaters_pool")?; - - let mut api_builder = - web3::ApiBuilder::jsonrpsee_backend(internal_api.clone(), replica_connection_pool) - .http(api_config.web3_json_rpc.http_port) - .with_updaters_pool(updaters_pool) - .with_filter_limit(api_config.web3_json_rpc.filters_limit()) - .with_batch_request_size_limit(api_config.web3_json_rpc.max_batch_request_size()) - .with_response_body_size_limit(api_config.web3_json_rpc.max_response_body_size()) - .with_tx_sender(tx_sender) - .with_vm_barrier(vm_barrier) - .with_mempool_cache(mempool_cache) - .enable_api_namespaces(namespaces); - if let Some(tree_api_url) = api_config.web3_json_rpc.tree_api_url() { - let tree_api = Arc::new(TreeApiHttpClient::new(tree_api_url)); - api_builder = api_builder.with_tree_api(tree_api.clone()); - app_health.insert_custom_component(tree_api)?; - } - - let server_handles = api_builder - .build() - .context("failed to build HTTP API server")? - .run(stop_receiver) - .await?; - task_futures.extend(server_handles.tasks); - app_health.insert_component(server_handles.health_check)?; - Ok(()) -} - -#[allow(clippy::too_many_arguments)] -async fn run_ws_api( - task_futures: &mut Vec>>, - app_health: &AppHealthCheck, - database_secrets: &DatabaseSecrets, - tx_sender_config: &TxSenderConfig, - state_keeper_config: &StateKeeperConfig, - internal_api: &InternalApiConfig, - api_config: &ApiConfig, - batch_fee_model_input_provider: Arc, - master_connection_pool: ConnectionPool, - replica_connection_pool: ConnectionPool, - stop_receiver: watch::Receiver, - storage_caches: PostgresStorageCaches, - mempool_cache: MempoolCache, -) -> anyhow::Result<()> { - let (tx_sender, vm_barrier) = build_tx_sender( - tx_sender_config, - &api_config.web3_json_rpc, - state_keeper_config, - replica_connection_pool.clone(), - master_connection_pool, - batch_fee_model_input_provider, - storage_caches, - ) - .await?; - let updaters_pool = ConnectionPool::::singleton(database_secrets.replica_url()?) - .build() - .await - .context("failed to build updaters_pool")?; - - let mut namespaces = Namespace::DEFAULT.to_vec(); - namespaces.push(Namespace::Snapshots); - - let mut api_builder = - web3::ApiBuilder::jsonrpsee_backend(internal_api.clone(), replica_connection_pool) - .ws(api_config.web3_json_rpc.ws_port) - .with_updaters_pool(updaters_pool) - .with_filter_limit(api_config.web3_json_rpc.filters_limit()) - .with_subscriptions_limit(api_config.web3_json_rpc.subscriptions_limit()) - .with_batch_request_size_limit(api_config.web3_json_rpc.max_batch_request_size()) - .with_response_body_size_limit(api_config.web3_json_rpc.max_response_body_size()) - .with_websocket_requests_per_minute_limit( - api_config - .web3_json_rpc - .websocket_requests_per_minute_limit(), - ) - .with_polling_interval(api_config.web3_json_rpc.pubsub_interval()) - .with_tx_sender(tx_sender) - .with_vm_barrier(vm_barrier) - .with_mempool_cache(mempool_cache) - .enable_api_namespaces(namespaces); - if let Some(tree_api_url) = api_config.web3_json_rpc.tree_api_url() { - let tree_api = Arc::new(TreeApiHttpClient::new(tree_api_url)); - api_builder = api_builder.with_tree_api(tree_api.clone()); - app_health.insert_custom_component(tree_api)?; - } - - let server_handles = api_builder - .build() - .context("failed to build WS API server")? - .run(stop_receiver) - .await?; - task_futures.extend(server_handles.tasks); - app_health.insert_component(server_handles.health_check)?; - Ok(()) -} - -async fn circuit_breakers_for_components( - components: &[Component], - database_secrets: &DatabaseSecrets, - circuit_breaker_config: &CircuitBreakerConfig, -) -> anyhow::Result { - let circuit_breakers = CircuitBreakers::default(); - - if components - .iter() - .any(|c| matches!(c, Component::EthTxAggregator | Component::EthTxManager)) - { - let pool = ConnectionPool::::singleton(database_secrets.replica_url()?) - .build() - .await - .context("failed to build a connection pool")?; - circuit_breakers - .insert(Box::new(FailedL1TransactionChecker { pool })) - .await; - } - - if components.iter().any(|c| { - matches!( - c, - Component::HttpApi | Component::WsApi | Component::ContractVerificationApi - ) - }) { - let pool = ConnectionPool::::singleton(database_secrets.replica_url()?) - .build() - .await?; - circuit_breakers - .insert(Box::new(ReplicationLagChecker { - pool, - replication_lag_limit: circuit_breaker_config.replication_lag_limit(), - })) - .await; - } - Ok(circuit_breakers) -} diff --git a/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs b/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs index 1f4c410ed9c1..cb3e0d08794d 100644 --- a/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs +++ b/core/lib/zksync_core_leftovers/src/temp_config_store/mod.rs @@ -15,20 +15,14 @@ use zksync_config::{ ApiConfig, ContractVerifierConfig, DBConfig, EthConfig, EthWatchConfig, GasAdjusterConfig, ObjectStoreConfig, PostgresConfig, SnapshotsCreatorConfig, }; -use zksync_protobuf::{repr::ProtoRepr, ProtoFmt}; - -pub fn decode_yaml(yaml: &str) -> anyhow::Result { - let d = serde_yaml::Deserializer::from_str(yaml); - let this: T = zksync_protobuf::serde::deserialize(d)?; - Ok(this) -} +use zksync_protobuf::repr::ProtoRepr; pub fn decode_yaml_repr(yaml: &str) -> anyhow::Result { let d = serde_yaml::Deserializer::from_str(yaml); let this: T = zksync_protobuf::serde::deserialize_proto_with_options(d, false)?; this.read() } -// + // TODO (QIT-22): This structure is going to be removed when components will be responsible for their own configs. /// A temporary config store allowing to pass deserialized configs from `zksync_server` to `zksync_core`. /// All the configs are optional, since for some component combination it is not needed to pass all the configs. diff --git a/infrastructure/zk/src/server.ts b/infrastructure/zk/src/server.ts index 872aff2eb5c3..2ed74deca98e 100644 --- a/infrastructure/zk/src/server.ts +++ b/infrastructure/zk/src/server.ts @@ -21,9 +21,6 @@ export async function server(rebuildTree: boolean, uring: boolean, components?: if (components) { options += ` --components=${components}`; } - if (useNodeFramework) { - options += ' --use-node-framework'; - } await utils.spawn(`cargo run --bin zksync_server --release ${options}`); } @@ -82,7 +79,6 @@ export const serverCommand = new Command('server') .option('--uring', 'enables uring support for RocksDB') .option('--components ', 'comma-separated list of components to run') .option('--chain-name ', 'environment name') - .option('--use-node-framework', 'use node framework for server') .action(async (cmd: Command) => { cmd.chainName ? env.reload(cmd.chainName) : env.load(); if (cmd.genesis) { diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 6d6b967fbbe7..c0e965605fd4 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -28,41 +28,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" version = "0.7.8" @@ -96,21 +61,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - [[package]] name = "allocator-api2" version = "0.2.18" @@ -244,22 +194,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-compression" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" -dependencies = [ - "brotli", - "flate2", - "futures-core", - "memchr", - "pin-project-lite", - "tokio", - "zstd", - "zstd-safe", -] - [[package]] name = "async-lock" version = "3.4.0" @@ -352,11 +286,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", "sync_wrapper", - "tokio", "tower", "tower-layer", "tower-service", @@ -605,15 +535,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -801,27 +722,6 @@ dependencies = [ "syn_derive", ] -[[package]] -name = "brotli" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - [[package]] name = "bumpalo" version = "3.16.0" @@ -954,30 +854,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "chacha20" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", -] - -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - [[package]] name = "chrono" version = "0.4.38" @@ -993,17 +869,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", - "zeroize", -] - [[package]] name = "circuit_definitions" version = "0.1.0" @@ -1221,22 +1086,6 @@ dependencies = [ "cc", ] -[[package]] -name = "codegen" -version = "0.1.0" -source = "git+https://github.com/matter-labs/solidity_plonk_verifier.git?branch=dev#82f96b7156551087f1c9bfe4f0ea68845b6debfc" -dependencies = [ - "ethereum-types", - "franklin-crypto 0.0.5 (git+https://github.com/matter-labs/franklin-crypto?branch=dev)", - "handlebars", - "hex", - "paste", - "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git)", - "serde", - "serde_derive", - "serde_json", -] - [[package]] name = "codegen" version = "0.2.0" @@ -1561,7 +1410,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", "typenum", ] @@ -1598,15 +1446,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "ctrlc" version = "3.4.4" @@ -2506,20 +2345,10 @@ dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" -dependencies = [ - "opaque-debug", - "polyval", -] - [[package]] name = "gimli" version = "0.29.0" @@ -2651,23 +2480,6 @@ dependencies = [ "async-trait", ] -[[package]] -name = "governor" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19775995ee20209163239355bc3ad2f33f83da35d9ef72dea26e5af753552c87" -dependencies = [ - "dashmap", - "futures 0.3.30", - "futures-timer", - "no-std-compat", - "nonzero_ext", - "parking_lot", - "quanta 0.9.3", - "rand 0.8.5", - "smallvec", -] - [[package]] name = "gpu-ffi" version = "0.1.0" @@ -2738,20 +2550,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "handlebars" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" -dependencies = [ - "log", - "pest", - "pest_derive", - "serde", - "serde_json", - "thiserror", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -2789,16 +2587,6 @@ dependencies = [ "hashbrown 0.14.5", ] -[[package]] -name = "hdrhistogram" -version = "7.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" -dependencies = [ - "byteorder", - "num-traits", -] - [[package]] name = "heck" version = "0.3.3" @@ -2904,12 +2692,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" - [[package]] name = "httparse" version = "1.8.0" @@ -3032,20 +2814,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "im" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" -dependencies = [ - "bitmaps", - "rand_core 0.6.4", - "rand_xoshiro", - "sized-chunks", - "typenum", - "version_check", -] - [[package]] name = "impl-codec" version = "0.6.0" @@ -3116,15 +2884,6 @@ dependencies = [ "regex", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -3140,16 +2899,6 @@ dependencies = [ "serde", ] -[[package]] -name = "iri-string" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f5f6c2df22c009ac44f6f1499308e7a3ac7ba42cd2378475cc691510e1eef1b" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.0" @@ -3237,11 +2986,9 @@ dependencies = [ "jsonrpsee-core", "jsonrpsee-http-client", "jsonrpsee-proc-macros", - "jsonrpsee-server", "jsonrpsee-types", "jsonrpsee-wasm-client", "jsonrpsee-ws-client", - "tokio", "tracing", ] @@ -3283,9 +3030,7 @@ dependencies = [ "futures-util", "hyper", "jsonrpsee-types", - "parking_lot", "pin-project", - "rand 0.8.5", "rustc-hash", "serde", "serde_json", @@ -3329,30 +3074,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "jsonrpsee-server" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7c6d1a2c58f6135810284a390d9f823d0f508db74cd914d8237802de80f98" -dependencies = [ - "futures-util", - "http", - "hyper", - "jsonrpsee-core", - "jsonrpsee-types", - "pin-project", - "route-recognizer", - "serde", - "serde_json", - "soketto", - "thiserror", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tracing", -] - [[package]] name = "jsonrpsee-types" version = "0.21.0" @@ -3624,12 +3345,6 @@ dependencies = [ "logos-codegen", ] -[[package]] -name = "lru" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" - [[package]] name = "lz4-sys" version = "1.9.4" @@ -3640,15 +3355,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "mach2" version = "0.4.2" @@ -3739,7 +3445,7 @@ dependencies = [ "ipnet", "metrics", "metrics-util", - "quanta 0.11.1", + "quanta", "thiserror", "tokio", "tracing", @@ -3767,7 +3473,7 @@ dependencies = [ "hashbrown 0.13.1", "metrics", "num_cpus", - "quanta 0.11.1", + "quanta", "sketches-ddsketch", ] @@ -3847,7 +3553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -3940,12 +3646,6 @@ dependencies = [ "libc", ] -[[package]] -name = "no-std-compat" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" - [[package]] name = "nodrop" version = "0.1.14" @@ -3962,12 +3662,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "nonzero_ext" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" - [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -4524,51 +4218,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2 1.0.85", - "quote 1.0.36", - "syn 2.0.66", -] - -[[package]] -name = "pest_meta" -version = "2.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.8", -] - [[package]] name = "petgraph" version = "0.6.5" @@ -4648,29 +4297,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "polyval" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug", - "universal-hash", -] - [[package]] name = "portable-atomic" version = "1.6.0" @@ -5043,22 +4669,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "quanta" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20afe714292d5e879d8b12740aa223c6a88f118af41870e8b6196e39a02238a8" -dependencies = [ - "crossbeam-utils 0.8.20", - "libc", - "mach", - "once_cell", - "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", - "web-sys", - "winapi", -] - [[package]] name = "quanta" version = "0.11.1" @@ -5070,7 +4680,7 @@ dependencies = [ "mach2", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "web-sys", "winapi", ] @@ -5187,15 +4797,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core 0.6.4", -] - [[package]] name = "raw-cpuid" version = "10.7.0" @@ -5477,12 +5078,6 @@ dependencies = [ "librocksdb-sys", ] -[[package]] -name = "route-recognizer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" - [[package]] name = "rsa" version = "0.9.6" @@ -5968,16 +5563,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" -dependencies = [ - "itoa", - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -6204,16 +5789,6 @@ dependencies = [ "time", ] -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - [[package]] name = "skeptic" version = "0.13.7" @@ -6263,22 +5838,6 @@ dependencies = [ "rescue_poseidon 0.4.1 (git+https://github.com/matter-labs/rescue-poseidon.git?branch=poseidon2)", ] -[[package]] -name = "snow" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" -dependencies = [ - "aes-gcm", - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", - "chacha20poly1305", - "curve25519-dalek", - "rand_core 0.6.4", - "rustc_version", - "sha2 0.10.8", - "subtle", -] - [[package]] name = "socket2" version = "0.5.7" @@ -6298,7 +5857,6 @@ dependencies = [ "base64 0.13.1", "bytes", "futures 0.3.30", - "http", "httparse", "log", "rand 0.8.5", @@ -7091,7 +6649,6 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "hdrhistogram", "indexmap 1.9.3", "pin-project", "pin-project-lite", @@ -7104,36 +6661,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" -dependencies = [ - "async-compression", - "base64 0.21.7", - "bitflags 2.5.0", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "httpdate", - "iri-string", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", - "uuid", -] - [[package]] name = "tower-layer" version = "0.3.2" @@ -7273,12 +6800,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - [[package]] name = "uint" version = "0.9.5" @@ -7372,16 +6893,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "unroll" version = "0.1.5" @@ -7447,7 +6958,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "getrandom", "serde", ] @@ -7559,21 +7069,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "vm_utils" -version = "0.1.0" -dependencies = [ - "anyhow", - "multivm", - "tokio", - "tracing", - "zksync_contracts", - "zksync_dal", - "zksync_state", - "zksync_types", - "zksync_utils", -] - [[package]] name = "wait-timeout" version = "0.2.0" @@ -7602,12 +7097,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -8307,7 +7796,7 @@ dependencies = [ "bincode", "circuit_sequencer_api 0.1.0", "circuit_testing", - "codegen 0.2.0", + "codegen", "crossbeam 0.8.4", "derivative", "env_logger 0.11.3", @@ -8334,7 +7823,7 @@ source = "git+https://github.com/matter-labs/era-zkevm_test_harness?branch=gpu-w dependencies = [ "bincode", "circuit_definitions 0.1.0", - "codegen 0.2.0", + "codegen", "crossbeam 0.8.4", "derivative", "env_logger 0.11.3", @@ -8358,7 +7847,7 @@ dependencies = [ "bincode", "circuit_definitions 1.5.0", "circuit_sequencer_api 0.1.50", - "codegen 0.2.0", + "codegen", "crossbeam 0.8.4", "curl", "derivative", @@ -8398,48 +7887,6 @@ dependencies = [ "url", ] -[[package]] -name = "zksync_circuit_breaker" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_dal", -] - -[[package]] -name = "zksync_commitment_generator" -version = "0.1.0" -dependencies = [ - "anyhow", - "circuit_sequencer_api 0.1.40", - "circuit_sequencer_api 0.1.41", - "circuit_sequencer_api 0.1.50", - "futures 0.3.30", - "itertools 0.10.5", - "multivm", - "num_cpus", - "serde_json", - "tokio", - "tracing", - "vise", - "zk_evm 1.3.3 (git+https://github.com/matter-labs/era-zk_evm.git?tag=v1.3.3-rc2)", - "zk_evm 1.4.1", - "zk_evm 1.5.0", - "zksync_contracts", - "zksync_dal", - "zksync_eth_client", - "zksync_health_check", - "zksync_l1_contract_interface", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_concurrency" version = "0.1.0" @@ -8471,27 +7918,6 @@ dependencies = [ "zksync_crypto_primitives", ] -[[package]] -name = "zksync_consensus_bft" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" -dependencies = [ - "anyhow", - "async-trait", - "once_cell", - "rand 0.8.5", - "thiserror", - "tracing", - "vise", - "zksync_concurrency", - "zksync_consensus_crypto", - "zksync_consensus_network", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_protobuf", -] - [[package]] name = "zksync_consensus_crypto" version = "0.1.0" @@ -8513,50 +7939,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "zksync_consensus_executor" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" -dependencies = [ - "anyhow", - "rand 0.8.5", - "tracing", - "vise", - "zksync_concurrency", - "zksync_consensus_bft", - "zksync_consensus_crypto", - "zksync_consensus_network", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_protobuf", -] - -[[package]] -name = "zksync_consensus_network" -version = "0.1.0" -source = "git+https://github.com/matter-labs/era-consensus.git?rev=3e6f101ee4124308c4c974caaa259d524549b0c6#3e6f101ee4124308c4c974caaa259d524549b0c6" -dependencies = [ - "anyhow", - "async-trait", - "im", - "once_cell", - "pin-project", - "prost 0.12.6", - "rand 0.8.5", - "snow", - "thiserror", - "tracing", - "vise", - "zksync_concurrency", - "zksync_consensus_crypto", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_protobuf", - "zksync_protobuf_build", -] - [[package]] name = "zksync_consensus_roles" version = "0.1.0" @@ -8607,142 +7989,53 @@ dependencies = [ ] [[package]] -name = "zksync_contract_verification_server" +name = "zksync_contracts" version = "0.1.0" dependencies = [ - "anyhow", - "axum", + "envy", + "ethabi", + "hex", + "once_cell", "serde", "serde_json", + "zksync_utils", +] + +[[package]] +name = "zksync_core_leftovers" +version = "0.1.0" +dependencies = [ + "anyhow", + "ctrlc", + "serde_yaml", "tokio", - "tower-http", - "tracing", - "vise", "zksync_config", "zksync_dal", - "zksync_types", + "zksync_node_genesis", + "zksync_protobuf", ] [[package]] -name = "zksync_contracts" +name = "zksync_crypto" version = "0.1.0" dependencies = [ - "envy", - "ethabi", + "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", "hex", "once_cell", "serde", - "serde_json", - "zksync_utils", + "sha2 0.10.8", + "thiserror", + "zksync_basic_types", ] [[package]] -name = "zksync_core_leftovers" +name = "zksync_crypto_primitives" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", - "axum", - "chrono", - "ctrlc", - "dashmap", - "futures 0.3.30", - "governor", "hex", - "itertools 0.10.5", - "lru", - "multivm", - "once_cell", - "pin-project-lite", - "prometheus_exporter", - "prost 0.12.6", - "prover_dal", "rand 0.8.5", - "reqwest", - "secrecy", - "serde", - "serde_json", - "serde_yaml", - "thiserror", - "thread_local", - "tokio", - "tower", - "tower-http", - "tracing", - "vise", - "vlog", - "vm_utils", - "zksync_circuit_breaker", - "zksync_commitment_generator", - "zksync_concurrency", - "zksync_config", - "zksync_consensus_bft", - "zksync_consensus_crypto", - "zksync_consensus_executor", - "zksync_consensus_network", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_contract_verification_server", - "zksync_contracts", - "zksync_dal", - "zksync_db_connection", - "zksync_eth_client", - "zksync_eth_sender", - "zksync_eth_signer", - "zksync_eth_watch", - "zksync_health_check", - "zksync_house_keeper", - "zksync_l1_contract_interface", - "zksync_mempool", - "zksync_merkle_tree", - "zksync_metadata_calculator", - "zksync_mini_merkle_tree", - "zksync_node_api_server", - "zksync_node_consensus", - "zksync_node_fee_model", - "zksync_node_genesis", - "zksync_node_sync", - "zksync_object_store", - "zksync_proof_data_handler", - "zksync_protobuf", - "zksync_protobuf_build", - "zksync_protobuf_config", - "zksync_prover_interface", - "zksync_queued_job_processor", - "zksync_shared_metrics", - "zksync_state", - "zksync_state_keeper", - "zksync_storage", - "zksync_system_constants", - "zksync_tee_verifier", - "zksync_tee_verifier_input_producer", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - -[[package]] -name = "zksync_crypto" -version = "0.1.0" -dependencies = [ - "blake2 0.10.6 (registry+https://github.com/rust-lang/crates.io-index)", - "hex", - "once_cell", - "serde", - "sha2 0.10.8", - "thiserror", - "zksync_basic_types", -] - -[[package]] -name = "zksync_crypto_primitives" -version = "0.1.0" -dependencies = [ - "anyhow", - "hex", - "rand 0.8.5", - "secp256k1", + "secp256k1", "serde", "serde_json", "thiserror", @@ -8826,30 +8119,6 @@ dependencies = [ "zksync_web3_decl", ] -[[package]] -name = "zksync_eth_sender" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_contracts", - "zksync_dal", - "zksync_eth_client", - "zksync_l1_contract_interface", - "zksync_node_fee_model", - "zksync_object_store", - "zksync_prover_interface", - "zksync_shared_metrics", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_eth_signer" version = "0.1.0" @@ -8860,24 +8129,6 @@ dependencies = [ "zksync_types", ] -[[package]] -name = "zksync_eth_watch" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_contracts", - "zksync_dal", - "zksync_eth_client", - "zksync_shared_metrics", - "zksync_system_constants", - "zksync_types", -] - [[package]] name = "zksync_health_check" version = "0.1.0" @@ -8892,44 +8143,6 @@ dependencies = [ "vise", ] -[[package]] -name = "zksync_house_keeper" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "prover_dal", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_dal", - "zksync_shared_metrics", - "zksync_types", -] - -[[package]] -name = "zksync_l1_contract_interface" -version = "0.1.0" -dependencies = [ - "codegen 0.1.0", - "hex", - "kzg", - "once_cell", - "sha2 0.10.8", - "sha3 0.10.8", - "zksync_prover_interface", - "zksync_types", -] - -[[package]] -name = "zksync_mempool" -version = "0.1.0" -dependencies = [ - "tracing", - "zksync_types", -] - [[package]] name = "zksync_merkle_tree" version = "0.1.0" @@ -8949,35 +8162,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zksync_metadata_calculator" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "axum", - "futures 0.3.30", - "itertools 0.10.5", - "once_cell", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_crypto", - "zksync_dal", - "zksync_health_check", - "zksync_merkle_tree", - "zksync_object_store", - "zksync_shared_metrics", - "zksync_storage", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_mini_merkle_tree" version = "0.1.0" @@ -8987,100 +8171,6 @@ dependencies = [ "zksync_crypto", ] -[[package]] -name = "zksync_node_api_server" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "axum", - "chrono", - "futures 0.3.30", - "governor", - "hex", - "http", - "itertools 0.10.5", - "lru", - "multivm", - "once_cell", - "pin-project-lite", - "rand 0.8.5", - "serde", - "serde_json", - "thiserror", - "thread_local", - "tokio", - "tower", - "tower-http", - "tracing", - "vise", - "zksync_config", - "zksync_contracts", - "zksync_dal", - "zksync_health_check", - "zksync_metadata_calculator", - "zksync_mini_merkle_tree", - "zksync_node_fee_model", - "zksync_node_sync", - "zksync_protobuf", - "zksync_shared_metrics", - "zksync_state", - "zksync_state_keeper", - "zksync_system_constants", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - -[[package]] -name = "zksync_node_consensus" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "secrecy", - "tempfile", - "tracing", - "zksync_concurrency", - "zksync_config", - "zksync_consensus_bft", - "zksync_consensus_crypto", - "zksync_consensus_executor", - "zksync_consensus_network", - "zksync_consensus_roles", - "zksync_consensus_storage", - "zksync_consensus_utils", - "zksync_dal", - "zksync_l1_contract_interface", - "zksync_merkle_tree", - "zksync_metadata_calculator", - "zksync_node_sync", - "zksync_protobuf", - "zksync_state", - "zksync_state_keeper", - "zksync_system_constants", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - -[[package]] -name = "zksync_node_fee_model" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "tokio", - "tracing", - "vise", - "zksync_config", - "zksync_dal", - "zksync_eth_client", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - [[package]] name = "zksync_node_genesis" version = "0.1.0" @@ -9102,50 +8192,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zksync_node_sync" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "chrono", - "futures 0.3.30", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "vise", - "vm_utils", - "zksync_concurrency", - "zksync_config", - "zksync_contracts", - "zksync_dal", - "zksync_eth_client", - "zksync_health_check", - "zksync_node_genesis", - "zksync_shared_metrics", - "zksync_state_keeper", - "zksync_system_constants", - "zksync_types", - "zksync_utils", - "zksync_web3_decl", -] - -[[package]] -name = "zksync_node_test_utils" -version = "0.1.0" -dependencies = [ - "multivm", - "zksync_contracts", - "zksync_dal", - "zksync_merkle_tree", - "zksync_node_genesis", - "zksync_system_constants", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_object_store" version = "0.1.0" @@ -9169,22 +8215,6 @@ dependencies = [ "zksync_types", ] -[[package]] -name = "zksync_proof_data_handler" -version = "0.1.0" -dependencies = [ - "anyhow", - "axum", - "tokio", - "tracing", - "zksync_config", - "zksync_dal", - "zksync_object_store", - "zksync_prover_interface", - "zksync_tee_verifier", - "zksync_types", -] - [[package]] name = "zksync_proof_fri_compressor" version = "0.1.0" @@ -9429,38 +8459,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zksync_state_keeper" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "futures 0.3.30", - "hex", - "itertools 0.10.5", - "multivm", - "once_cell", - "thiserror", - "tokio", - "tracing", - "vise", - "vm_utils", - "zksync_config", - "zksync_contracts", - "zksync_dal", - "zksync_mempool", - "zksync_node_fee_model", - "zksync_node_genesis", - "zksync_node_test_utils", - "zksync_protobuf", - "zksync_shared_metrics", - "zksync_state", - "zksync_storage", - "zksync_test_account", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_storage" version = "0.1.0" @@ -9482,61 +8480,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zksync_tee_verifier" -version = "0.1.0" -dependencies = [ - "anyhow", - "multivm", - "serde", - "tracing", - "vm_utils", - "zksync_config", - "zksync_crypto", - "zksync_dal", - "zksync_db_connection", - "zksync_merkle_tree", - "zksync_object_store", - "zksync_prover_interface", - "zksync_queued_job_processor", - "zksync_state", - "zksync_types", - "zksync_utils", -] - -[[package]] -name = "zksync_tee_verifier_input_producer" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "tokio", - "tracing", - "vise", - "vm_utils", - "zksync_dal", - "zksync_object_store", - "zksync_prover_interface", - "zksync_queued_job_processor", - "zksync_tee_verifier", - "zksync_types", - "zksync_utils", -] - -[[package]] -name = "zksync_test_account" -version = "0.1.0" -dependencies = [ - "ethabi", - "hex", - "rand 0.8.5", - "zksync_contracts", - "zksync_eth_signer", - "zksync_system_constants", - "zksync_types", - "zksync_utils", -] - [[package]] name = "zksync_types" version = "0.1.0" @@ -9683,24 +8626,6 @@ dependencies = [ "zksync_utils", ] -[[package]] -name = "zstd" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" -dependencies = [ - "zstd-sys", -] - [[package]] name = "zstd-sys" version = "2.0.10+zstd.1.5.6"