Skip to content

Commit

Permalink
Merge pull request #65 from paseo-network/feat/1.1.3
Browse files Browse the repository at this point in the history
Release 1.1.3
  • Loading branch information
hbulgarini authored Apr 15, 2024
2 parents 3251423 + fec3849 commit 3877461
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 68 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion relay/paseo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pallet-scheduler = { default-features = false , version = "26.0.0" }
pallet-session = { default-features = false , version = "25.0.0" }
frame-support = { default-features = false , version = "25.0.0" }
pallet-sudo = { default-features = false , version = "25.0.0" }
pallet-staking = { default-features = false , version = "25.0.0" }
pallet-staking = { default-features = false , version = "25.0.1" }
pallet-staking-reward-fn = { default-features = false, version = "16.0.0" }
pallet-staking-reward-curve = { version = "10.0.0" }
pallet-staking-runtime-api = { default-features = false , version = "11.0.0" }
Expand Down
76 changes: 11 additions & 65 deletions relay/paseo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,52 +430,15 @@ impl pallet_authorship::Config for Runtime {
}

impl_opaque_keys! {
pub struct OldSessionKeys {
pub grandpa: Grandpa,
pub babe: Babe,
pub im_online: ImOnline,
pub para_validator: Initializer,
pub para_assignment: ParaSessionInfo,
pub authority_discovery: AuthorityDiscovery,
}
}

impl_opaque_keys! {
pub struct SessionKeys {
pub grandpa: Grandpa,
pub babe: Babe,
pub im_online: ImOnline,
pub para_validator: Initializer,
pub para_assignment: ParaSessionInfo,
pub authority_discovery: AuthorityDiscovery,
pub beefy: Beefy,
}
}

// remove this when removing `OldSessionKeys`
fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys {
SessionKeys {
grandpa: old.grandpa,
babe: old.babe,
im_online: old.im_online,
para_validator: old.para_validator,
para_assignment: old.para_assignment,
authority_discovery: old.authority_discovery,
beefy: {
// From Session::upgrade_keys():
//
// Care should be taken that the raw versions of the
// added keys are unique for every `ValidatorId, KeyTypeId` combination.
// This is an invariant that the session pallet typically maintains internally.
//
// So, produce a dummy value that's unique for the `ValidatorId, KeyTypeId` combination.
let mut id: BeefyId = sp_application_crypto::ecdsa::Public::from_raw([0u8; 33]).into();
let id_raw: &mut [u8] = id.as_mut();
id_raw[1..33].copy_from_slice(v.as_ref());
id_raw[0..4].copy_from_slice(b"beef");
id
},
}
pub struct SessionKeys {
pub grandpa: Grandpa,
pub babe: Babe,
pub im_online: ImOnline,
pub para_validator: Initializer,
pub para_assignment: ParaSessionInfo,
pub authority_discovery: AuthorityDiscovery,
pub beefy: Beefy,
}
}

impl pallet_session::Config for Runtime {
Expand Down Expand Up @@ -1708,25 +1671,8 @@ pub type Migrations = migrations::Unreleased;
/// The runtime migrations per release.
#[allow(deprecated, missing_docs)]
pub mod migrations {
use super::*;

/// Upgrade Session keys to include BEEFY key.
/// When this is removed, should also remove `OldSessionKeys`.
pub struct UpgradeSessionKeys;
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
fn on_runtime_upgrade() -> Weight {
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
Perbill::from_percent(50) * BlockWeights::get().max_block
}
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
// Upgrade SessionKeys to include BEEFY key
UpgradeSessionKeys,
pallet_nomination_pools::migration::versioned_migrations::V5toV6<Runtime>,
pallet_nomination_pools::migration::versioned_migrations::V6ToV7<Runtime>,
);
/// Unreleased migrations. Add new ones here:
pub type Unreleased = ();
}

/// Unchecked extrinsic type as expected by this runtime.
Expand Down

0 comments on commit 3877461

Please sign in to comment.