Skip to content

Commit a54988c

Browse files
paritytech-release-backport-bot[bot]Ank4nEgorPopelyaev
authored
[stable2509] Backport #10311 (#10527)
Backport #10311 into `stable2509` from Ank4n. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Ankan <[email protected]> Co-authored-by: Ankan <[email protected]> Co-authored-by: Egor_P <[email protected]>
1 parent c189651 commit a54988c

File tree

8 files changed

+648
-208
lines changed

8 files changed

+648
-208
lines changed

cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ impl pallet_staking_async::Config for Runtime {
295295
type EventListeners = (NominationPools, DelegatedStaking);
296296
type WeightInfo = weights::pallet_staking_async::WeightInfo<Runtime>;
297297
type MaxInvulnerables = frame_support::traits::ConstU32<20>;
298-
type PlanningEraOffset =
299-
pallet_staking_async::PlanningEraOffsetOf<Runtime, RelaySessionDuration, ConstU32<5>>;
298+
type PlanningEraOffset = ConstU32<6>;
300299
type RcClientInterface = StakingRcClient;
301300
type MaxEraDuration = MaxEraDuration;
302301
type MaxPruningItems = MaxPruningItems;
@@ -307,6 +306,8 @@ impl pallet_staking_async_rc_client::Config for Runtime {
307306
type AHStakingInterface = Staking;
308307
type SendToRelayChain = StakingXcmToRelayChain;
309308
type MaxValidatorSetRetries = ConstU32<64>;
309+
// export validator session at end of session 4 within an era.
310+
type ValidatorSetExportSession = ConstU32<4>;
310311
}
311312

312313
#[derive(Encode, Decode)]

prdoc/pr_10311.prdoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
title: '[Staking] Async Elections Post AHM'
2+
doc:
3+
- audience: Runtime Dev
4+
description: |-
5+
Staking elections can be configured so they run as soon as the era starts, but their results are buffered and
6+
only sent to RC after the end of session `n - 2` and before start of session `n - 1`, assuming the new validator set
7+
must activate at end of session `n`.
8+
9+
This helps us avoid difficulty of timing the election precisely as elections are long running and can sometimes
10+
take longer than usual.
11+
12+
See documentation for `pallet_staking_async::Config::PlanningEraOffset` and
13+
`pallet_staking_async_rc_client::Config::ValidatorSetExportSession` to learn more.
14+
crates:
15+
- name: pallet-staking-async
16+
bump: minor
17+
validate: false
18+
- name: pallet-staking-async-rc-client
19+
bump: minor
20+
validate: false
21+
- name: asset-hub-westend-runtime
22+
bump: minor
23+
validate: false

0 commit comments

Comments
 (0)