Skip to content

Commit

Permalink
Support both 2.1 and 2.2 node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
aterentic-ethernal committed Sep 27, 2024
1 parent f82435f commit afdb56a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 1 addition & 3 deletions core/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit afdb56a

Please sign in to comment.