diff --git a/core/lib/dal/migrations/20240522081114_create_data_availability_table.down.sql b/core/lib/dal/migrations/20240522081114_create_data_availability_table.down.sql index fd4c3d62f315..b6993d850ea5 100644 --- a/core/lib/dal/migrations/20240522081114_create_data_availability_table.down.sql +++ b/core/lib/dal/migrations/20240522081114_create_data_availability_table.down.sql @@ -1 +1 @@ -DROP TABLE data_availability; +DROP TABLE IF EXISTS data_availability; diff --git a/core/lib/dal/migrations/20240522081114_create_data_availability_table.up.sql b/core/lib/dal/migrations/20240522081114_create_data_availability_table.up.sql index ae98593a3766..037398021da6 100644 --- a/core/lib/dal/migrations/20240522081114_create_data_availability_table.up.sql +++ b/core/lib/dal/migrations/20240522081114_create_data_availability_table.up.sql @@ -1,4 +1,4 @@ -CREATE TABLE data_availability +CREATE TABLE IF NOT EXISTS data_availability ( l1_batch_number BIGINT PRIMARY KEY REFERENCES l1_batches (number) ON DELETE CASCADE, diff --git a/core/lib/default_da_clients/Cargo.toml b/core/lib/default_da_clients/Cargo.toml index 9682d4ba19c4..d376d8641800 100644 --- a/core/lib/default_da_clients/Cargo.toml +++ b/core/lib/default_da_clients/Cargo.toml @@ -11,8 +11,8 @@ categories.workspace = true [dependencies] serde = { workspace = true, features = ["derive"] } -tracing = "0.1.40" -async-trait = "0.1.74" +tracing.workspace = true +async-trait.workspace = true anyhow.workspace = true zksync_config.workspace = true diff --git a/core/lib/default_da_clients/src/lib.rs b/core/lib/default_da_clients/src/lib.rs index 96cffc760774..3aa2a18cdcec 100644 --- a/core/lib/default_da_clients/src/lib.rs +++ b/core/lib/default_da_clients/src/lib.rs @@ -1,3 +1,2 @@ -pub mod object_store; - pub mod no_da; +pub mod object_store; diff --git a/core/lib/protobuf_config/src/da_dispatcher.rs b/core/lib/protobuf_config/src/da_dispatcher.rs index 27e8eb3a4316..1cafa37a1e19 100644 --- a/core/lib/protobuf_config/src/da_dispatcher.rs +++ b/core/lib/protobuf_config/src/da_dispatcher.rs @@ -18,7 +18,7 @@ impl ProtoRepr for proto::DataAvailabilityDispatcher { Self { polling_interval_ms: this.polling_interval_ms, max_rows_to_dispatch: this.max_rows_to_dispatch, - max_retries: this.max_retries.map(|x| x as u32), + max_retries: this.max_retries.map(Into::into), } } } diff --git a/core/lib/zksync_core_leftovers/src/lib.rs b/core/lib/zksync_core_leftovers/src/lib.rs index a1aa0ae74584..9a77f595e87b 100644 --- a/core/lib/zksync_core_leftovers/src/lib.rs +++ b/core/lib/zksync_core_leftovers/src/lib.rs @@ -766,6 +766,7 @@ pub async fn initialize_components( .da_dispatcher_config .clone() .context("da_dispatcher_config")?; + // A pool with size 2 is used here because there are 2 functions within a task that execute in parallel let da_dispatcher_pool = ConnectionPool::::builder(database_secrets.master_url()?, 2) .build() diff --git a/core/node/node_framework/src/implementations/layers/da_dispatcher.rs b/core/node/node_framework/src/implementations/layers/da_dispatcher.rs index d15da3cc533f..419d33bc570c 100644 --- a/core/node/node_framework/src/implementations/layers/da_dispatcher.rs +++ b/core/node/node_framework/src/implementations/layers/da_dispatcher.rs @@ -37,6 +37,7 @@ impl WiringLayer for DataAvailabilityDispatcherLayer { async fn wire(self: Box, mut context: ServiceContext<'_>) -> Result<(), WiringError> { let master_pool_resource = context.get_resource::>().await?; + // A pool with size 2 is used here because there are 2 functions within a task that execute in parallel let master_pool = master_pool_resource.get_custom(2).await?; let da_client = context.get_resource::().await?.0;