Skip to content

Commit 58d95e6

Browse files
lexnvAnk4nbkchr
authored
asset-hub-kusama: Prepare ElasticScaling with 3 cores on asset hub kusama and enable buffered election (#1037)
This PR configures the AssetHubKusama runtime to utilize elastic scaling with 3 cores. - the runtime is prepared for elastic scaling with expected 2s block times - 3 cores will be assigned to AHK when we have sufficient confidence in testing stacks - AHK should function similarly with expected 6s block times until cores are assigned The PR also enables buffered export of the validator set to the Relay Chain to handle block time changes from elastic scaling in KAH more gracefully. Without this, era lengths can shrink when multiple cores are used. See paritytech/polkadot-sdk#10142. --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Ankan <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
1 parent f56d87d commit 58d95e6

File tree

19 files changed

+61
-35
lines changed

19 files changed

+61
-35
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Changelog for the runtimes governed by the Polkadot Fellowship.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7-
## [Unreleased]
8-
7+
## [2.0.4] 18.12.2025
98

109
### Changed
1110

@@ -14,6 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1413
- asset-hub-polkadot: increase the base deposit for a signed NPoS solution from 4 to 100 DOT, significantly mitigating the risk of transaction spamming ([#1022](https://github.com/polkadot-fellows/runtimes/pull/1022))
1514
- Adjust OpenGov parameters based on WFC 1701 ([polkadot-fellows/runtimes/pull/873](https://github.com/polkadot-fellows/runtimes/pull/873))
1615
- asset-hub-kusama: update to latest version of pallet-revive with EVM backend ([polkadot-fellows/runtimes/pull/1029](https://github.com/polkadot-fellows/runtimes/pull/1029))
16+
- Enable Elastic Scaling on Assethub Kusama ([polkadot-fellows/runtimes/pull/1037](https://github.com/polkadot-fellows/runtimes/pull/1037))
17+
- Enable buffered validator selection on Assethub Kusama ([polkadot-fellows/runtimes/pull/1037](https://github.com/polkadot-fellows/runtimes/pull/1037))
1718

1819
### Added
1920

Cargo.lock

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pallet-ah-migrator = { path = "pallets/ah-migrator", default-features = false }
1010
pallet-rc-migrator = { path = "pallets/rc-migrator", default-features = false }
1111
pallet-ah-ops = { path = "pallets/ah-ops", default-features = false }
1212
pallet-election-provider-multi-block = { version = "0.5.0", default-features = false }
13-
pallet-staking-async = { version = "0.7.0", default-features = false }
13+
pallet-staking-async = { version = "0.7.1", default-features = false }
1414
hex = { version = "0.4.3", default-features = false }
1515
rand = { version = "0.9.2" }
1616
impl-trait-for-tuples = { version = "0.2.3", default-features = false }
@@ -188,7 +188,7 @@ pallet-xcm-bridge-hub = { version = "0.20.0", default-features = false }
188188
pallet-xcm-bridge-hub-router = { version = "0.22.0", default-features = false }
189189
parachain-info = { version = "0.24.0", default-features = false, package = "staging-parachain-info" }
190190
parachains-common = { version = "26.0.0", default-features = false }
191-
parachains-runtimes-test-utils = { version = "27.0.0" }
191+
parachains-runtimes-test-utils = { version = "27.0.1" }
192192
paste = { version = "1.0.14" }
193193
penpal-emulated-chain = { path = "integration-tests/emulated/chains/parachains/testing/penpal" }
194194
penpal-runtime = { version = "0.34.0" }
@@ -266,7 +266,7 @@ system-parachains-common = { path = "system-parachains/common", default-features
266266
tokio = { version = "1.45.0" }
267267
xcm = { version = "20.0.0", default-features = false, package = "staging-xcm" }
268268
xcm-builder = { version = "24.0.0", default-features = false, package = "staging-xcm-builder" }
269-
xcm-emulator = { version = "0.24.0" }
269+
xcm-emulator = { version = "0.24.1" }
270270
xcm-executor = { version = "23.0.0", default-features = false, package = "staging-xcm-executor" }
271271
xcm-runtime-apis = { version = "0.11.0", default-features = false }
272272
anyhow = { version = "1.0.82" }

relay/kusama/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
188188
spec_name: alloc::borrow::Cow::Borrowed("kusama"),
189189
impl_name: alloc::borrow::Cow::Borrowed("parity-kusama"),
190190
authoring_version: 2,
191-
spec_version: 2_000_003,
191+
spec_version: 2_000_004,
192192
impl_version: 0,
193193
apis: RUNTIME_API_VERSIONS,
194194
transaction_version: 26,

relay/polkadot/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
177177
spec_name: alloc::borrow::Cow::Borrowed("polkadot"),
178178
impl_name: alloc::borrow::Cow::Borrowed("parity-polkadot"),
179179
authoring_version: 0,
180-
spec_version: 2_000_003,
180+
spec_version: 2_000_004,
181181
impl_version: 0,
182182
apis: RUNTIME_API_VERSIONS,
183183
transaction_version: 26,

system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ use system_parachains_constants::{
109109
},
110110
kusama::{
111111
consensus::{
112-
async_backing::UNINCLUDED_SEGMENT_CAPACITY, BLOCK_PROCESSING_VELOCITY,
112+
elastic_scaling::{
113+
BLOCK_PROCESSING_VELOCITY, RELAY_PARENT_OFFSET, UNINCLUDED_SEGMENT_CAPACITY,
114+
},
113115
RELAY_CHAIN_SLOT_DURATION_MILLIS,
114116
},
115117
currency::*,
@@ -145,7 +147,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
145147
spec_name: Cow::Borrowed("statemine"),
146148
impl_name: Cow::Borrowed("statemine"),
147149
authoring_version: 1,
148-
spec_version: 2_000_003,
150+
spec_version: 2_000_004,
149151
impl_version: 0,
150152
apis: RUNTIME_API_VERSIONS,
151153
transaction_version: 15,
@@ -850,7 +852,7 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
850852
type ConsensusHook = ConsensusHook;
851853
type WeightInfo = weights::cumulus_pallet_parachain_system::WeightInfo<Runtime>;
852854
type SelectCore = cumulus_pallet_parachain_system::DefaultCoreSelector<Runtime>;
853-
type RelayParentOffset = ConstU32<0>;
855+
type RelayParentOffset = ConstU32<RELAY_PARENT_OFFSET>;
854856
}
855857

856858
type ConsensusHook = cumulus_pallet_aura_ext::FixedVelocityConsensusHook<
@@ -2313,7 +2315,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
23132315

23142316
impl cumulus_primitives_core::RelayParentOffsetApi<Block> for Runtime {
23152317
fn relay_parent_offset() -> u32 {
2316-
0
2318+
RELAY_PARENT_OFFSET
23172319
}
23182320
}
23192321

system-parachains/asset-hubs/asset-hub-kusama/src/staking/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ impl pallet_staking_async::Config for Runtime {
412412
type EventListeners = (NominationPools, DelegatedStaking);
413413
// Note used; don't care.
414414
type MaxInvulnerables = frame_support::traits::ConstU32<20>;
415-
type PlanningEraOffset =
416-
pallet_staking_async::PlanningEraOffsetOf<Self, RelaySessionDuration, ConstU32<10>>;
415+
// This will start election for the next era as soon as an era starts.
416+
type PlanningEraOffset = ConstU32<6>;
417417
type RcClientInterface = StakingRcClient;
418418
type MaxEraDuration = MaxEraDuration;
419419
type WeightInfo = weights::pallet_staking_async::WeightInfo<Runtime>;
@@ -425,6 +425,8 @@ impl pallet_staking_async_rc_client::Config for Runtime {
425425
type AHStakingInterface = Staking;
426426
type SendToRelayChain = StakingXcmToRelayChain;
427427
type MaxValidatorSetRetries = ConstU32<64>;
428+
// Export elected validator set at end of session 4.
429+
type ValidatorSetExportSession = ConstU32<4>;
428430
}
429431

430432
#[derive(Encode, Decode)]

system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
191191
impl_name: Cow::Borrowed("statemint"),
192192
spec_name: Cow::Borrowed("statemint"),
193193
authoring_version: 1,
194-
spec_version: 2_000_003,
194+
spec_version: 2_000_004,
195195
impl_version: 0,
196196
apis: RUNTIME_API_VERSIONS,
197197
transaction_version: 15,

system-parachains/asset-hubs/asset-hub-polkadot/src/staking/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ impl pallet_staking_async_rc_client::Config for Runtime {
389389
type AHStakingInterface = Staking;
390390
type SendToRelayChain = StakingXcmToRelayChain;
391391
type MaxValidatorSetRetries = ConstU32<64>;
392+
// export validators as soon as election results are ready.
393+
type ValidatorSetExportSession = ConstU32<0>;
392394
}
393395

394396
#[derive(Encode, Decode)]

system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
179179
spec_name: Cow::Borrowed("bridge-hub-kusama"),
180180
impl_name: Cow::Borrowed("bridge-hub-kusama"),
181181
authoring_version: 1,
182-
spec_version: 2_000_003,
182+
spec_version: 2_000_004,
183183
impl_version: 0,
184184
apis: RUNTIME_API_VERSIONS,
185185
transaction_version: 5,

0 commit comments

Comments
 (0)