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 Polkadot #340

Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Staking runtime api to check if reward is pending for an era ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318))
- Allow any parachain to have bidirectional channel with any system parachains ([polkadot-fellows/runtimes#329](https://github.com/polkadot-fellows/runtimes/pull/329))
- Enable support for new hardware signers like the generic ledger app ([polkadot-fellows/runtimes#337](https://github.com/polkadot-fellows/runtimes/pull/337))
- Enable Elastic Scaling node side feature for Polkadot ([polkadot-fellows/runtimes#340](https://github.com/polkadot-fellows/runtimes/pull/340))

### Changed

Expand Down
16 changes: 16 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,9 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent);
#[allow(deprecated, missing_docs)]
pub mod migrations {
use super::*;
use frame_support::traits::OnRuntimeUpgrade;
use frame_system::RawOrigin;
use runtime_parachains::configuration::WeightInfo;
#[cfg(feature = "try-runtime")]
use sp_core::crypto::ByteArray;

Expand Down Expand Up @@ -1886,6 +1889,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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we not using the constant?

Copy link
Contributor Author

@sandreim sandreim Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently in staging (based on current crate version usage), felt that we don't want to use any of the staging stuff here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm - don't we have v7 already in the current release? In any case, seems like we would be using staging stuff anyways, just hiding it by using a magic number? Also I think this can wait for the next polkadot-sdk release, where this should be v7 then.

Copy link
Contributor Author

@sandreim sandreim Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, but this needs to go in same or before release with core time.

weights::runtime_parachains_configuration::WeightInfo::<Runtime>::set_node_feature()
}
}

// We don't have a limit in the Relay Chain.
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX;

Expand All @@ -1907,6 +1922,7 @@ pub mod migrations {
ImOnlinePalletName,
<Runtime as frame_system::Config>::DbWeight,
>,
EnableElasticScalingNodeFeature,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
Expand Down
Loading