From 8ef372dd22edddf66b9503e81b9e576b628ef657 Mon Sep 17 00:00:00 2001 From: arya2 Date: Thu, 26 Oct 2023 19:19:49 -0400 Subject: [PATCH] Applies suggestions from code review --- zebra-consensus/src/config.rs | 18 +++++++++++++++--- zebra-consensus/src/router.rs | 2 +- .../configs/{v1.3.1.toml => v1.4.0.toml} | 0 3 files changed, 16 insertions(+), 4 deletions(-) rename zebrad/tests/common/configs/{v1.3.1.toml => v1.4.0.toml} (100%) diff --git a/zebra-consensus/src/config.rs b/zebra-consensus/src/config.rs index 6d5190de5b7..fec243037b3 100644 --- a/zebra-consensus/src/config.rs +++ b/zebra-consensus/src/config.rs @@ -51,13 +51,16 @@ impl From for InnerConfig { fn from(Config { checkpoint_sync }: Config) -> Self { Self { checkpoint_sync, - ..Default::default() + _debug_skip_parameter_preload: false, } } } -/// Inner consensus configuration for backwards compatibility with fields that have been removed. -#[derive(Clone, Debug, Eq, PartialEq, Default, Deserialize, Serialize)] +/// Inner consensus configuration for backwards compatibility with older `zebrad.toml` files, +/// which contain fields that have been removed. +/// +/// Rust API callers should use [`Config`]. +#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)] #[serde(deny_unknown_fields, default)] pub struct InnerConfig { /// See [`Config`] for more details. @@ -78,3 +81,12 @@ impl Default for Config { } } } + +impl Default for InnerConfig { + fn default() -> Self { + Self { + checkpoint_sync: true, + _debug_skip_parameter_preload: false, + } + } +} diff --git a/zebra-consensus/src/router.rs b/zebra-consensus/src/router.rs index 6f18d683f44..179dc487d48 100644 --- a/zebra-consensus/src/router.rs +++ b/zebra-consensus/src/router.rs @@ -235,7 +235,7 @@ where S: Service + Send + Clone + 'static, S::Future: Send + 'static, { - // Give other tasks priority before spawning the download and checkpoint tasks. + // Give other tasks priority before spawning the checkpoint task. tokio::task::yield_now().await; // Make sure the state contains the known best chain checkpoints, in a separate thread. diff --git a/zebrad/tests/common/configs/v1.3.1.toml b/zebrad/tests/common/configs/v1.4.0.toml similarity index 100% rename from zebrad/tests/common/configs/v1.3.1.toml rename to zebrad/tests/common/configs/v1.4.0.toml