From afdb56ad897bbeba08e7a776187cbe5be39d1496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Terenti=C4=87?= Date: Thu, 26 Sep 2024 22:38:58 +0200 Subject: [PATCH] Support both 2.1 and 2.2 node versions --- client/src/main.rs | 2 +- core/src/consts.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index c26985ae8..3b4b61d93 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -197,7 +197,7 @@ async fn run( cfg: (&cfg).into(), identity_cfg: identity_cfg.clone(), version: format!("v{}", clap::crate_version!()), - network_version: EXPECTED_SYSTEM_VERSION[0].to_string(), + network_version: EXPECTED_SYSTEM_VERSION[1].to_string(), node_client: rpc_client.clone(), ws_clients: ws_clients.clone(), shutdown: shutdown.clone(), diff --git a/core/src/consts.rs b/core/src/consts.rs index 7fe840f7e..5e5ff5334 100644 --- a/core/src/consts.rs +++ b/core/src/consts.rs @@ -2,7 +2,7 @@ /// Expected network Node versions. First version should be the main supported version, /// while all subsequent versions should be for backward compatibility/fallback/future-proofing versions. -pub const EXPECTED_SYSTEM_VERSION: &[&str] = &["2.2"]; +pub const EXPECTED_SYSTEM_VERSION: &[&str] = &["2.1", "2.2"]; #[derive(Clone)] pub struct ExpectedNodeVariant { @@ -13,8 +13,6 @@ impl ExpectedNodeVariant { /// Checks if any of the expected versions matches provided network version. /// Since the light client uses subset of the node APIs, `matches` checks only prefix of a node version. /// This means that if expected version is `1.6`, versions `1.6.x` of the node will match. - /// Specification name is checked for exact match. - /// Since runtime `spec_version` can be changed with runtime upgrade, `spec_version` is removed. /// NOTE: Runtime compatibility check is currently not implemented. pub fn matches(&self, system_version: &str) -> bool { for supported_network_version in self.system_version {