Skip to content
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
6 changes: 3 additions & 3 deletions cumulus/pallets/ah-ops/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub mod benchmarks {
let _ = T::Currency::deposit_creating(&sender, ed + ed);
let _ = T::Currency::reserve(&sender, ed);
let block = T::RcBlockNumberProvider::current_block_number();
let para_id = ParaId::from(1);
let para_id = ParaId::from(1u16);
RcLeaseReserve::<T>::insert((block, para_id, &sender), ed);

assert_eq!(T::Currency::reserved_balance(&sender), ed);
Expand All @@ -49,7 +49,7 @@ pub mod benchmarks {
let _ = T::Currency::deposit_creating(&pot, ed + ed);
let _ = T::Currency::reserve(&pot, ed);
let block = T::RcBlockNumberProvider::current_block_number();
let para_id = ParaId::from(1);
let para_id = ParaId::from(1u16);
RcLeaseReserve::<T>::insert((block, para_id, &pot), ed);

let sender = account("sender", 0, 0);
Expand All @@ -72,7 +72,7 @@ pub mod benchmarks {
let _ = T::Currency::deposit_creating(&sender, ed + ed);
let _ = T::Currency::reserve(&sender, ed);
let block = T::RcBlockNumberProvider::current_block_number();
let para_id = ParaId::from(1);
let para_id = ParaId::from(1u16);
RcCrowdloanReserve::<T>::insert((block, para_id, &sender), ed);

assert_eq!(T::Currency::reserved_balance(&sender), ed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ pub fn call_allowed_status(call: &<Runtime as frame_system::Config>::RuntimeCall
ToRococoXcmRouter(..) => OFF,
Treasury(..) => OFF,
Staking(..) => OFF,
MultiBlock(..) => OFF,
MultiBlockVerifier(..) => OFF,
MultiBlockUnsigned(..) => OFF,
MultiBlockSigned(..) => OFF,
MultiBlockElection(..) => OFF,
MultiBlockElectionVerifier(..) => OFF,
MultiBlockElectionUnsigned(..) => OFF,
MultiBlockElectionSigned(..) => OFF,
AssetConversionMigration(..) => OFF,
Revive(..) => ON,
AssetRewards(..) => ON,
Expand All @@ -118,7 +118,7 @@ pub fn call_allowed_status(call: &<Runtime as frame_system::Config>::RuntimeCall
Whitelist(..) => OFF,
XcmpQueue(..) => ON, /* Allow updating XCM settings. Only by Fellowship and root. */
SnowbridgeSystemFrontend(..) => OFF, // FAIL-CI Clara
StakingNextRcClient(..) => OFF,
StakingRcClient(..) => OFF,
Sudo(..) => ON,
/* Exhaustive match. Compiler ensures that we did not miss any. */
};
Expand Down
51 changes: 42 additions & 9 deletions cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1392,13 +1392,13 @@ construct_runtime!(
FastUnstake: pallet_fast_unstake = 82,
VoterList: pallet_bags_list::<Instance1> = 83,
DelegatedStaking: pallet_delegated_staking = 84,
StakingNextRcClient: pallet_staking_async_rc_client = 89,
StakingRcClient: pallet_staking_async_rc_client = 89,

// Staking election apparatus.
MultiBlock: pallet_election_provider_multi_block = 85,
MultiBlockVerifier: pallet_election_provider_multi_block::verifier = 86,
MultiBlockUnsigned: pallet_election_provider_multi_block::unsigned = 87,
MultiBlockSigned: pallet_election_provider_multi_block::signed = 88,
MultiBlockElection: pallet_election_provider_multi_block = 85,
MultiBlockElectionVerifier: pallet_election_provider_multi_block::verifier = 86,
MultiBlockElectionUnsigned: pallet_election_provider_multi_block::unsigned = 87,
MultiBlockElectionSigned: pallet_election_provider_multi_block::signed = 88,

// Governance.
ConvictionVoting: pallet_conviction_voting = 90,
Expand Down Expand Up @@ -1471,6 +1471,38 @@ impl EthExtra for EthExtraImpl {
pub type UncheckedExtrinsic =
pallet_revive::evm::runtime::UncheckedExtrinsic<Address, Signature, EthExtraImpl>;

pub struct RenameStakingPallets;
impl frame_support::traits::OnRuntimeUpgrade for RenameStakingPallets {
fn on_runtime_upgrade() -> Weight {
if VERSION.spec_version == 1_018_011 {
// This pallet already has a bunch od data, we just ignore it. The rest have small amounts of data.
// frame_support::storage::migration::move_pallet(
// b"MultiBlockSigned",
// b"MultiBlockElectionSigned",
// );
frame_support::storage::migration::move_pallet(
b"StakingNextRcClient",
b"StakingRcClient",
);
frame_support::storage::migration::move_pallet(
b"MultiBlock",
b"MultiBlockElection",
);
frame_support::storage::migration::move_pallet(
b"MultiBlockUnsigned",
b"MultiBlockElectionUnsigned",
);
frame_support::storage::migration::move_pallet(
b"MultiBlockVerifier",
b"MultiBlockElectionVerifier",
);
<Weight as sp_runtime::traits::Bounded>::max_value()
} else {
Default::default()
}
}
}

/// Migrations to apply on runtime upgrade.
pub type Migrations = (
// v9420
Expand Down Expand Up @@ -1499,6 +1531,7 @@ pub type Migrations = (
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
cumulus_pallet_aura_ext::migration::MigrateV0ToV1<Runtime>,
RenameStakingPallets,
);

/// Asset Hub Westend has some undecodable storage, delete it.
Expand Down Expand Up @@ -1699,10 +1732,10 @@ mod benches {
[pallet_bags_list, VoterList]
[pallet_balances, Balances]
[pallet_conviction_voting, ConvictionVoting]
[pallet_election_provider_multi_block, MultiBlock]
[pallet_election_provider_multi_block_verifier, MultiBlockVerifier]
[pallet_election_provider_multi_block_unsigned, MultiBlockUnsigned]
[pallet_election_provider_multi_block_signed, MultiBlockSigned]
[pallet_election_provider_multi_block, MultiBlockElection]
[pallet_election_provider_multi_block_verifier, MultiBlockElectionVerifier]
[pallet_election_provider_multi_block_unsigned, MultiBlockElectionUnsigned]
[pallet_election_provider_multi_block_signed, MultiBlockElectionSigned]
[pallet_fast_unstake, FastUnstake]
[pallet_message_queue, MessageQueue]
[pallet_migrations, MultiBlockMigrations]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl multi_block::Config for Runtime {
EitherOfDiverse<EnsureRoot<AccountId>, EnsureSignedBy<WestendStakingMiner, AccountId>>;
type DataProvider = Staking;
type MinerConfig = Self;
type Verifier = MultiBlockVerifier;
type Verifier = MultiBlockElectionVerifier;
// we chill and do nothing in the fallback.
type Fallback = multi_block::Continue<Self>;
// Revert back to signed phase if nothing is submitted and queued, so we prolong the election.
Expand All @@ -138,7 +138,7 @@ impl multi_block::verifier::Config for Runtime {
type MaxWinnersPerPage = MaxWinnersPerPage;
type MaxBackersPerWinner = MaxBackersPerWinner;
type MaxBackersPerWinnerFinal = MaxBackersPerWinnerFinal;
type SolutionDataProvider = MultiBlockSigned;
type SolutionDataProvider = MultiBlockElectionSigned;
type SolutionImprovementThreshold = SolutionImprovementThreshold;
// TODO: double check they are right.
type WeightInfo =
Expand Down Expand Up @@ -279,7 +279,7 @@ impl pallet_staking_async::Config for Runtime {
type AdminOrigin = EitherOf<EnsureRoot<AccountId>, StakingAdmin>;
type EraPayout = EraPayout;
type MaxExposurePageSize = MaxExposurePageSize;
type ElectionProvider = MultiBlock;
type ElectionProvider = MultiBlockElection;
type VoterList = VoterList;
type TargetList = UseValidatorsMap<Self>;
type MaxValidatorSet = MaxValidatorSet;
Expand All @@ -292,7 +292,7 @@ impl pallet_staking_async::Config for Runtime {
type MaxInvulnerables = frame_support::traits::ConstU32<20>;
type MaxDisabledValidators = ConstU32<100>;
type PlanningEraOffset = PlanningEraOffset;
type RcClientInterface = StakingNextRcClient;
type RcClientInterface = StakingRcClient;
}

impl pallet_staking_async_rc_client::Config for Runtime {
Expand Down
2 changes: 1 addition & 1 deletion polkadot/runtime/westend/src/ah_migration/phase1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub fn call_allowed_status(call: &<Runtime as frame_system::Config>::RuntimeCall
RootTesting(..) => (ON, ON),
MetaTx(..) => (ON, ON), // FAIL-CI @muharem check
IdentityMigrator(..) => (ON, ON),
AssetHubStakingClient(..) => (ON, ON),
StakingAhClient(..) => (ON, ON),
// Exhaustive match. Compiler ensures that we did not miss any.
}
}
33 changes: 25 additions & 8 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ impl pallet_timestamp::Config for Runtime {

impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
type EventHandler = AssetHubStakingClient;
type EventHandler = StakingAhClient;
}

parameter_types! {
Expand All @@ -536,7 +536,7 @@ impl pallet_session::Config for Runtime {
type ValidatorIdOf = ConvertInto;
type ShouldEndSession = Babe;
type NextSessionRotation = Babe;
type SessionManager = session_historical::NoteHistoricalRoot<Self, AssetHubStakingClient>;
type SessionManager = session_historical::NoteHistoricalRoot<Self, StakingAhClient>;
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisablingStrategy = pallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy;
Expand Down Expand Up @@ -960,7 +960,7 @@ impl pallet_treasury::Config for Runtime {
impl pallet_offences::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = session_historical::IdentificationTuple<Self>;
type OnOffenceHandler = AssetHubStakingClient;
type OnOffenceHandler = StakingAhClient;
}

impl pallet_authority_discovery::Config for Runtime {
Expand Down Expand Up @@ -1294,8 +1294,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -1389,7 +1388,7 @@ impl parachains_inclusion::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type DisputesHandler = ParasDisputes;
type RewardValidators =
parachains_reward_points::RewardValidatorsWithEraPoints<Runtime, AssetHubStakingClient>;
parachains_reward_points::RewardValidatorsWithEraPoints<Runtime, StakingAhClient>;
type MessageQueue = MessageQueue;
type WeightInfo = weights::polkadot_runtime_parachains_inclusion::WeightInfo<Runtime>;
}
Expand Down Expand Up @@ -1565,7 +1564,7 @@ impl assigned_slots::Config for Runtime {
impl parachains_disputes::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RewardValidators =
parachains_reward_points::RewardValidatorsWithEraPoints<Runtime, AssetHubStakingClient>;
parachains_reward_points::RewardValidatorsWithEraPoints<Runtime, StakingAhClient>;
type SlashingHandler = parachains_slashing::SlashValidatorsForDisputes<ParasSlashing>;
type WeightInfo = weights::polkadot_runtime_parachains_disputes::WeightInfo<Runtime>;
}
Expand Down Expand Up @@ -2003,7 +2002,7 @@ mod runtime {
#[runtime::pallet_index(66)]
pub type Coretime = coretime;
#[runtime::pallet_index(67)]
pub type AssetHubStakingClient = pallet_staking_async_ah_client;
pub type StakingAhClient = pallet_staking_async_ah_client;

// Migrations pallet
#[runtime::pallet_index(98)]
Expand Down Expand Up @@ -2086,6 +2085,22 @@ parameter_types! {
/// upgrades in case governance decides to do so. THE ORDER IS IMPORTANT.
pub type Migrations = migrations::Unreleased;

pub struct RenameAhClient;
impl frame_support::traits::OnRuntimeUpgrade for RenameAhClient {
fn on_runtime_upgrade() -> Weight {
// CI-FAIL: set to the next spec of westend.
if VERSION.spec_version == 1_018_011 {
frame_support::storage::migration::move_pallet(
b"AssetHubStakingClient",
b"StakingAhClient",
);
<Weight as sp_runtime::traits::Bounded>::max_value()
} else {
Default::default()
}
}
}

/// The runtime migrations per release.
#[allow(deprecated, missing_docs)]
pub mod migrations {
Expand All @@ -2107,6 +2122,8 @@ pub mod migrations {
>,
// permanent
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
// remove once done
RenameAhClient,
);
}

Expand Down
Loading