From b9b54bd50202a8be5b3fe1975839d02d6d42fb68 Mon Sep 17 00:00:00 2001 From: timorl Date: Wed, 21 Dec 2022 10:33:25 +0100 Subject: [PATCH 1/2] Add logging about ABFT version --- finality-aleph/src/party/manager/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/finality-aleph/src/party/manager/mod.rs b/finality-aleph/src/party/manager/mod.rs index ee4081303c..a8796b311f 100644 --- a/finality-aleph/src/party/manager/mod.rs +++ b/finality-aleph/src/party/manager/mod.rs @@ -3,7 +3,7 @@ use std::{collections::HashSet, marker::PhantomData, sync::Arc}; use aleph_primitives::{AlephSessionApi, KEY_TYPE}; use async_trait::async_trait; use futures::channel::oneshot; -use log::{debug, trace, warn}; +use log::{debug, info, trace, warn}; use sc_client_api::Backend; use sp_consensus::SelectChain; use sp_keystore::CryptoStore; @@ -345,8 +345,14 @@ where { #[cfg(feature = "only_legacy")] _ if self.only_legacy() => self.legacy_subtasks(params), - Ok(version) if version == CURRENT_VERSION => self.current_subtasks(params), - Ok(version) if version == LEGACY_VERSION => self.legacy_subtasks(params), + Ok(version) if version == CURRENT_VERSION => { + info!(target: "aleph-party", "Running session with AlephBFT version {}, which is current.", version); + self.current_subtasks(params) + } + Ok(version) if version == LEGACY_VERSION => { + info!(target: "aleph-party", "Running session with AlephBFT version {}, which is legacy.", version); + self.legacy_subtasks(params) + } Ok(version) => { panic!("Unsupported version {}. Supported versions: {} or {}. Potentially outdated node.", version, LEGACY_VERSION, CURRENT_VERSION) } From 430b81e994a336289f3fbc1b3553916c6a5b871e Mon Sep 17 00:00:00 2001 From: timorl Date: Wed, 21 Dec 2022 11:31:13 +0100 Subject: [PATCH 2/2] Legacy-only log --- finality-aleph/src/party/manager/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/finality-aleph/src/party/manager/mod.rs b/finality-aleph/src/party/manager/mod.rs index a8796b311f..933cc42dce 100644 --- a/finality-aleph/src/party/manager/mod.rs +++ b/finality-aleph/src/party/manager/mod.rs @@ -344,7 +344,10 @@ where .next_session_finality_version(&BlockId::Number(last_block_of_previous_session)) { #[cfg(feature = "only_legacy")] - _ if self.only_legacy() => self.legacy_subtasks(params), + _ if self.only_legacy() => { + info!(target: "aleph-party", "Running session with legacy-only AlephBFT version."); + self.legacy_subtasks(params) + } Ok(version) if version == CURRENT_VERSION => { info!(target: "aleph-party", "Running session with AlephBFT version {}, which is current.", version); self.current_subtasks(params)