From 63c92b6205fb156f4b50dee581674b814f44f874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Ignacio=20Gonz=C3=A1lez?= Date: Mon, 29 Jul 2024 18:44:25 +0200 Subject: [PATCH 1/4] feat(zk_toolbox): Update prover support (#2533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Update prover support: * Witness vector generator thread selection * Prover CloudType selection --- etc/env/file_based/general.yaml | 1 + zk_toolbox/README.md | 2 + .../src/commands/prover/args/init.rs | 38 ++++++++++++++++++- .../src/commands/prover/args/run.rs | 33 +++++++++++++++- .../zk_inception/src/commands/prover/init.rs | 1 + .../src/commands/prover/init_bellman_cuda.rs | 5 +++ .../zk_inception/src/commands/prover/run.rs | 16 ++++++-- .../crates/zk_inception/src/messages.rs | 2 + 8 files changed, 90 insertions(+), 8 deletions(-) diff --git a/etc/env/file_based/general.yaml b/etc/env/file_based/general.yaml index 059b993d326b..a36e3db2b6cd 100644 --- a/etc/env/file_based/general.yaml +++ b/etc/env/file_based/general.yaml @@ -177,6 +177,7 @@ prover: availability_check_interval_in_secs: 10000 zone_read_url: http://metadata.google.internal/computeMetadata/v1/instance/zone shall_save_to_public_bucket: true + cloud_type: LOCAL witness_generator: generation_timeout_in_secs: 900 max_attempts: 10 diff --git a/zk_toolbox/README.md b/zk_toolbox/README.md index d97d05f1459a..71eb9af00ec5 100644 --- a/zk_toolbox/README.md +++ b/zk_toolbox/README.md @@ -148,6 +148,8 @@ You can specify the prover component to run by providing `--component ` argument. Possible rounds are: `all-rounds, basic-circuits, leaf-aggregation, node-aggregation, recursion-tip, scheduler` +For `witness-vector-generator`, specify the number of WVG jobs with `--threads `. + ### Contract verifier Running the contract verifier: diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs index 4943c596a1d6..3eca80f56220 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/init.rs @@ -3,14 +3,15 @@ use common::{logger, Prompt, PromptConfirm, PromptSelect}; use serde::{Deserialize, Serialize}; use strum::{EnumIter, IntoEnumIterator}; use xshell::Shell; +use zksync_config::configs::fri_prover::CloudType; use super::init_bellman_cuda::InitBellmanCudaArgs; use crate::{ commands::prover::gcs::get_project_ids, consts::{DEFAULT_CREDENTIALS_FILE, DEFAULT_PROOF_STORE_DIR}, messages::{ - MSG_CREATE_GCS_BUCKET_LOCATION_PROMPT, MSG_CREATE_GCS_BUCKET_NAME_PROMTP, - MSG_CREATE_GCS_BUCKET_PROJECT_ID_NO_PROJECTS_PROMPT, + MSG_CLOUD_TYPE_PROMPT, MSG_CREATE_GCS_BUCKET_LOCATION_PROMPT, + MSG_CREATE_GCS_BUCKET_NAME_PROMTP, MSG_CREATE_GCS_BUCKET_PROJECT_ID_NO_PROJECTS_PROMPT, MSG_CREATE_GCS_BUCKET_PROJECT_ID_PROMPT, MSG_CREATE_GCS_BUCKET_PROMPT, MSG_DOWNLOAD_SETUP_KEY_PROMPT, MSG_GETTING_PROOF_STORE_CONFIG, MSG_GETTING_PUBLIC_STORE_CONFIG, MSG_PROOF_STORE_CONFIG_PROMPT, MSG_PROOF_STORE_DIR_PROMPT, @@ -52,6 +53,9 @@ pub struct ProverInitArgs { #[clap(flatten)] #[serde(flatten)] pub setup_key_config: SetupKeyConfigTmp, + + #[clap(long)] + cloud_type: Option, } #[derive(Debug, Clone, ValueEnum, EnumIter, strum::Display, PartialEq, Eq)] @@ -61,6 +65,24 @@ enum ProofStoreConfig { GCS, } +#[derive( + Debug, Clone, ValueEnum, EnumIter, strum::Display, PartialEq, Eq, Deserialize, Serialize, +)] +#[allow(clippy::upper_case_acronyms)] +enum InternalCloudType { + GCP, + Local, +} + +impl From for CloudType { + fn from(cloud_type: InternalCloudType) -> Self { + match cloud_type { + InternalCloudType::GCP => CloudType::GCP, + InternalCloudType::Local => CloudType::Local, + } + } +} + #[derive(Clone, Debug, Serialize, Deserialize, Parser, Default)] pub struct ProofStorageGCSTmp { #[clap(long)] @@ -144,6 +166,7 @@ pub struct ProverInitArgsFinal { pub public_store: Option, pub setup_key_config: SetupKeyConfig, pub bellman_cuda_config: InitBellmanCudaArgs, + pub cloud_type: CloudType, } impl ProverInitArgs { @@ -156,11 +179,14 @@ impl ProverInitArgs { let public_store = self.fill_public_storage_values_with_prompt(shell)?; let setup_key_config = self.fill_setup_key_values_with_prompt(setup_key_path); let bellman_cuda_config = self.fill_bellman_cuda_values_with_prompt()?; + let cloud_type = self.get_cloud_type_with_prompt(); + Ok(ProverInitArgsFinal { proof_store, public_store, setup_key_config, bellman_cuda_config, + cloud_type, }) } @@ -406,4 +432,12 @@ impl ProverInitArgs { fn fill_bellman_cuda_values_with_prompt(&self) -> anyhow::Result { self.bellman_cuda_config.clone().fill_values_with_prompt() } + + fn get_cloud_type_with_prompt(&self) -> CloudType { + let cloud_type = self.cloud_type.clone().unwrap_or_else(|| { + PromptSelect::new(MSG_CLOUD_TYPE_PROMPT, InternalCloudType::iter()).ask() + }); + + cloud_type.into() + } } diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs index 4b485099cc80..c2d5cef26ad4 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/args/run.rs @@ -1,8 +1,8 @@ use clap::{Parser, ValueEnum}; -use common::PromptSelect; +use common::{Prompt, PromptSelect}; use strum::{EnumIter, IntoEnumIterator}; -use crate::messages::{MSG_ROUND_SELECT_PROMPT, MSG_RUN_COMPONENT_PROMPT}; +use crate::messages::{MSG_ROUND_SELECT_PROMPT, MSG_RUN_COMPONENT_PROMPT, MSG_THREADS_PROMPT}; #[derive(Debug, Clone, Parser, Default)] pub struct ProverRunArgs { @@ -10,6 +10,8 @@ pub struct ProverRunArgs { pub component: Option, #[clap(flatten)] pub witness_generator_args: WitnessGeneratorArgs, + #[clap(flatten)] + pub witness_vector_generator_args: WitnessVectorGeneratorArgs, } #[derive( @@ -50,6 +52,28 @@ pub enum WitnessGeneratorRound { Scheduler, } +#[derive(Debug, Clone, Parser, Default)] +pub struct WitnessVectorGeneratorArgs { + #[clap(long)] + pub threads: Option, +} + +impl WitnessVectorGeneratorArgs { + fn fill_values_with_prompt(&self, component: ProverComponent) -> anyhow::Result { + if component != ProverComponent::WitnessVectorGenerator { + return Ok(Self::default()); + } + + let threads = self + .threads + .unwrap_or_else(|| Prompt::new(MSG_THREADS_PROMPT).default("1").ask()); + + Ok(Self { + threads: Some(threads), + }) + } +} + impl ProverRunArgs { pub fn fill_values_with_prompt(&self) -> anyhow::Result { let component = self.component.unwrap_or_else(|| { @@ -60,9 +84,14 @@ impl ProverRunArgs { .witness_generator_args .fill_values_with_prompt(component)?; + let witness_vector_generator_args = self + .witness_vector_generator_args + .fill_values_with_prompt(component)?; + Ok(ProverRunArgs { component: Some(component), witness_generator_args, + witness_vector_generator_args, }) } } diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs index 54b53b8576db..a27e5f1b0bec 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init.rs @@ -59,6 +59,7 @@ pub(crate) async fn run(args: ProverInitArgs, shell: &Shell) -> anyhow::Result<( } else { prover_config.shall_save_to_public_bucket = false; } + prover_config.cloud_type = args.cloud_type; general_config.prover_config = Some(prover_config); let mut proof_compressor_config = general_config diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs index c6c5d3ef23d9..75535587c42c 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/init_bellman_cuda.rs @@ -37,6 +37,11 @@ pub(crate) async fn run(shell: &Shell, args: InitBellmanCudaArgs) -> anyhow::Res } fn clone_bellman_cuda(shell: &Shell) -> anyhow::Result { + let path = shell.current_dir().join(BELLMAN_CUDA_DIR); + if shell.path_exists(path.clone()) { + return Ok(path.to_str().context(MSG_BELLMAN_CUDA_DIR_ERR)?.to_string()); + } + let spinner = Spinner::new(MSG_CLONING_BELLMAN_CUDA_SPINNER); let path = git::clone( shell, diff --git a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs b/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs index 898cf0e45d66..5497db8a21e0 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/prover/run.rs @@ -4,7 +4,10 @@ use config::{ChainConfig, EcosystemConfig}; use xshell::{cmd, Shell}; use super::{ - args::run::{ProverComponent, ProverRunArgs, WitnessGeneratorArgs, WitnessGeneratorRound}, + args::run::{ + ProverComponent, ProverRunArgs, WitnessGeneratorArgs, WitnessGeneratorRound, + WitnessVectorGeneratorArgs, + }, utils::get_link_to_prover, }; use crate::messages::{ @@ -32,7 +35,7 @@ pub(crate) async fn run(args: ProverRunArgs, shell: &Shell) -> anyhow::Result<() run_witness_generator(shell, &chain, args.witness_generator_args)? } Some(ProverComponent::WitnessVectorGenerator) => { - run_witness_vector_generator(shell, &chain)? + run_witness_vector_generator(shell, &chain, args.witness_vector_generator_args)? } Some(ProverComponent::Prover) => run_prover(shell, &chain)?, Some(ProverComponent::Compressor) => run_compressor(shell, &chain, &ecosystem_config)?, @@ -76,12 +79,17 @@ fn run_witness_generator( cmd.run().context(MSG_RUNNING_WITNESS_GENERATOR_ERR) } -fn run_witness_vector_generator(shell: &Shell, chain: &ChainConfig) -> anyhow::Result<()> { +fn run_witness_vector_generator( + shell: &Shell, + chain: &ChainConfig, + args: WitnessVectorGeneratorArgs, +) -> anyhow::Result<()> { logger::info(MSG_RUNNING_WITNESS_VECTOR_GENERATOR); let config_path = chain.path_to_general_config(); let secrets_path = chain.path_to_secrets_config(); - let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_witness_vector_generator -- --config-path={config_path} --secrets-path={secrets_path}")); + let threads = args.threads.unwrap_or(1).to_string(); + let mut cmd = Cmd::new(cmd!(shell, "cargo run --release --bin zksync_witness_vector_generator -- --config-path={config_path} --secrets-path={secrets_path} --threads={threads}")); cmd = cmd.with_force_run(); cmd.run().context(MSG_RUNNING_WITNESS_VECTOR_GENERATOR_ERR) } diff --git a/zk_toolbox/crates/zk_inception/src/messages.rs b/zk_toolbox/crates/zk_inception/src/messages.rs index 4e1ad9074389..710290158cc6 100644 --- a/zk_toolbox/crates/zk_inception/src/messages.rs +++ b/zk_toolbox/crates/zk_inception/src/messages.rs @@ -283,6 +283,8 @@ pub(super) const MSG_BELLMAN_CUDA_ORIGIN_SELECT: &str = "Select the origin of bellman-cuda repository"; pub(super) const MSG_BELLMAN_CUDA_SELECTION_CLONE: &str = "Clone for me (recommended)"; pub(super) const MSG_BELLMAN_CUDA_SELECTION_PATH: &str = "I have the code already"; +pub(super) const MSG_CLOUD_TYPE_PROMPT: &str = "Select the cloud type:"; +pub(super) const MSG_THREADS_PROMPT: &str = "Provide the number of threads:"; pub(super) fn msg_bucket_created(bucket_name: &str) -> String { format!("Bucket created successfully with url: gs://{bucket_name}") From c9f76e571e5570d2c4194feee03bb260b24c378f Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Tue, 30 Jul 2024 11:49:10 +0400 Subject: [PATCH 2/4] feat(vlog): Implement otlp guard with force flush on drop (#2536) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Improves the `ObservabilityGuard` so that it flushes both sentry & otlp events on drop. ## Why ❔ Without it, some events (at least for otlp) may be missed if the application exits right after events were produced. ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --- core/lib/vlog/src/lib.rs | 63 ++++++++++++++++++++++++-- core/lib/vlog/src/opentelemetry/mod.rs | 8 ++-- 2 files changed, 64 insertions(+), 7 deletions(-) diff --git a/core/lib/vlog/src/lib.rs b/core/lib/vlog/src/lib.rs index 5633f20f5882..aebd413b749d 100644 --- a/core/lib/vlog/src/lib.rs +++ b/core/lib/vlog/src/lib.rs @@ -1,6 +1,8 @@ //! This crate contains the observability subsystem. //! It is responsible for providing a centralized interface for consistent observability configuration. +use std::time::Duration; + use ::sentry::ClientInitGuard; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; @@ -23,7 +25,53 @@ pub struct ObservabilityBuilder { /// Guard for the observability subsystem. /// Releases configured integrations upon being dropped. pub struct ObservabilityGuard { - _sentry_guard: Option, + /// Opentelemetry provider. Can be used to force flush spans. + otlp_provider: Option, + sentry_guard: Option, +} + +impl ObservabilityGuard { + /// Forces flushing of pending events. + /// This method is blocking. + pub fn force_flush(&self) { + // We don't want to wait for too long. + const FLUSH_TIMEOUT: Duration = Duration::from_secs(1); + + if let Some(sentry_guard) = &self.sentry_guard { + sentry_guard.flush(Some(FLUSH_TIMEOUT)); + } + + if let Some(provider) = &self.otlp_provider { + for result in provider.force_flush() { + if let Err(err) = result { + tracing::warn!("Flushing the spans failed: {err:?}"); + } + } + } + } + + /// Shutdown the observability subsystem. + /// It will stop the background tasks like collec + pub fn shutdown(&self) { + // We don't want to wait for too long. + const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(1); + + if let Some(sentry_guard) = &self.sentry_guard { + sentry_guard.close(Some(SHUTDOWN_TIMEOUT)); + } + if let Some(provider) = &self.otlp_provider { + if let Err(err) = provider.shutdown() { + tracing::warn!("Shutting down the provider failed: {err:?}"); + } + } + } +} + +impl Drop for ObservabilityGuard { + fn drop(&mut self) { + self.force_flush(); + self.shutdown(); + } } impl std::fmt::Debug for ObservabilityGuard { @@ -62,16 +110,23 @@ impl ObservabilityBuilder { // Later we may want to enforce each layer to have its own filter. let global_filter = logs.build_filter(); + let logs_layer = logs.into_layer(); + let (otlp_provider, otlp_layer) = self + .opentelemetry_layer + .map(|layer| layer.into_layer()) + .unzip(); + tracing_subscriber::registry() .with(global_filter) - .with(logs.into_layer()) - .with(self.opentelemetry_layer.map(|layer| layer.into_layer())) + .with(logs_layer) + .with(otlp_layer) .init(); let sentry_guard = self.sentry.map(|sentry| sentry.install()); ObservabilityGuard { - _sentry_guard: sentry_guard, + otlp_provider, + sentry_guard, } } } diff --git a/core/lib/vlog/src/opentelemetry/mod.rs b/core/lib/vlog/src/opentelemetry/mod.rs index 64049df8ce9b..1085f6c6db06 100644 --- a/core/lib/vlog/src/opentelemetry/mod.rs +++ b/core/lib/vlog/src/opentelemetry/mod.rs @@ -108,7 +108,7 @@ impl OpenTelemetry { self } - pub(super) fn into_layer(self) -> impl Layer + pub(super) fn into_layer(self) -> (opentelemetry_sdk::trace::TracerProvider, impl Layer) where S: tracing::Subscriber + for<'span> LookupSpan<'span> + Send + Sync, { @@ -151,9 +151,11 @@ impl OpenTelemetry { let tracer = provider.tracer_builder(service_name).build(); opentelemetry::global::set_text_map_propagator(TraceContextPropagator::new()); - tracing_opentelemetry::layer() + let layer = tracing_opentelemetry::layer() .with_tracer(tracer) - .with_filter(filter) + .with_filter(filter); + + (provider, layer) } } From 2fa6bf0ffa5d7a5ff62d595a0efeff9dcd9e5a1a Mon Sep 17 00:00:00 2001 From: Artem Fomiuk <88630083+Artemka374@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:14:28 +0300 Subject: [PATCH 3/4] feat: Remove unused VKs, add docs for BWG (#2468) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ ## Why ❔ ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --------- Co-authored-by: EmilLuta --- core/lib/basic_types/src/protocol_version.rs | 1 - core/lib/config/src/configs/genesis.rs | 6 -- core/lib/config/src/testonly.rs | 3 - ...24b83027a8e050598b0cd4cfeb75e7fe89fdd.json | 16 ++++ ...9edd4367018ed40c77d9866899ab15d2abe05.json | 19 ----- ...d36e6c9d9e70dc52677c6b335b3ed4025db85.json | 23 ++++++ ...745d6bb2b76dbd3b366a177ddfc705500fa31.json | 41 ----------- ...d9773d45ef6d548f03d643007d3bc1072526.json} | 22 +----- ...40723143707_remove_redundant_keys.down.sql | 7 ++ ...0240723143707_remove_redundant_keys.up.sql | 7 ++ .../src/models/storage_protocol_version.rs | 16 +--- core/lib/dal/src/protocol_versions_dal.rs | 43 ++--------- core/lib/env_config/src/genesis.rs | 3 - core/lib/protobuf_config/src/genesis.rs | 25 ------- .../src/proto/config/genesis.proto | 4 +- core/lib/types/src/protocol_upgrade.rs | 3 - .../node/api_server/src/web3/namespaces/en.rs | 3 - core/node/eth_sender/src/eth_tx_aggregator.rs | 28 +------ core/node/genesis/src/lib.rs | 12 +-- .../ts-integration/tests/api/web3.test.ts | 5 -- etc/env/file_based/genesis.yaml | 3 - .../bin/prover_cli/src/commands/status/l1.rs | 31 +------- .../src/commitment_utils.rs | 22 +----- prover/crates/bin/witness_generator/README.md | 73 +++++++++++++++++++ ...1fc79400930dddc84e042c5a4dc8a2e8508a5.json | 23 ++++++ ...592895215e22fd4cf0dfe69b83277f8d05db3.json | 38 ---------- ...52e85f85202637916cfcf4b34c6780536f105.json | 16 ++++ ...6997fcfbc7ad688f2eee3dfab1029344d2382.json | 41 ----------- ...f029e262be45614404159908af1624349700b.json | 19 ----- ...7999388451886a3eb9b4481b55404b16b89ac.json | 20 +++++ ...40723153338_remove_redundant_keys.down.sql | 3 + ...0240723153338_remove_redundant_keys.up.sql | 3 + .../src/fri_protocol_versions_dal.rs | 52 ++----------- 33 files changed, 211 insertions(+), 420 deletions(-) create mode 100644 core/lib/dal/.sqlx/query-0d421637db03b83aa33468b7d3424b83027a8e050598b0cd4cfeb75e7fe89fdd.json delete mode 100644 core/lib/dal/.sqlx/query-11eaf115b7409feaf15aaee50839edd4367018ed40c77d9866899ab15d2abe05.json create mode 100644 core/lib/dal/.sqlx/query-d93ebd47a227a6086a5eb963c7ed36e6c9d9e70dc52677c6b335b3ed4025db85.json delete mode 100644 core/lib/dal/.sqlx/query-daed1021023a37f01ba5a1207b1745d6bb2b76dbd3b366a177ddfc705500fa31.json rename core/lib/dal/.sqlx/{query-33b1fbb1e80c3815d30da5854c866d2fe2908a22e933b2f25ce6b4357e51ed9b.json => query-e89e8cc58a2078157d06f3064ccad9773d45ef6d548f03d643007d3bc1072526.json} (54%) create mode 100644 core/lib/dal/migrations/20240723143707_remove_redundant_keys.down.sql create mode 100644 core/lib/dal/migrations/20240723143707_remove_redundant_keys.up.sql create mode 100644 prover/crates/lib/prover_dal/.sqlx/query-4f26bae35dd959448d9728ef7321fc79400930dddc84e042c5a4dc8a2e8508a5.json delete mode 100644 prover/crates/lib/prover_dal/.sqlx/query-542af2ff4259182310363ac0213592895215e22fd4cf0dfe69b83277f8d05db3.json create mode 100644 prover/crates/lib/prover_dal/.sqlx/query-5da848354a84b20ae3f0240f6a352e85f85202637916cfcf4b34c6780536f105.json delete mode 100644 prover/crates/lib/prover_dal/.sqlx/query-c173743af526d8150b6091ea52e6997fcfbc7ad688f2eee3dfab1029344d2382.json delete mode 100644 prover/crates/lib/prover_dal/.sqlx/query-d16278c6025eb3a205266fb5273f029e262be45614404159908af1624349700b.json create mode 100644 prover/crates/lib/prover_dal/.sqlx/query-ed0f22d3d2c8b0d9bd1b4360a0f7999388451886a3eb9b4481b55404b16b89ac.json create mode 100644 prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.down.sql create mode 100644 prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.up.sql diff --git a/core/lib/basic_types/src/protocol_version.rs b/core/lib/basic_types/src/protocol_version.rs index f0d12436e3b8..d4300fba3f80 100644 --- a/core/lib/basic_types/src/protocol_version.rs +++ b/core/lib/basic_types/src/protocol_version.rs @@ -238,7 +238,6 @@ impl Detokenize for VerifierParams { #[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Serialize, Deserialize)] pub struct L1VerifierConfig { - pub params: VerifierParams, pub recursion_scheduler_level_vk_hash: H256, } diff --git a/core/lib/config/src/configs/genesis.rs b/core/lib/config/src/configs/genesis.rs index 0f4d39732f9c..ba3839d66eea 100644 --- a/core/lib/config/src/configs/genesis.rs +++ b/core/lib/config/src/configs/genesis.rs @@ -19,9 +19,6 @@ pub struct GenesisConfig { pub default_aa_hash: Option, pub l1_chain_id: L1ChainId, pub l2_chain_id: L2ChainId, - pub recursion_node_level_vk_hash: H256, - pub recursion_leaf_level_vk_hash: H256, - pub recursion_circuits_set_vks_hash: H256, pub recursion_scheduler_level_vk_hash: H256, pub fee_account: Address, pub dummy_verifier: bool, @@ -35,9 +32,6 @@ impl GenesisConfig { rollup_last_leaf_index: Some(26), recursion_scheduler_level_vk_hash: H256::repeat_byte(0x02), fee_account: Default::default(), - recursion_node_level_vk_hash: H256::repeat_byte(0x03), - recursion_leaf_level_vk_hash: H256::repeat_byte(0x04), - recursion_circuits_set_vks_hash: H256::repeat_byte(0x05), genesis_commitment: Some(H256::repeat_byte(0x17)), bootloader_hash: Default::default(), default_aa_hash: Default::default(), diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs index f3d6b98491be..d21b1ca64387 100644 --- a/core/lib/config/src/testonly.rs +++ b/core/lib/config/src/testonly.rs @@ -704,10 +704,7 @@ impl Distribution for EncodeDist { fee_account: rng.gen(), l1_chain_id: L1ChainId(self.sample(rng)), l2_chain_id: L2ChainId::default(), - recursion_node_level_vk_hash: rng.gen(), - recursion_leaf_level_vk_hash: rng.gen(), recursion_scheduler_level_vk_hash: rng.gen(), - recursion_circuits_set_vks_hash: rng.gen(), dummy_verifier: rng.gen(), l1_batch_commit_data_generator_mode: match rng.gen_range(0..2) { 0 => L1BatchCommitmentMode::Rollup, diff --git a/core/lib/dal/.sqlx/query-0d421637db03b83aa33468b7d3424b83027a8e050598b0cd4cfeb75e7fe89fdd.json b/core/lib/dal/.sqlx/query-0d421637db03b83aa33468b7d3424b83027a8e050598b0cd4cfeb75e7fe89fdd.json new file mode 100644 index 000000000000..5e10786c7e3f --- /dev/null +++ b/core/lib/dal/.sqlx/query-0d421637db03b83aa33468b7d3424b83027a8e050598b0cd4cfeb75e7fe89fdd.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n protocol_patches (minor, patch, recursion_scheduler_level_vk_hash, created_at)\n VALUES\n ($1, $2, $3, NOW())\n ON CONFLICT DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Int4", + "Bytea" + ] + }, + "nullable": [] + }, + "hash": "0d421637db03b83aa33468b7d3424b83027a8e050598b0cd4cfeb75e7fe89fdd" +} diff --git a/core/lib/dal/.sqlx/query-11eaf115b7409feaf15aaee50839edd4367018ed40c77d9866899ab15d2abe05.json b/core/lib/dal/.sqlx/query-11eaf115b7409feaf15aaee50839edd4367018ed40c77d9866899ab15d2abe05.json deleted file mode 100644 index fb1be26d15c4..000000000000 --- a/core/lib/dal/.sqlx/query-11eaf115b7409feaf15aaee50839edd4367018ed40c77d9866899ab15d2abe05.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n protocol_patches (\n minor,\n patch,\n recursion_scheduler_level_vk_hash,\n recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash,\n recursion_circuits_set_vks_hash,\n created_at\n )\n VALUES\n ($1, $2, $3, $4, $5, $6, NOW())\n ON CONFLICT DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Int4", - "Bytea", - "Bytea", - "Bytea", - "Bytea" - ] - }, - "nullable": [] - }, - "hash": "11eaf115b7409feaf15aaee50839edd4367018ed40c77d9866899ab15d2abe05" -} diff --git a/core/lib/dal/.sqlx/query-d93ebd47a227a6086a5eb963c7ed36e6c9d9e70dc52677c6b335b3ed4025db85.json b/core/lib/dal/.sqlx/query-d93ebd47a227a6086a5eb963c7ed36e6c9d9e70dc52677c6b335b3ed4025db85.json new file mode 100644 index 000000000000..0fd16adc474d --- /dev/null +++ b/core/lib/dal/.sqlx/query-d93ebd47a227a6086a5eb963c7ed36e6c9d9e70dc52677c6b335b3ed4025db85.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n recursion_scheduler_level_vk_hash\n FROM\n protocol_patches\n WHERE\n minor = $1\n AND patch = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "recursion_scheduler_level_vk_hash", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "d93ebd47a227a6086a5eb963c7ed36e6c9d9e70dc52677c6b335b3ed4025db85" +} diff --git a/core/lib/dal/.sqlx/query-daed1021023a37f01ba5a1207b1745d6bb2b76dbd3b366a177ddfc705500fa31.json b/core/lib/dal/.sqlx/query-daed1021023a37f01ba5a1207b1745d6bb2b76dbd3b366a177ddfc705500fa31.json deleted file mode 100644 index 00152a612cd9..000000000000 --- a/core/lib/dal/.sqlx/query-daed1021023a37f01ba5a1207b1745d6bb2b76dbd3b366a177ddfc705500fa31.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n recursion_scheduler_level_vk_hash,\n recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash,\n recursion_circuits_set_vks_hash\n FROM\n protocol_patches\n WHERE\n minor = $1\n AND patch = $2\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "recursion_scheduler_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "recursion_node_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "recursion_leaf_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 3, - "name": "recursion_circuits_set_vks_hash", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int4", - "Int4" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "daed1021023a37f01ba5a1207b1745d6bb2b76dbd3b366a177ddfc705500fa31" -} diff --git a/core/lib/dal/.sqlx/query-33b1fbb1e80c3815d30da5854c866d2fe2908a22e933b2f25ce6b4357e51ed9b.json b/core/lib/dal/.sqlx/query-e89e8cc58a2078157d06f3064ccad9773d45ef6d548f03d643007d3bc1072526.json similarity index 54% rename from core/lib/dal/.sqlx/query-33b1fbb1e80c3815d30da5854c866d2fe2908a22e933b2f25ce6b4357e51ed9b.json rename to core/lib/dal/.sqlx/query-e89e8cc58a2078157d06f3064ccad9773d45ef6d548f03d643007d3bc1072526.json index bb38503cc353..68b595b50274 100644 --- a/core/lib/dal/.sqlx/query-33b1fbb1e80c3815d30da5854c866d2fe2908a22e933b2f25ce6b4357e51ed9b.json +++ b/core/lib/dal/.sqlx/query-e89e8cc58a2078157d06f3064ccad9773d45ef6d548f03d643007d3bc1072526.json @@ -1,6 +1,6 @@ { "db_name": "PostgreSQL", - "query": "\n SELECT\n protocol_versions.id AS \"minor!\",\n protocol_versions.timestamp,\n protocol_versions.bootloader_code_hash,\n protocol_versions.default_account_code_hash,\n protocol_patches.patch,\n protocol_patches.recursion_scheduler_level_vk_hash,\n protocol_patches.recursion_node_level_vk_hash,\n protocol_patches.recursion_leaf_level_vk_hash,\n protocol_patches.recursion_circuits_set_vks_hash\n FROM\n protocol_versions\n JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id\n WHERE\n id = $1\n ORDER BY\n protocol_patches.patch DESC\n LIMIT\n 1\n ", + "query": "\n SELECT\n protocol_versions.id AS \"minor!\",\n protocol_versions.timestamp,\n protocol_versions.bootloader_code_hash,\n protocol_versions.default_account_code_hash,\n protocol_patches.patch,\n protocol_patches.recursion_scheduler_level_vk_hash\n FROM\n protocol_versions\n JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id\n WHERE\n id = $1\n ORDER BY\n protocol_patches.patch DESC\n LIMIT\n 1\n ", "describe": { "columns": [ { @@ -32,21 +32,6 @@ "ordinal": 5, "name": "recursion_scheduler_level_vk_hash", "type_info": "Bytea" - }, - { - "ordinal": 6, - "name": "recursion_node_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 7, - "name": "recursion_leaf_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 8, - "name": "recursion_circuits_set_vks_hash", - "type_info": "Bytea" } ], "parameters": { @@ -60,11 +45,8 @@ false, false, false, - false, - false, - false, false ] }, - "hash": "33b1fbb1e80c3815d30da5854c866d2fe2908a22e933b2f25ce6b4357e51ed9b" + "hash": "e89e8cc58a2078157d06f3064ccad9773d45ef6d548f03d643007d3bc1072526" } diff --git a/core/lib/dal/migrations/20240723143707_remove_redundant_keys.down.sql b/core/lib/dal/migrations/20240723143707_remove_redundant_keys.down.sql new file mode 100644 index 000000000000..7e4d329b5c16 --- /dev/null +++ b/core/lib/dal/migrations/20240723143707_remove_redundant_keys.down.sql @@ -0,0 +1,7 @@ +ALTER TABLE protocol_versions ALTER COLUMN recursion_node_level_vk_hash SET NOT NULL; +ALTER TABLE protocol_versions ALTER COLUMN recursion_leaf_level_vk_hash SET NOT NULL; +ALTER TABLE protocol_versions ALTER COLUMN recursion_circuits_set_vks_hash SET NOT NULL; + +ALTER TABLE protocol_patches ALTER COLUMN recursion_node_level_vk_hash SET NOT NULL; +ALTER TABLE protocol_patches ALTER COLUMN recursion_leaf_level_vk_hash SET NOT NULL; +ALTER TABLE protocol_patches ALTER COLUMN recursion_circuits_set_vks_hash SET NOT NULL; diff --git a/core/lib/dal/migrations/20240723143707_remove_redundant_keys.up.sql b/core/lib/dal/migrations/20240723143707_remove_redundant_keys.up.sql new file mode 100644 index 000000000000..a0bcb3a65789 --- /dev/null +++ b/core/lib/dal/migrations/20240723143707_remove_redundant_keys.up.sql @@ -0,0 +1,7 @@ +ALTER TABLE protocol_versions ALTER COLUMN recursion_node_level_vk_hash DROP NOT NULL; +ALTER TABLE protocol_versions ALTER COLUMN recursion_leaf_level_vk_hash DROP NOT NULL; +ALTER TABLE protocol_versions ALTER COLUMN recursion_circuits_set_vks_hash DROP NOT NULL; + +ALTER TABLE protocol_patches ALTER COLUMN recursion_node_level_vk_hash DROP NOT NULL; +ALTER TABLE protocol_patches ALTER COLUMN recursion_leaf_level_vk_hash DROP NOT NULL; +ALTER TABLE protocol_patches ALTER COLUMN recursion_circuits_set_vks_hash DROP NOT NULL; diff --git a/core/lib/dal/src/models/storage_protocol_version.rs b/core/lib/dal/src/models/storage_protocol_version.rs index 7ac6d70f38c9..c19fa560b67c 100644 --- a/core/lib/dal/src/models/storage_protocol_version.rs +++ b/core/lib/dal/src/models/storage_protocol_version.rs @@ -4,7 +4,7 @@ use zksync_contracts::BaseSystemContractsHashes; use zksync_types::{ api, protocol_upgrade::{self, ProtocolUpgradeTx}, - protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VerifierParams, VersionPatch}, + protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VersionPatch}, H256, }; @@ -14,9 +14,6 @@ pub struct StorageProtocolVersion { pub patch: i32, pub timestamp: i64, pub recursion_scheduler_level_vk_hash: Vec, - pub recursion_node_level_vk_hash: Vec, - pub recursion_leaf_level_vk_hash: Vec, - pub recursion_circuits_set_vks_hash: Vec, pub bootloader_code_hash: Vec, pub default_account_code_hash: Vec, } @@ -32,17 +29,6 @@ pub(crate) fn protocol_version_from_storage( }, timestamp: storage_version.timestamp as u64, l1_verifier_config: L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: H256::from_slice( - &storage_version.recursion_node_level_vk_hash, - ), - recursion_leaf_level_vk_hash: H256::from_slice( - &storage_version.recursion_leaf_level_vk_hash, - ), - recursion_circuits_set_vks_hash: H256::from_slice( - &storage_version.recursion_circuits_set_vks_hash, - ), - }, recursion_scheduler_level_vk_hash: H256::from_slice( &storage_version.recursion_scheduler_level_vk_hash, ), diff --git a/core/lib/dal/src/protocol_versions_dal.rs b/core/lib/dal/src/protocol_versions_dal.rs index 212be734f0b3..0d17044e6c51 100644 --- a/core/lib/dal/src/protocol_versions_dal.rs +++ b/core/lib/dal/src/protocol_versions_dal.rs @@ -9,7 +9,7 @@ use zksync_db_connection::{ }; use zksync_types::{ protocol_upgrade::{ProtocolUpgradeTx, ProtocolVersion}, - protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VerifierParams, VersionPatch}, + protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VersionPatch}, ProtocolVersionId, H256, }; @@ -71,17 +71,9 @@ impl ProtocolVersionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - protocol_patches ( - minor, - patch, - recursion_scheduler_level_vk_hash, - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash, - created_at - ) + protocol_patches (minor, patch, recursion_scheduler_level_vk_hash, created_at) VALUES - ($1, $2, $3, $4, $5, $6, NOW()) + ($1, $2, $3, NOW()) ON CONFLICT DO NOTHING "#, version.minor as i32, @@ -89,18 +81,6 @@ impl ProtocolVersionsDal<'_, '_> { l1_verifier_config .recursion_scheduler_level_vk_hash .as_bytes(), - l1_verifier_config - .params - .recursion_node_level_vk_hash - .as_bytes(), - l1_verifier_config - .params - .recursion_leaf_level_vk_hash - .as_bytes(), - l1_verifier_config - .params - .recursion_circuits_set_vks_hash - .as_bytes(), ) .instrument("save_protocol_version#patch") .with_arg("version", &version) @@ -255,10 +235,7 @@ impl ProtocolVersionsDal<'_, '_> { protocol_versions.bootloader_code_hash, protocol_versions.default_account_code_hash, protocol_patches.patch, - protocol_patches.recursion_scheduler_level_vk_hash, - protocol_patches.recursion_node_level_vk_hash, - protocol_patches.recursion_leaf_level_vk_hash, - protocol_patches.recursion_circuits_set_vks_hash + protocol_patches.recursion_scheduler_level_vk_hash FROM protocol_versions JOIN protocol_patches ON protocol_patches.minor = protocol_versions.id @@ -291,10 +268,7 @@ impl ProtocolVersionsDal<'_, '_> { let row = sqlx::query!( r#" SELECT - recursion_scheduler_level_vk_hash, - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash + recursion_scheduler_level_vk_hash FROM protocol_patches WHERE @@ -308,13 +282,6 @@ impl ProtocolVersionsDal<'_, '_> { .await .unwrap()?; Some(L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: H256::from_slice(&row.recursion_node_level_vk_hash), - recursion_leaf_level_vk_hash: H256::from_slice(&row.recursion_leaf_level_vk_hash), - recursion_circuits_set_vks_hash: H256::from_slice( - &row.recursion_circuits_set_vks_hash, - ), - }, recursion_scheduler_level_vk_hash: H256::from_slice( &row.recursion_scheduler_level_vk_hash, ), diff --git a/core/lib/env_config/src/genesis.rs b/core/lib/env_config/src/genesis.rs index 646ad0dba757..77953c59e9ac 100644 --- a/core/lib/env_config/src/genesis.rs +++ b/core/lib/env_config/src/genesis.rs @@ -70,9 +70,6 @@ impl FromEnv for GenesisConfig { default_aa_hash: state_keeper.default_aa_hash, l1_chain_id: network_config.network.chain_id(), l2_chain_id: network_config.zksync_network_id, - recursion_node_level_vk_hash: contracts_config.fri_recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash: contracts_config.fri_recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash: H256::zero(), recursion_scheduler_level_vk_hash: contracts_config.snark_wrapper_vk_hash, fee_account: state_keeper .fee_account_addr diff --git a/core/lib/protobuf_config/src/genesis.rs b/core/lib/protobuf_config/src/genesis.rs index 52045ed9dbed..13872d1ab95a 100644 --- a/core/lib/protobuf_config/src/genesis.rs +++ b/core/lib/protobuf_config/src/genesis.rs @@ -74,19 +74,6 @@ impl ProtoRepr for proto::Genesis { l2_chain_id: required(&self.l2_chain_id) .and_then(|x| L2ChainId::try_from(*x).map_err(|a| anyhow::anyhow!(a))) .context("l2_chain_id")?, - recursion_node_level_vk_hash: required(&prover.recursion_node_level_vk_hash) - .and_then(|x| parse_h256(x)) - .context("recursion_node_level_vk_hash")?, - recursion_leaf_level_vk_hash: required(&prover.recursion_leaf_level_vk_hash) - .and_then(|x| parse_h256(x)) - .context("recursion_leaf_level_vk_hash")?, - recursion_circuits_set_vks_hash: prover - .recursion_circuits_set_vks_hash - .as_ref() - .map(|x| parse_h256(x)) - .transpose() - .context("recursion_circuits_set_vks_hash")? - .unwrap_or_default(), recursion_scheduler_level_vk_hash: required(&prover.recursion_scheduler_level_vk_hash) .and_then(|x| parse_h256(x)) .context("recursion_scheduler_level_vk_hash")?, @@ -120,18 +107,6 @@ impl ProtoRepr for proto::Genesis { "{:?}", this.recursion_scheduler_level_vk_hash )), - recursion_node_level_vk_hash: Some(format!( - "{:?}", - this.recursion_node_level_vk_hash - )), - recursion_leaf_level_vk_hash: Some(format!( - "{:?}", - this.recursion_leaf_level_vk_hash - )), - recursion_circuits_set_vks_hash: Some(format!( - "{:?}", - this.recursion_circuits_set_vks_hash - )), dummy_verifier: Some(this.dummy_verifier), }), l1_batch_commit_data_generator_mode: Some( diff --git a/core/lib/protobuf_config/src/proto/config/genesis.proto b/core/lib/protobuf_config/src/proto/config/genesis.proto index be3c420b6ab1..6e679d865d92 100644 --- a/core/lib/protobuf_config/src/proto/config/genesis.proto +++ b/core/lib/protobuf_config/src/proto/config/genesis.proto @@ -9,10 +9,8 @@ enum L1BatchCommitDataGeneratorMode { message Prover { optional string recursion_scheduler_level_vk_hash = 1; // required; H256 - optional string recursion_node_level_vk_hash = 2; // required; H256 - optional string recursion_leaf_level_vk_hash = 3; // required; H256 - optional string recursion_circuits_set_vks_hash = 4; // required; H256 optional bool dummy_verifier = 5; + reserved 2, 3, 4; reserved "recursion_node_level_vk_hash", "recursion_leaf_level_vk_hash", "recursion_circuits_set_vks_hash"; } diff --git a/core/lib/types/src/protocol_upgrade.rs b/core/lib/types/src/protocol_upgrade.rs index 674996260204..bc9bd7667e82 100644 --- a/core/lib/types/src/protocol_upgrade.rs +++ b/core/lib/types/src/protocol_upgrade.rs @@ -288,9 +288,6 @@ impl ProtocolVersion { version: upgrade.version, timestamp: upgrade.timestamp, l1_verifier_config: L1VerifierConfig { - params: upgrade - .verifier_params - .unwrap_or(self.l1_verifier_config.params), recursion_scheduler_level_vk_hash: new_scheduler_vk_hash .unwrap_or(self.l1_verifier_config.recursion_scheduler_level_vk_hash), }, diff --git a/core/node/api_server/src/web3/namespaces/en.rs b/core/node/api_server/src/web3/namespaces/en.rs index 5f635b527b9d..17175affa0f6 100644 --- a/core/node/api_server/src/web3/namespaces/en.rs +++ b/core/node/api_server/src/web3/namespaces/en.rs @@ -151,9 +151,6 @@ impl EnNamespace { default_aa_hash: Some(genesis_batch.header.base_system_contracts_hashes.default_aa), l1_chain_id: self.state.api_config.l1_chain_id, l2_chain_id: self.state.api_config.l2_chain_id, - recursion_node_level_vk_hash: verifier_config.params.recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash: verifier_config.params.recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash: Default::default(), recursion_scheduler_level_vk_hash: verifier_config.recursion_scheduler_level_vk_hash, fee_account, dummy_verifier: self.state.api_config.dummy_verifier, diff --git a/core/node/eth_sender/src/eth_tx_aggregator.rs b/core/node/eth_sender/src/eth_tx_aggregator.rs index 25d57b8cee39..89533432ef83 100644 --- a/core/node/eth_sender/src/eth_tx_aggregator.rs +++ b/core/node/eth_sender/src/eth_tx_aggregator.rs @@ -18,7 +18,7 @@ use zksync_types::{ eth_sender::{EthTx, EthTxBlobSidecar, EthTxBlobSidecarV1, SidecarBlobV1}, ethabi::{Function, Token}, l2_to_l1_log::UserL2ToL1Log, - protocol_version::{L1VerifierConfig, VerifierParams, PACKED_SEMVER_MINOR_MASK}, + protocol_version::{L1VerifierConfig, PACKED_SEMVER_MINOR_MASK}, pubdata_da::PubdataDA, web3::{contract::Error as Web3ContractError, BlockNumber}, Address, L2ChainId, ProtocolVersionId, H256, U256, @@ -34,9 +34,9 @@ use crate::{ /// Data queried from L1 using multicall contract. #[derive(Debug)] +#[allow(dead_code)] pub struct MulticallData { pub base_system_contracts_hashes: BaseSystemContractsHashes, - pub verifier_params: VerifierParams, pub verifier_address: Address, pub protocol_version_id: ProtocolVersionId, } @@ -264,26 +264,7 @@ impl EthTxAggregator { default_aa, }; - let multicall3_verifier_params = - Multicall3Result::from_token(call_results_iterator.next().unwrap())?.return_data; - if multicall3_verifier_params.len() != 96 { - return Err(EthSenderError::Parse(Web3ContractError::InvalidOutputType( - format!( - "multicall3 verifier params data is not of the len of 96: {:?}", - multicall3_default_aa - ), - ))); - } - let recursion_node_level_vk_hash = H256::from_slice(&multicall3_verifier_params[..32]); - let recursion_leaf_level_vk_hash = - H256::from_slice(&multicall3_verifier_params[32..64]); - let recursion_circuits_set_vks_hash = - H256::from_slice(&multicall3_verifier_params[64..]); - let verifier_params = VerifierParams { - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash, - }; + call_results_iterator.next().unwrap(); let multicall3_verifier_address = Multicall3Result::from_token(call_results_iterator.next().unwrap())?.return_data; @@ -319,7 +300,6 @@ impl EthTxAggregator { return Ok(MulticallData { base_system_contracts_hashes, - verifier_params, verifier_address, protocol_version_id, }); @@ -347,7 +327,6 @@ impl EthTxAggregator { ) -> Result<(), EthSenderError> { let MulticallData { base_system_contracts_hashes, - verifier_params, verifier_address, protocol_version_id, } = self.get_multicall_data().await.map_err(|err| { @@ -364,7 +343,6 @@ impl EthTxAggregator { err })?; let l1_verifier_config = L1VerifierConfig { - params: verifier_params, recursion_scheduler_level_vk_hash, }; if let Some(agg_op) = self diff --git a/core/node/genesis/src/lib.rs b/core/node/genesis/src/lib.rs index a04153a63fc6..7ff811f85343 100644 --- a/core/node/genesis/src/lib.rs +++ b/core/node/genesis/src/lib.rs @@ -17,7 +17,7 @@ use zksync_types::{ commitment::{CommitmentInput, L1BatchCommitment}, fee_model::BatchFeeInput, protocol_upgrade::decode_set_chain_id_event, - protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VerifierParams}, + protocol_version::{L1VerifierConfig, ProtocolSemanticVersion}, system_contracts::get_system_smart_contracts, web3::{BlockNumber, FilterBuilder}, AccountTreeId, Address, L1BatchNumber, L2BlockNumber, L2ChainId, ProtocolVersion, @@ -176,11 +176,6 @@ pub fn mock_genesis_config() -> GenesisConfig { default_aa_hash: Some(base_system_contracts_hashes.default_aa), l1_chain_id: L1ChainId(9), l2_chain_id: L2ChainId::default(), - recursion_node_level_vk_hash: first_l1_verifier_config.params.recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash: first_l1_verifier_config.params.recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash: first_l1_verifier_config - .params - .recursion_circuits_set_vks_hash, recursion_scheduler_level_vk_hash: first_l1_verifier_config .recursion_scheduler_level_vk_hash, fee_account: Default::default(), @@ -196,11 +191,6 @@ pub async fn insert_genesis_batch( ) -> Result { let mut transaction = storage.start_transaction().await?; let verifier_config = L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: genesis_params.config.recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash: genesis_params.config.recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash: H256::zero(), - }, recursion_scheduler_level_vk_hash: genesis_params.config.recursion_scheduler_level_vk_hash, }; diff --git a/core/tests/ts-integration/tests/api/web3.test.ts b/core/tests/ts-integration/tests/api/web3.test.ts index e78ec452b2f5..569321d548ce 100644 --- a/core/tests/ts-integration/tests/api/web3.test.ts +++ b/core/tests/ts-integration/tests/api/web3.test.ts @@ -881,11 +881,6 @@ describe('web3 API compatibility tests', () => { bootloaderCodeHash: expect.stringMatching(HEX_VALUE_REGEX), defaultAccountCodeHash: expect.stringMatching(HEX_VALUE_REGEX), verification_keys_hashes: { - params: { - recursion_circuits_set_vks_hash: expect.stringMatching(HEX_VALUE_REGEX), - recursion_leaf_level_vk_hash: expect.stringMatching(HEX_VALUE_REGEX), - recursion_node_level_vk_hash: expect.stringMatching(HEX_VALUE_REGEX) - }, recursion_scheduler_level_vk_hash: expect.stringMatching(HEX_VALUE_REGEX) }, timestamp: expect.any(Number) diff --git a/etc/env/file_based/genesis.yaml b/etc/env/file_based/genesis.yaml index 4f084648c7ca..6d7a6ba3c338 100644 --- a/etc/env/file_based/genesis.yaml +++ b/etc/env/file_based/genesis.yaml @@ -11,8 +11,5 @@ l2_chain_id: 270 fee_account: '0x0000000000000000000000000000000000000001' prover: recursion_scheduler_level_vk_hash: 0x14f97b81e54b35fe673d8708cc1a19e1ea5b5e348e12d31e39824ed4f42bbca2 - recursion_node_level_vk_hash: 0xf520cd5b37e74e19fdb369c8d676a04dce8a19457497ac6686d2bb95d94109c8 - recursion_leaf_level_vk_hash: 0xf9664f4324c1400fa5c3822d667f30e873f53f1b8033180cd15fe41c1e2355c6 - recursion_circuits_set_vks_hash: '0x0000000000000000000000000000000000000000000000000000000000000000' dummy_verifier: true l1_batch_commit_data_generator_mode: Rollup diff --git a/prover/crates/bin/prover_cli/src/commands/status/l1.rs b/prover/crates/bin/prover_cli/src/commands/status/l1.rs index 128005c309c6..16cecc103828 100644 --- a/prover/crates/bin/prover_cli/src/commands/status/l1.rs +++ b/prover/crates/bin/prover_cli/src/commands/status/l1.rs @@ -1,8 +1,5 @@ use anyhow::Context; -use zksync_basic_types::{ - protocol_version::{L1VerifierConfig, VerifierParams}, - L1BatchNumber, H256, U256, -}; +use zksync_basic_types::{protocol_version::L1VerifierConfig, L1BatchNumber, H256, U256}; use zksync_config::{ configs::{DatabaseSecrets, L1Secrets}, ContractsConfig, PostgresConfig, @@ -80,16 +77,7 @@ pub(crate) async fn run() -> anyhow::Result<()> { .call(&query_client) .await?; - let node_verifier_params: VerifierParams = CallFunctionArgs::new("getVerifierParams", ()) - .for_contract( - contracts_config.diamond_proxy_addr, - &helper::hyperchain_contract(), - ) - .call(&query_client) - .await?; - let node_l1_verifier_config = L1VerifierConfig { - params: node_verifier_params, recursion_scheduler_level_vk_hash: node_verification_key_hash, }; @@ -164,21 +152,4 @@ fn pretty_print_l1_verifier_config( node_l1_verifier_config.recursion_scheduler_level_vk_hash, db_l1_verifier_config.recursion_scheduler_level_vk_hash, ); - print_hash_comparison( - "Verification node", - node_l1_verifier_config.params.recursion_node_level_vk_hash, - db_l1_verifier_config.params.recursion_node_level_vk_hash, - ); - print_hash_comparison( - "Verification leaf", - node_l1_verifier_config.params.recursion_leaf_level_vk_hash, - db_l1_verifier_config.params.recursion_leaf_level_vk_hash, - ); - print_hash_comparison( - "Verification circuits", - node_l1_verifier_config - .params - .recursion_circuits_set_vks_hash, - db_l1_verifier_config.params.recursion_circuits_set_vks_hash, - ); } diff --git a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs index 471e76e1a680..792efba35adc 100644 --- a/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs +++ b/prover/crates/bin/vk_setup_data_generator_server_fri/src/commitment_utils.rs @@ -10,10 +10,7 @@ use zksync_prover_fri_types::circuit_definitions::{ boojum::field::goldilocks::GoldilocksField, circuit_definitions::recursion_layer::ZkSyncRecursionLayerStorageType, }; -use zksync_types::{ - protocol_version::{L1VerifierConfig, VerifierParams}, - H256, -}; +use zksync_types::{protocol_version::L1VerifierConfig, H256}; use crate::{ keystore::Keystore, @@ -26,14 +23,6 @@ static KEYSTORE: Lazy>> = Lazy::new(|| Mutex::new(None)); fn circuit_commitments(keystore: &Keystore) -> anyhow::Result { let commitments = generate_commitments(keystore).context("generate_commitments()")?; Ok(L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: H256::from_str(&commitments.node) - .context("invalid node commitment")?, - recursion_leaf_level_vk_hash: H256::from_str(&commitments.leaf) - .context("invalid leaf commitment")?, - // The base layer commitment is not used in the FRI prover verification. - recursion_circuits_set_vks_hash: H256::zero(), - }, // Instead of loading the FRI scheduler verification key here, // we load the SNARK-wrapper verification key. // This is due to the fact that these keys are used only for picking the @@ -106,12 +95,3 @@ pub fn get_cached_commitments(setup_data_path: Option) -> L1VerifierConf tracing::info!("Using cached commitments {:?}", commitments); commitments } - -#[test] -fn test_get_cached_commitments() { - let commitments = get_cached_commitments(None); - assert_eq!( - H256::zero(), - commitments.params.recursion_circuits_set_vks_hash - ) -} diff --git a/prover/crates/bin/witness_generator/README.md b/prover/crates/bin/witness_generator/README.md index dc476ca44fc3..a318a4612069 100644 --- a/prover/crates/bin/witness_generator/README.md +++ b/prover/crates/bin/witness_generator/README.md @@ -50,3 +50,76 @@ One round of prover generation consists of: Note that the very first input table (`witness_inputs`) is populated by the tree (as the input artifact for the `WitnessGeneratorJobType::BasicCircuits` is the merkle proofs) + +## Running BWG for custom batch + +After releases `prover-v15.1.0` and `core-v24.9.0` basic witness generator doesn't need access to core database anymore. +Database information now lives in input file, called `witness_inputs_.bin` generated by different core +components). + +This file is stored by prover gateway in GCS (or your choice of object storage -- check config). To access it from GCS +(assuming you have access to the bucket), run: + +```shell +gsutil cp gs://your_bucket/witness_inputs/witness_inputs_.bin +``` + +Note, that you need to have `gsutil` installed, and you need to have access to the bucket. + +Now, database needs to know about the batch and the protocol version it should use. Check the latest protocol version in +the codebase by checking const `PROVER_PROTOCOL_SEMANTIC_VERSION` or run the binary in `prover` workspace: + +```console +cargo run --bin prover_version +``` + +It will give you the latest prover protocol version in a semver format, like `0.24.2`, you need to know only minor and +patch versions. Now, go to the `prover/crates/bin/vk_setup_data_generator_server_fri/data/commitments.json` and get +`snark_wrapper` value from it. Then, you need to insert the info about protocol version into the database. First, +connect to the database, e.g. locally you can do it like that: + +```shell +psql postgres://postgres:notsecurepassword@localhost/prover_local +``` + +And run the following query: + +```shell +INSERT INTO +prover_fri_protocol_versions ( +id, +recursion_scheduler_level_vk_hash, +created_at, +protocol_version_patch +) +VALUES +(, ''::bytea, NOW(), ) +ON CONFLICT (id, protocol_version_patch) DO NOTHING + +``` + +Now, you need to insert the batch into the database. Run the following query: + +```shell +INSERT INTO +witness_inputs_fri ( +l1_batch_number, +witness_inputs_blob_url, +protocol_version, +status, +created_at, +updated_at, +protocol_version_patch +) +VALUES +(, 'witness_inputs_.bin', , 'queued', NOW(), NOW(), ) +ON CONFLICT (l1_batch_number) DO NOTHING +``` + +Finally, run the basic witness generator itself: + +```shell +API_PROMETHEUS_LISTENER_PORT=3116 zk f cargo run --release --bin zksync_witness_generator -- --round=basic_circuits +``` + +And you are good to go! diff --git a/prover/crates/lib/prover_dal/.sqlx/query-4f26bae35dd959448d9728ef7321fc79400930dddc84e042c5a4dc8a2e8508a5.json b/prover/crates/lib/prover_dal/.sqlx/query-4f26bae35dd959448d9728ef7321fc79400930dddc84e042c5a4dc8a2e8508a5.json new file mode 100644 index 000000000000..73cd88457cd1 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-4f26bae35dd959448d9728ef7321fc79400930dddc84e042c5a4dc8a2e8508a5.json @@ -0,0 +1,23 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n recursion_scheduler_level_vk_hash\n FROM\n prover_fri_protocol_versions\n WHERE\n id = $1\n AND protocol_version_patch = $2\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "recursion_scheduler_level_vk_hash", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [ + "Int4", + "Int4" + ] + }, + "nullable": [ + false + ] + }, + "hash": "4f26bae35dd959448d9728ef7321fc79400930dddc84e042c5a4dc8a2e8508a5" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-542af2ff4259182310363ac0213592895215e22fd4cf0dfe69b83277f8d05db3.json b/prover/crates/lib/prover_dal/.sqlx/query-542af2ff4259182310363ac0213592895215e22fd4cf0dfe69b83277f8d05db3.json deleted file mode 100644 index 4b3c28b9ab71..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-542af2ff4259182310363ac0213592895215e22fd4cf0dfe69b83277f8d05db3.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n recursion_scheduler_level_vk_hash,\n recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash,\n recursion_circuits_set_vks_hash\n FROM\n prover_fri_protocol_versions\n ORDER BY\n id DESC\n LIMIT\n 1\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "recursion_scheduler_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "recursion_node_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "recursion_leaf_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 3, - "name": "recursion_circuits_set_vks_hash", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "542af2ff4259182310363ac0213592895215e22fd4cf0dfe69b83277f8d05db3" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-5da848354a84b20ae3f0240f6a352e85f85202637916cfcf4b34c6780536f105.json b/prover/crates/lib/prover_dal/.sqlx/query-5da848354a84b20ae3f0240f6a352e85f85202637916cfcf4b34c6780536f105.json new file mode 100644 index 000000000000..c985254f247e --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-5da848354a84b20ae3f0240f6a352e85f85202637916cfcf4b34c6780536f105.json @@ -0,0 +1,16 @@ +{ + "db_name": "PostgreSQL", + "query": "\n INSERT INTO\n prover_fri_protocol_versions (id, recursion_scheduler_level_vk_hash, created_at, protocol_version_patch)\n VALUES\n ($1, $2, NOW(), $3)\n ON CONFLICT (id, protocol_version_patch) DO NOTHING\n ", + "describe": { + "columns": [], + "parameters": { + "Left": [ + "Int4", + "Bytea", + "Int4" + ] + }, + "nullable": [] + }, + "hash": "5da848354a84b20ae3f0240f6a352e85f85202637916cfcf4b34c6780536f105" +} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-c173743af526d8150b6091ea52e6997fcfbc7ad688f2eee3dfab1029344d2382.json b/prover/crates/lib/prover_dal/.sqlx/query-c173743af526d8150b6091ea52e6997fcfbc7ad688f2eee3dfab1029344d2382.json deleted file mode 100644 index 4f0e7a0062c0..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-c173743af526d8150b6091ea52e6997fcfbc7ad688f2eee3dfab1029344d2382.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n SELECT\n recursion_scheduler_level_vk_hash,\n recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash,\n recursion_circuits_set_vks_hash\n FROM\n prover_fri_protocol_versions\n WHERE\n id = $1\n AND protocol_version_patch = $2\n ", - "describe": { - "columns": [ - { - "ordinal": 0, - "name": "recursion_scheduler_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 1, - "name": "recursion_node_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 2, - "name": "recursion_leaf_level_vk_hash", - "type_info": "Bytea" - }, - { - "ordinal": 3, - "name": "recursion_circuits_set_vks_hash", - "type_info": "Bytea" - } - ], - "parameters": { - "Left": [ - "Int4", - "Int4" - ] - }, - "nullable": [ - false, - false, - false, - false - ] - }, - "hash": "c173743af526d8150b6091ea52e6997fcfbc7ad688f2eee3dfab1029344d2382" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-d16278c6025eb3a205266fb5273f029e262be45614404159908af1624349700b.json b/prover/crates/lib/prover_dal/.sqlx/query-d16278c6025eb3a205266fb5273f029e262be45614404159908af1624349700b.json deleted file mode 100644 index a8158a9defee..000000000000 --- a/prover/crates/lib/prover_dal/.sqlx/query-d16278c6025eb3a205266fb5273f029e262be45614404159908af1624349700b.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n INSERT INTO\n prover_fri_protocol_versions (\n id,\n recursion_scheduler_level_vk_hash,\n recursion_node_level_vk_hash,\n recursion_leaf_level_vk_hash,\n recursion_circuits_set_vks_hash,\n created_at,\n protocol_version_patch\n )\n VALUES\n ($1, $2, $3, $4, $5, NOW(), $6)\n ON CONFLICT (id, protocol_version_patch) DO NOTHING\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [ - "Int4", - "Bytea", - "Bytea", - "Bytea", - "Bytea", - "Int4" - ] - }, - "nullable": [] - }, - "hash": "d16278c6025eb3a205266fb5273f029e262be45614404159908af1624349700b" -} diff --git a/prover/crates/lib/prover_dal/.sqlx/query-ed0f22d3d2c8b0d9bd1b4360a0f7999388451886a3eb9b4481b55404b16b89ac.json b/prover/crates/lib/prover_dal/.sqlx/query-ed0f22d3d2c8b0d9bd1b4360a0f7999388451886a3eb9b4481b55404b16b89ac.json new file mode 100644 index 000000000000..d699aae174c7 --- /dev/null +++ b/prover/crates/lib/prover_dal/.sqlx/query-ed0f22d3d2c8b0d9bd1b4360a0f7999388451886a3eb9b4481b55404b16b89ac.json @@ -0,0 +1,20 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT\n recursion_scheduler_level_vk_hash\n FROM\n prover_fri_protocol_versions\n ORDER BY\n id DESC\n LIMIT\n 1\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "recursion_scheduler_level_vk_hash", + "type_info": "Bytea" + } + ], + "parameters": { + "Left": [] + }, + "nullable": [ + false + ] + }, + "hash": "ed0f22d3d2c8b0d9bd1b4360a0f7999388451886a3eb9b4481b55404b16b89ac" +} diff --git a/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.down.sql b/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.down.sql new file mode 100644 index 000000000000..7895cd2d99c0 --- /dev/null +++ b/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_node_level_vk_hash SET NOT NULL; +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_leaf_level_vk_hash SET NOT NULL; +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_circuits_set_vks_hash SET NOT NULL; diff --git a/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.up.sql b/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.up.sql new file mode 100644 index 000000000000..3eccf0b6178c --- /dev/null +++ b/prover/crates/lib/prover_dal/migrations/20240723153338_remove_redundant_keys.up.sql @@ -0,0 +1,3 @@ +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_node_level_vk_hash DROP NOT NULL; +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_leaf_level_vk_hash DROP NOT NULL; +ALTER TABLE prover_fri_protocol_versions ALTER COLUMN recursion_circuits_set_vks_hash DROP NOT NULL; diff --git a/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs b/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs index e69d36d1c26c..caf620882bc2 100644 --- a/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs +++ b/prover/crates/lib/prover_dal/src/fri_protocol_versions_dal.rs @@ -1,5 +1,5 @@ use zksync_basic_types::{ - protocol_version::{L1VerifierConfig, ProtocolSemanticVersion, VerifierParams}, + protocol_version::{L1VerifierConfig, ProtocolSemanticVersion}, H256, }; use zksync_db_connection::connection::Connection; @@ -20,35 +20,15 @@ impl FriProtocolVersionsDal<'_, '_> { sqlx::query!( r#" INSERT INTO - prover_fri_protocol_versions ( - id, - recursion_scheduler_level_vk_hash, - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash, - created_at, - protocol_version_patch - ) + prover_fri_protocol_versions (id, recursion_scheduler_level_vk_hash, created_at, protocol_version_patch) VALUES - ($1, $2, $3, $4, $5, NOW(), $6) + ($1, $2, NOW(), $3) ON CONFLICT (id, protocol_version_patch) DO NOTHING "#, id.minor as i32, l1_verifier_config .recursion_scheduler_level_vk_hash .as_bytes(), - l1_verifier_config - .params - .recursion_node_level_vk_hash - .as_bytes(), - l1_verifier_config - .params - .recursion_leaf_level_vk_hash - .as_bytes(), - l1_verifier_config - .params - .recursion_circuits_set_vks_hash - .as_bytes(), id.patch.0 as i32 ) .execute(self.storage.conn()) @@ -63,10 +43,7 @@ impl FriProtocolVersionsDal<'_, '_> { sqlx::query!( r#" SELECT - recursion_scheduler_level_vk_hash, - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash + recursion_scheduler_level_vk_hash FROM prover_fri_protocol_versions WHERE @@ -80,13 +57,6 @@ impl FriProtocolVersionsDal<'_, '_> { .await .unwrap() .map(|row| L1VerifierConfig { - params: VerifierParams { - recursion_node_level_vk_hash: H256::from_slice(&row.recursion_node_level_vk_hash), - recursion_leaf_level_vk_hash: H256::from_slice(&row.recursion_leaf_level_vk_hash), - recursion_circuits_set_vks_hash: H256::from_slice( - &row.recursion_circuits_set_vks_hash, - ), - }, recursion_scheduler_level_vk_hash: H256::from_slice( &row.recursion_scheduler_level_vk_hash, ), @@ -97,10 +67,7 @@ impl FriProtocolVersionsDal<'_, '_> { let result = sqlx::query!( r#" SELECT - recursion_scheduler_level_vk_hash, - recursion_node_level_vk_hash, - recursion_leaf_level_vk_hash, - recursion_circuits_set_vks_hash + recursion_scheduler_level_vk_hash FROM prover_fri_protocol_versions ORDER BY @@ -112,16 +79,7 @@ impl FriProtocolVersionsDal<'_, '_> { .fetch_one(self.storage.conn()) .await?; - let params = VerifierParams { - recursion_node_level_vk_hash: H256::from_slice(&result.recursion_node_level_vk_hash), - recursion_leaf_level_vk_hash: H256::from_slice(&result.recursion_leaf_level_vk_hash), - recursion_circuits_set_vks_hash: H256::from_slice( - &result.recursion_circuits_set_vks_hash, - ), - }; - Ok(L1VerifierConfig { - params, recursion_scheduler_level_vk_hash: H256::from_slice( &result.recursion_scheduler_level_vk_hash, ), From 3fac8ac62cc9ac14845f32240af9241386f4034d Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:09:39 +0300 Subject: [PATCH 4/4] feat: Revisit base config values (#2532) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ - changes some values in base config - removes `request_timeout`, `account_pks` as those are dead - adds "override" config, it's not used by code but is helpful when setting new chain ## Why ❔ - unify config values - remove dead code ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. --- core/lib/config/src/configs/api.rs | 16 +---- core/lib/config/src/testonly.rs | 2 - core/lib/env_config/src/api.rs | 9 +-- core/lib/protobuf_config/src/api.rs | 25 +------ .../src/proto/config/api.proto | 4 +- .../ts-integration/tests/contracts.test.ts | 2 +- etc/env/base/api.toml | 23 ------ etc/env/file_based/general.yaml | 72 ++++++------------- .../file_based/overrides/mainnet/general.yaml | 21 ++++++ .../file_based/overrides/testnet/general.yaml | 22 ++++++ zk_toolbox/crates/config/src/manipulations.rs | 4 ++ 11 files changed, 77 insertions(+), 123 deletions(-) create mode 100644 etc/env/file_based/overrides/mainnet/general.yaml create mode 100644 etc/env/file_based/overrides/testnet/general.yaml diff --git a/core/lib/config/src/configs/api.rs b/core/lib/config/src/configs/api.rs index e039ab10116a..ca42cd5e5f8a 100644 --- a/core/lib/config/src/configs/api.rs +++ b/core/lib/config/src/configs/api.rs @@ -9,7 +9,7 @@ use std::{ use anyhow::Context as _; use serde::{de, Deserialize, Deserializer}; -use zksync_basic_types::{Address, H256}; +use zksync_basic_types::Address; pub use crate::configs::PrometheusConfig; @@ -165,10 +165,6 @@ pub struct Web3JsonRpcConfig { /// The multiplier to use when suggesting gas price. Should be higher than one, /// otherwise if the L1 prices soar, the suggested gas price won't be sufficient to be included in block pub gas_price_scale_factor: f64, - /// Timeout for requests (in s) - pub request_timeout: Option, - /// Private keys for accounts managed by node - pub account_pks: Option>, /// The factor by which to scale the gasLimit pub estimate_gas_scale_factor: f64, /// The max possible number of gas that `eth_estimateGas` is allowed to overestimate. @@ -239,8 +235,6 @@ impl Web3JsonRpcConfig { pubsub_polling_interval: Some(200), max_nonce_ahead: 50, gas_price_scale_factor: 1.2, - request_timeout: Default::default(), - account_pks: Default::default(), estimate_gas_scale_factor: 1.2, estimate_gas_acceptable_overestimation: 1000, max_tx_size: 1000000, @@ -287,14 +281,6 @@ impl Web3JsonRpcConfig { Duration::from_millis(self.pubsub_polling_interval.unwrap_or(200)) } - pub fn request_timeout(&self) -> Duration { - Duration::from_secs(self.request_timeout.unwrap_or(10)) - } - - pub fn account_pks(&self) -> Vec { - self.account_pks.clone().unwrap_or_default() - } - pub fn vm_concurrency_limit(&self) -> usize { // The default limit is large so that it does not create a bottleneck on its own. // VM execution can still be limited by Tokio runtime parallelism and/or the number diff --git a/core/lib/config/src/testonly.rs b/core/lib/config/src/testonly.rs index d21b1ca64387..c7864e629fb1 100644 --- a/core/lib/config/src/testonly.rs +++ b/core/lib/config/src/testonly.rs @@ -68,8 +68,6 @@ impl Distribution for EncodeDist { pubsub_polling_interval: self.sample(rng), max_nonce_ahead: self.sample(rng), gas_price_scale_factor: self.sample(rng), - request_timeout: self.sample_opt(|| self.sample(rng)), - account_pks: self.sample_opt(|| self.sample_range(rng).map(|_| rng.gen()).collect()), estimate_gas_scale_factor: self.sample(rng), estimate_gas_acceptable_overestimation: self.sample(rng), max_tx_size: self.sample(rng), diff --git a/core/lib/env_config/src/api.rs b/core/lib/env_config/src/api.rs index 64d8696f50bb..c6485d54d6b0 100644 --- a/core/lib/env_config/src/api.rs +++ b/core/lib/env_config/src/api.rs @@ -49,7 +49,7 @@ mod tests { use std::num::{NonZeroU32, NonZeroUsize}; use super::*; - use crate::test_utils::{addr, hash, EnvMutex}; + use crate::test_utils::{addr, EnvMutex}; static MUTEX: EnvMutex = EnvMutex::new(); @@ -66,11 +66,6 @@ mod tests { subscriptions_limit: Some(10000), pubsub_polling_interval: Some(200), max_nonce_ahead: 5, - request_timeout: Some(10), - account_pks: Some(vec![ - hash("0x0000000000000000000000000000000000000000000000000000000000000001"), - hash("0x0000000000000000000000000000000000000000000000000000000000000002"), - ]), estimate_gas_scale_factor: 1.0f64, gas_price_scale_factor: 1.2, estimate_gas_acceptable_overestimation: 1000, @@ -130,10 +125,8 @@ mod tests { API_WEB3_JSON_RPC_PUBSUB_POLLING_INTERVAL=200 API_WEB3_JSON_RPC_MAX_NONCE_AHEAD=5 API_WEB3_JSON_RPC_GAS_PRICE_SCALE_FACTOR=1.2 - API_WEB3_JSON_RPC_REQUEST_TIMEOUT=10 API_WEB3_JSON_RPC_API_NAMESPACES=debug API_WEB3_JSON_RPC_EXTENDED_API_TRACING=true - API_WEB3_JSON_RPC_ACCOUNT_PKS="0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000002" API_WEB3_JSON_RPC_WHITELISTED_TOKENS_FOR_AA="0x0000000000000000000000000000000000000001,0x0000000000000000000000000000000000000002" API_WEB3_JSON_RPC_ESTIMATE_GAS_SCALE_FACTOR=1.0 API_WEB3_JSON_RPC_ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION=1000 diff --git a/core/lib/protobuf_config/src/api.rs b/core/lib/protobuf_config/src/api.rs index 4eac849773f3..f4718c9f7960 100644 --- a/core/lib/protobuf_config/src/api.rs +++ b/core/lib/protobuf_config/src/api.rs @@ -7,7 +7,7 @@ use zksync_protobuf::{ required, }; -use crate::{parse_h160, parse_h256, proto::api as proto}; +use crate::{parse_h160, proto::api as proto}; impl ProtoRepr for proto::Api { type Type = ApiConfig; @@ -34,19 +34,6 @@ impl ProtoRepr for proto::Web3JsonRpc { type Type = api::Web3JsonRpcConfig; fn read(&self) -> anyhow::Result { - let account_pks = self - .account_pks - .iter() - .enumerate() - .map(|(i, k)| parse_h256(k).context(i)) - .collect::, _>>() - .context("account_pks")?; - let account_pks = if account_pks.is_empty() { - None - } else { - Some(account_pks) - }; - let max_response_body_size_overrides_mb = self .max_response_body_size_overrides .iter() @@ -91,8 +78,6 @@ impl ProtoRepr for proto::Web3JsonRpc { max_nonce_ahead: *required(&self.max_nonce_ahead).context("max_nonce_ahead")?, gas_price_scale_factor: *required(&self.gas_price_scale_factor) .context("gas_price_scale_factor")?, - request_timeout: self.request_timeout, - account_pks, estimate_gas_scale_factor: *required(&self.estimate_gas_scale_factor) .context("estimate_gas_scale_factor")?, estimate_gas_acceptable_overestimation: *required( @@ -157,7 +142,7 @@ impl ProtoRepr for proto::Web3JsonRpc { .enumerate() .map(|(i, k)| parse_h160(k).context(i)) .collect::, _>>() - .context("account_pks")?, + .context("whitelisted_tokens_for_aa")?, extended_api_tracing: self.extended_api_tracing.unwrap_or_default(), api_namespaces, }) @@ -178,12 +163,6 @@ impl ProtoRepr for proto::Web3JsonRpc { pubsub_polling_interval: this.pubsub_polling_interval, max_nonce_ahead: Some(this.max_nonce_ahead), gas_price_scale_factor: Some(this.gas_price_scale_factor), - request_timeout: this.request_timeout, - account_pks: this - .account_pks - .as_ref() - .map(|keys| keys.iter().map(|k| format!("{:?}", k)).collect()) - .unwrap_or_default(), estimate_gas_scale_factor: Some(this.estimate_gas_scale_factor), estimate_gas_acceptable_overestimation: Some( this.estimate_gas_acceptable_overestimation, diff --git a/core/lib/protobuf_config/src/proto/config/api.proto b/core/lib/protobuf_config/src/proto/config/api.proto index 4fea0691f79d..e08677adc445 100644 --- a/core/lib/protobuf_config/src/proto/config/api.proto +++ b/core/lib/protobuf_config/src/proto/config/api.proto @@ -20,8 +20,6 @@ message Web3JsonRpc { optional uint64 pubsub_polling_interval = 8; // optional optional uint32 max_nonce_ahead = 9; // required optional double gas_price_scale_factor = 10; // required - optional uint64 request_timeout = 11; // seconds - repeated string account_pks = 12; // optional optional double estimate_gas_scale_factor = 13; // required optional uint32 estimate_gas_acceptable_overestimation = 14; // required optional uint64 max_tx_size = 16; // required; B @@ -43,6 +41,8 @@ message Web3JsonRpc { repeated string api_namespaces = 32; // Optional, if empty all namespaces are available optional bool extended_api_tracing = 33; // optional, default false reserved 15; reserved "l1_to_l2_transactions_compatibility_mode"; + reserved 11; reserved "request_timeout"; + reserved 12; reserved "account_pks"; } diff --git a/core/tests/ts-integration/tests/contracts.test.ts b/core/tests/ts-integration/tests/contracts.test.ts index e22385a1b278..8b0bd347ce78 100644 --- a/core/tests/ts-integration/tests/contracts.test.ts +++ b/core/tests/ts-integration/tests/contracts.test.ts @@ -74,7 +74,7 @@ describe('Smart contract behavior checks', () => { const expensiveContract = await deployContract(alice, contracts.expensive, []); // First, check that the transaction that is too expensive would be rejected by the API server. - await expect(expensiveContract.expensive(3000)).toBeRejected(); + await expect(expensiveContract.expensive(15000)).toBeRejected(); // Second, check that processable transaction may fail with "out of gas" error. // To do so, we estimate gas for arg "1" and supply it to arg "20". diff --git a/etc/env/base/api.toml b/etc/env/base/api.toml index c8e0050ac310..126dcfd7d4dd 100644 --- a/etc/env/base/api.toml +++ b/etc/env/base/api.toml @@ -18,29 +18,6 @@ pubsub_polling_interval = 200 threads_per_server = 128 max_nonce_ahead = 50 gas_price_scale_factor = 1.2 -request_timeout = 10 -account_pks = [ - "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", - "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a", - "0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6", - "0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a", - "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba", - "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e", - "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356", - "0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97", - "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6", - "0xf214f2b2cd398c806f84e317254e0f0b801d0643303237d97a22a48e01628897", - "0x701b615bbdfb9de65240bc28bd21bbc0d996645a3dd57e7b12bc2bdf6f192c82", - "0xa267530f49f8280200edf313ee7af6b827f2a8bce2897751d06a843f644967b1", - "0x47c99abed3324a2707c28affff1267e45918ec8c3f20b8aa892e8b065d2942dd", - "0xc526ee95bf44d8fc405a158bb884d9d1238d99f0612e9f33d006bb0789009aaa", - "0x8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec20e84ffb61", - "0xea6c44ac03bff858b476bba40716402b03e41b8e97e276d1baec7c37d42484a0", - "0x689af8efa8c651a91ad287602527f3af2fe9f6501a7ac4b061667b5a93e037fd", - "0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0", - "0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e" -] estimate_gas_scale_factor = 1.2 estimate_gas_acceptable_overestimation = 1000 max_tx_size = 1000000 diff --git a/etc/env/file_based/general.yaml b/etc/env/file_based/general.yaml index a36e3db2b6cd..f91e6236a1ea 100644 --- a/etc/env/file_based/general.yaml +++ b/etc/env/file_based/general.yaml @@ -7,11 +7,11 @@ postgres: db: state_keeper_db_path: ./db/main/state_keeper merkle_tree: - multi_get_chunk_size: 1000 - block_cache_size_mb: 32 - memtable_capacity_mb: 512 - stalled_writes_timeout_sec: 50 - max_l1_batches_per_iter: 50 + multi_get_chunk_size: 500 + block_cache_size_mb: 128 + memtable_capacity_mb: 256 + stalled_writes_timeout_sec: 60 + max_l1_batches_per_iter: 20 path: "./db/main/tree" mode: FULL experimental: @@ -36,46 +36,20 @@ api: filters_limit: 10000 subscriptions_limit: 10000 pubsub_polling_interval: 200 - max_nonce_ahead: 50 - gas_price_scale_factor: 1.2 - request_timeout: 10 - account_pks: - - 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - - 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d - - 0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a - - 0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6 - - 0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a - - 0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba - - 0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e - - 0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356 - - 0xdbda1821b80551c9d65939329250298aa3472ba22feea921c0cf5d620ea67b97 - - 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 - - 0xf214f2b2cd398c806f84e317254e0f0b801d0643303237d97a22a48e01628897 - - 0x701b615bbdfb9de65240bc28bd21bbc0d996645a3dd57e7b12bc2bdf6f192c82 - - 0xa267530f49f8280200edf313ee7af6b827f2a8bce2897751d06a843f644967b1 - - 0x47c99abed3324a2707c28affff1267e45918ec8c3f20b8aa892e8b065d2942dd - - 0xc526ee95bf44d8fc405a158bb884d9d1238d99f0612e9f33d006bb0789009aaa - - 0x8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec20e84ffb61 - - 0xea6c44ac03bff858b476bba40716402b03e41b8e97e276d1baec7c37d42484a0 - - 0x689af8efa8c651a91ad287602527f3af2fe9f6501a7ac4b061667b5a93e037fd - - 0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0 - - 0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e - estimate_gas_scale_factor: 1.2 - estimate_gas_acceptable_overestimation: 1000 + max_nonce_ahead: 20 + gas_price_scale_factor: 1.5 + estimate_gas_scale_factor: 1.3 + estimate_gas_acceptable_overestimation: 5000 max_tx_size: 1000000 api_namespaces: [en,eth,net,web3,zks,pubsub,debug] - max_response_body_size_overrides: - - method: eth_getTransactionReceipt # no size specified, meaning no size limit - - method: zks_getProof - size_mb: 64 state_keeper: - transaction_slots: 250 - max_allowed_l2_tx_gas_limit: 4000000000 + transaction_slots: 8192 + max_allowed_l2_tx_gas_limit: 15000000000 block_commit_deadline_ms: 2500 miniblock_commit_deadline_ms: 1000 miniblock_seal_queue_capacity: 10 miniblock_max_payload_size: 1000000 - max_single_tx_gas: 6000000 + max_single_tx_gas: 15000000 close_block_at_geometry_percentage: 0.95 close_block_at_eth_params_percentage: 0.95 close_block_at_gas_percentage: 0.95 @@ -87,24 +61,24 @@ state_keeper: pubdata_overhead_part: 1 batch_overhead_l1_gas: 800000 max_gas_per_batch: 200000000 - max_pubdata_per_batch: 100000 - fee_model_version: V1 + max_pubdata_per_batch: 500000 + fee_model_version: V2 validation_computational_gas_limit: 300000 save_call_traces: true - max_circuits_per_batch: 24100 + max_circuits_per_batch: 31100 protective_reads_persistence_enabled: true mempool: delay_interval: 100 sync_interval_ms: 10 sync_batch_size: 1000 capacity: 10000000 - stuck_tx_timeout: 86400 + stuck_tx_timeout: 172800 remove_stuck_txs: true operations_manager: delay_interval: 100 contract_verifier: - compilation_timeout: 30 + compilation_timeout: 240 polling_interval: 1000 prometheus_port: 3314 port: 3070 @@ -112,8 +86,8 @@ contract_verifier: threads_per_server: 128 circuit_breaker: - sync_interval_ms: 30000 - http_req_max_retry_number: 5 + sync_interval_ms: 120000 + http_req_max_retry_number: 10 replication_lag_limit_sec: 100 http_req_retry_interval_sec: 2 eth: @@ -124,21 +98,21 @@ eth: max_txs_in_flight: 30 proof_sending_mode: SKIP_EVERY_PROOF max_aggregated_blocks_to_commit: 1 - max_aggregated_blocks_to_execute: 10 + max_aggregated_blocks_to_execute: 45 aggregated_block_commit_deadline: 1 aggregated_block_prove_deadline: 10 aggregated_block_execute_deadline: 10 timestamp_criteria_max_allowed_lag: 30 max_eth_tx_data_size: 120000 aggregated_proof_sizes: [1] - max_aggregated_tx_gas: 4000000 + max_aggregated_tx_gas: 15000000 max_acceptable_priority_fee_in_gwei: 100000000000 pubdata_sending_mode: BLOBS gas_adjuster: default_priority_fee_per_gas: 1000000000 - max_base_fee_samples: 10000 + max_base_fee_samples: 100 pricing_formula_parameter_a: 1.5 - pricing_formula_parameter_b: 1.0005 + pricing_formula_parameter_b: 1.001 internal_l1_pricing_multiplier: 0.8 num_samples_for_blob_base_fee_estimate: 10 internal_pubdata_pricing_multiplier: 1.0 diff --git a/etc/env/file_based/overrides/mainnet/general.yaml b/etc/env/file_based/overrides/mainnet/general.yaml new file mode 100644 index 000000000000..7abe8eb54725 --- /dev/null +++ b/etc/env/file_based/overrides/mainnet/general.yaml @@ -0,0 +1,21 @@ +state_keeper: + block_commit_deadline_ms: 3600000 + minimal_l2_gas_price: 45250000 +eth: + sender: + tx_poll_period: 20 + aggregate_tx_poll_period: 2 + max_txs_in_flight: 100 + aggregated_block_commit_deadline: 300 + aggregated_block_prove_deadline: 300 + aggregated_block_execute_deadline: 300 + timestamp_criteria_max_allowed_lag: 104000 # 29h + gas_adjuster: + pricing_formula_parameter_a: 1.06 + internal_l1_pricing_multiplier: 1 + internal_pubdata_pricing_multiplier: 1.50 + poll_period: 60 +observability: + log_directives: zksync=info,zksync_state_keeper=debug,zksync_core=debug,zksync_server=debug,zksync_contract_verifier=debug,zksync_dal=debug,zksync_state=debug,zksync_utils=debug,zksync_eth_sender=debug,loadnext=debug,dev_ticker=info,vm=info,block_sizes_test=info,setup_key_generator_and_server=info,zksync_queued_job_processor=debug,slot_index_consistency_checker=debug,zksync_health_check=debug,zksync_consensus_bft=debug,zksync_consensus_network=debug,zksync_consensus_storage=debug,zksync_consensus_executor=debug, + +# remove eth_sender_wait_confirmations, eth_watcher_confirmations_for_eth_event variables diff --git a/etc/env/file_based/overrides/testnet/general.yaml b/etc/env/file_based/overrides/testnet/general.yaml new file mode 100644 index 000000000000..43a62f3f0dd8 --- /dev/null +++ b/etc/env/file_based/overrides/testnet/general.yaml @@ -0,0 +1,22 @@ +state_keeper: + block_commit_deadline_ms: 3600000 + minimal_l2_gas_price: 25000000 +eth: + sender: + tx_poll_period: 20 + aggregate_tx_poll_period: 2 + max_txs_in_flight: 100 + aggregated_block_commit_deadline: 300 + aggregated_block_prove_deadline: 300 + aggregated_block_execute_deadline: 300 + timestamp_criteria_max_allowed_lag: 104000 # 29h + gas_adjuster: + pricing_formula_parameter_a: 1.1 + internal_l1_pricing_multiplier: 1 + poll_period: 60 + watcher: + confirmations_for_eth_event: 10 +observability: + log_directives: zksync=info,zksync_state_keeper=debug,zksync_core=debug,zksync_server=debug,zksync_contract_verifier=debug,zksync_dal=debug,zksync_state=debug,zksync_utils=debug,zksync_eth_sender=debug,loadnext=debug,dev_ticker=info,vm=info,block_sizes_test=info,setup_key_generator_and_server=info,zksync_queued_job_processor=debug,slot_index_consistency_checker=debug,zksync_health_check=debug,zksync_consensus_bft=debug,zksync_consensus_network=debug,zksync_consensus_storage=debug,zksync_consensus_executor=debug, + +# remove eth_sender_wait_confirmations variable diff --git a/zk_toolbox/crates/config/src/manipulations.rs b/zk_toolbox/crates/config/src/manipulations.rs index f0497a5ba671..885447c5b173 100644 --- a/zk_toolbox/crates/config/src/manipulations.rs +++ b/zk_toolbox/crates/config/src/manipulations.rs @@ -7,6 +7,10 @@ use crate::consts::{CONFIGS_PATH, WALLETS_FILE}; pub fn copy_configs(shell: &Shell, link_to_code: &Path, target_path: &Path) -> anyhow::Result<()> { let original_configs = link_to_code.join(CONFIGS_PATH); for file in shell.read_dir(original_configs)? { + if file.is_dir() { + continue; + } + if let Some(name) = file.file_name() { // Do not copy wallets file if name != WALLETS_FILE {