Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable elastic scaling node side feature on Kusama #205

Merged
merged 5 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80))
- Feature for enabling debug prints in the Polkadot and Kusama runtime ([polkadot-fellows/runtimes#85](https://github.com/polkadot-fellows/runtimes/pull/85))
- Added new "Wish for Change" track ([polkadot-fellows/runtimes#184](https://github.com/polkadot-fellows/runtimes/pull/184))
- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159)
- Cancel Parachain Auctions [polkadot-fellows/runtimes#215](https://github.com/polkadot-fellows/runtimes/pull/215)
- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159))
- Enable Elastic Scaling node side feature for Kusama ([polkadot-fellows/runtimes#205](https://github.com/polkadot-fellows/runtimes/pull/205))
- Cancel Parachain Auctions ([polkadot-fellows/runtimes#215](https://github.com/polkadot-fellows/runtimes/pull/215))

### Changed

Expand Down
17 changes: 16 additions & 1 deletion relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1746,8 +1746,10 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent);
pub mod migrations {
use super::*;
use frame_support::traits::OnRuntimeUpgrade;
use frame_system::RawOrigin;
use pallet_scheduler::WeightInfo as SchedulerWeightInfo;
use runtime_common::auctions::WeightInfo as AuctionsWeightInfo;
use runtime_parachains::configuration::WeightInfo;
#[cfg(feature = "try-runtime")]
use sp_core::crypto::ByteArray;

Expand All @@ -1772,6 +1774,18 @@ pub mod migrations {
}
}

/// Enable the elastic scaling node side feature.
///
/// This is required for Coretime to ensure the relay chain processes parachains that are
/// assigned to multiple cores.
pub struct EnableElasticScalingNodeFeature;
impl OnRuntimeUpgrade for EnableElasticScalingNodeFeature {
fn on_runtime_upgrade() -> Weight {
let _ = Configuration::set_node_feature(RawOrigin::Root.into(), 1, true);
weights::runtime_parachains_configuration::WeightInfo::<Runtime>::set_node_feature()
}
}

parameter_types! {
pub const ImOnlinePalletName: &'static str = "ImOnline";
}
Expand All @@ -1781,7 +1795,7 @@ pub mod migrations {
pub struct UpgradeSessionKeys;
const UPGRADE_SESSION_KEYS_FROM_SPEC: u32 = 1001002;

impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
impl OnRuntimeUpgrade for UpgradeSessionKeys {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
if System::last_runtime_upgrade_spec_version() > UPGRADE_SESSION_KEYS_FROM_SPEC {
Expand Down Expand Up @@ -1903,6 +1917,7 @@ pub mod migrations {
crate::xcm_config::XcmRouter,
GetLegacyLeaseImpl,
>,
EnableElasticScalingNodeFeature,
// Upgrade `SessionKeys` to exclude `ImOnline`
UpgradeSessionKeys,
// Remove `im-online` pallet on-chain storage
Expand Down
Loading