From 1a00a8fd94e5b1a111e0a380d47bbec83b754b27 Mon Sep 17 00:00:00 2001 From: Krzysztof Ziobro <86822080+krzysztofziobro@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:42:22 +0200 Subject: [PATCH] A0-3340: Remove committee change digest (#1443) # Description Removal of the committee change digest. --- pallets/aleph/src/lib.rs | 22 ++-------------------- primitives/src/lib.rs | 9 --------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/pallets/aleph/src/lib.rs b/pallets/aleph/src/lib.rs index c55f2649b3..dd2cfa8cca 100644 --- a/pallets/aleph/src/lib.rs +++ b/pallets/aleph/src/lib.rs @@ -11,13 +11,12 @@ mod traits; use frame_support::{ log, - sp_runtime::{BoundToRuntimeAppPublic, DigestItem}, + sp_runtime::BoundToRuntimeAppPublic, traits::{OneSessionHandler, StorageVersion}, }; pub use pallet::*; use primitives::{ - ConsensusLog::AlephAuthorityChange, SessionIndex, Version, VersionChange, ALEPH_ENGINE_ID, - DEFAULT_FINALITY_VERSION, LEGACY_FINALITY_VERSION, + SessionIndex, Version, VersionChange, DEFAULT_FINALITY_VERSION, LEGACY_FINALITY_VERSION, }; use sp_std::prelude::*; @@ -113,23 +112,6 @@ pub mod pallet { pub(super) type FinalityScheduledVersionChange = StorageValue<_, VersionChange, OptionQuery>; - #[pallet::hooks] - impl Hooks> for Pallet { - fn on_finalize(block_number: BlockNumberFor) { - if let Some(session_change_block) = - T::SessionInfoProvider::next_session_block_number(block_number) - { - if session_change_block == block_number + 1u32.into() { - >::deposit_log(DigestItem::Consensus( - ALEPH_ENGINE_ID, - AlephAuthorityChange::(>::get()) - .encode(), - )); - } - } - } - } - impl Pallet { pub(crate) fn initialize_authorities( authorities: &[T::AuthorityId], diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index a48c3c1e7d..78d89a95db 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -261,15 +261,6 @@ pub struct VersionChange { pub session: SessionIndex, } -/// Consensus log item for Aleph. -#[cfg_attr(feature = "std", derive(Serialize))] -#[derive(Decode, Encode, PartialEq, Eq, Clone, sp_runtime::RuntimeDebug)] -pub enum ConsensusLog { - /// Change of the authorities. - #[codec(index = 1)] - AlephAuthorityChange(Vec), -} - sp_api::decl_runtime_apis! { pub trait AlephSessionApi { fn next_session_authorities() -> Result, ApiError>;