diff --git a/cumulus/pallets/ah-ops/src/benchmarking.rs b/cumulus/pallets/ah-ops/src/benchmarking.rs index 0b8a0fc39233b..59860097f372d 100644 --- a/cumulus/pallets/ah-ops/src/benchmarking.rs +++ b/cumulus/pallets/ah-ops/src/benchmarking.rs @@ -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::::insert((block, para_id, &sender), ed); assert_eq!(T::Currency::reserved_balance(&sender), ed); @@ -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::::insert((block, para_id, &pot), ed); let sender = account("sender", 0, 0); @@ -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::::insert((block, para_id, &sender), ed); assert_eq!(T::Currency::reserved_balance(&sender), ed); diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 1ec45bacca9e3..f5ccc664ba1b8 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -1347,13 +1347,13 @@ construct_runtime!( FastUnstake: pallet_fast_unstake = 82, VoterList: pallet_bags_list:: = 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, @@ -1653,10 +1653,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] diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs index 3eab4a95fcf48..019df2c180e06 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/staking.rs @@ -100,7 +100,7 @@ impl multi_block::Config for Runtime { EitherOfDiverse, EnsureSignedBy>; 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; // Revert back to signed phase if nothing is submitted and queued, so we prolong the election. @@ -113,7 +113,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; type WeightInfo = multi_block::weights::westend::MultiBlockVerifierWeightInfo; } @@ -249,7 +249,7 @@ impl pallet_staking_async::Config for Runtime { type AdminOrigin = EitherOf, StakingAdmin>; type EraPayout = EraPayout; type MaxExposurePageSize = MaxExposurePageSize; - type ElectionProvider = MultiBlock; + type ElectionProvider = MultiBlockElection; type VoterList = VoterList; type TargetList = UseValidatorsMap; type MaxValidatorSet = MaxValidatorSet; @@ -262,7 +262,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 { diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 2c08f893ac7b3..6ae1b1ba49ef7 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -503,7 +503,7 @@ impl pallet_timestamp::Config for Runtime { impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = AssetHubStakingClient; + type EventHandler = StakingAhClient; } parameter_types! { @@ -528,7 +528,7 @@ impl pallet_session::Config for Runtime { type ValidatorIdOf = ConvertInto; type ShouldEndSession = Babe; type NextSessionRotation = Babe; - type SessionManager = session_historical::NoteHistoricalRoot; + type SessionManager = session_historical::NoteHistoricalRoot; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; type DisablingStrategy = pallet_session::disabling::UpToLimitWithReEnablingDisablingStrategy; @@ -961,7 +961,7 @@ impl pallet_treasury::Config for Runtime { impl pallet_offences::Config for Runtime { type RuntimeEvent = RuntimeEvent; type IdentificationTuple = session_historical::IdentificationTuple; - type OnOffenceHandler = AssetHubStakingClient; + type OnOffenceHandler = StakingAhClient; } impl pallet_authority_discovery::Config for Runtime { @@ -1390,7 +1390,7 @@ impl parachains_inclusion::Config for Runtime { type RuntimeEvent = RuntimeEvent; type DisputesHandler = ParasDisputes; type RewardValidators = - parachains_reward_points::RewardValidatorsWithEraPoints; + parachains_reward_points::RewardValidatorsWithEraPoints; type MessageQueue = MessageQueue; type WeightInfo = weights::polkadot_runtime_parachains_inclusion::WeightInfo; } @@ -1573,7 +1573,7 @@ impl assigned_slots::Config for Runtime { impl parachains_disputes::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RewardValidators = - parachains_reward_points::RewardValidatorsWithEraPoints; + parachains_reward_points::RewardValidatorsWithEraPoints; type SlashingHandler = parachains_slashing::SlashValidatorsForDisputes; type WeightInfo = weights::polkadot_runtime_parachains_disputes::WeightInfo; } @@ -1964,7 +1964,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)] diff --git a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs index e069e032f3c9a..bba14525e8745 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/lib.rs @@ -1171,13 +1171,13 @@ construct_runtime!( FastUnstake: pallet_fast_unstake = 82, VoterList: pallet_bags_list:: = 83, DelegatedStaking: pallet_delegated_staking = 84, - StakingNextRcClient: pallet_staking_async_rc_client = 89, + StakingRcClient: pallet_staking_async_rc_client = 89, // 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. Preimage: pallet_preimage = 90, @@ -1332,10 +1332,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] diff --git a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs index ce924061fa8ec..32be13640df15 100644 --- a/substrate/frame/staking-async/runtimes/parachain/src/staking.rs +++ b/substrate/frame/staking-async/runtimes/parachain/src/staking.rs @@ -114,7 +114,7 @@ impl multi_block::Config for Runtime { #[cfg(feature = "runtime-benchmarks")] type Fallback = frame_election_provider_support::onchain::OnChainExecution; type MinerConfig = Self; - type Verifier = MultiBlockVerifier; + type Verifier = MultiBlockElectionVerifier; type OnRoundRotation = multi_block::CleanRound; type WeightInfo = multi_block::weights::polkadot::MultiBlockWeightInfo; } @@ -123,7 +123,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; type WeightInfo = multi_block::weights::polkadot::MultiBlockVerifierWeightInfo; } @@ -262,7 +262,7 @@ impl pallet_staking_async::Config for Runtime { type AdminOrigin = EitherOf, StakingAdmin>; type EraPayout = EraPayout; type MaxExposurePageSize = MaxExposurePageSize; - type ElectionProvider = MultiBlock; + type ElectionProvider = MultiBlockElection; type VoterList = VoterList; type TargetList = UseValidatorsMap; type MaxValidatorSet = MaxValidatorSet; @@ -276,7 +276,7 @@ impl pallet_staking_async::Config for Runtime { type MaxDisabledValidators = ConstU32<100>; type PlanningEraOffset = pallet_staking_async::PlanningEraOffsetOf>; - type RcClientInterface = StakingNextRcClient; + type RcClientInterface = StakingRcClient; } impl pallet_staking_async_rc_client::Config for Runtime { diff --git a/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs b/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs index 73906b890c64d..e6fc89a0de161 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/genesis_config_presets.rs @@ -17,8 +17,8 @@ //! Genesis configs presets for the Westend runtime use crate::{ - AssetHubStakingClientConfig, BabeConfig, BalancesConfig, ConfigurationConfig, RegistrarConfig, - RuntimeGenesisConfig, SessionConfig, SessionKeys, SudoConfig, BABE_GENESIS_EPOCH_CONFIG, + BabeConfig, BalancesConfig, ConfigurationConfig, RegistrarConfig, RuntimeGenesisConfig, + SessionConfig, SessionKeys, StakingAhClientConfig, SudoConfig, BABE_GENESIS_EPOCH_CONFIG, }; #[cfg(not(feature = "std"))] use alloc::format; @@ -197,7 +197,7 @@ fn westend_testnet_genesis( sudo: SudoConfig { key: Some(root_key) }, configuration: ConfigurationConfig { config: default_parachains_host_configuration() }, registrar: RegistrarConfig { next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID }, - asset_hub_staking_client: AssetHubStakingClientConfig { + staking_ah_client: StakingAhClientConfig { operating_mode: pallet_staking_async_ah_client::OperatingMode::Active, ..Default::default() } diff --git a/substrate/frame/staking-async/runtimes/rc/src/lib.rs b/substrate/frame/staking-async/runtimes/rc/src/lib.rs index c75e04cb7c826..cc0e3e6a677ea 100644 --- a/substrate/frame/staking-async/runtimes/rc/src/lib.rs +++ b/substrate/frame/staking-async/runtimes/rc/src/lib.rs @@ -497,7 +497,7 @@ impl pallet_timestamp::Config for Runtime { impl pallet_authorship::Config for Runtime { type FindAuthor = pallet_session::FindAccountFromAuthorIndex; - type EventHandler = AssetHubStakingClient; + type EventHandler = StakingAhClient; } parameter_types! { @@ -524,7 +524,7 @@ impl sp_runtime::traits::Convert> for IdentityValid } /// A testing type that implements SessionManager, it receives a new validator set from -/// `AssetHubStakingClient`, but it prevents them from being passed over to the session pallet and +/// `StakingAhClient`, but it prevents them from being passed over to the session pallet and /// just uses the previous session keys. pub struct AckButPreviousSessionValidatorsPersist(core::marker::PhantomData); @@ -559,7 +559,7 @@ impl pallet_session::Config for Runtime { type ShouldEndSession = Babe; type NextSessionRotation = Babe; type SessionManager = AckButPreviousSessionValidatorsPersist< - session_historical::NoteHistoricalRoot, + session_historical::NoteHistoricalRoot, >; type SessionHandler = ::KeyTypeIdProviders; type Keys = SessionKeys; @@ -941,7 +941,7 @@ impl pallet_treasury::Config for Runtime { impl pallet_offences::Config for Runtime { type RuntimeEvent = RuntimeEvent; type IdentificationTuple = session_historical::IdentificationTuple; - type OnOffenceHandler = AssetHubStakingClient; + type OnOffenceHandler = StakingAhClient; } impl pallet_authority_discovery::Config for Runtime { @@ -1336,7 +1336,7 @@ impl parachains_inclusion::Config for Runtime { type RuntimeEvent = RuntimeEvent; type DisputesHandler = ParasDisputes; type RewardValidators = - parachains_reward_points::RewardValidatorsWithEraPoints; + parachains_reward_points::RewardValidatorsWithEraPoints; type MessageQueue = MessageQueue; type WeightInfo = weights::polkadot_runtime_parachains_inclusion::WeightInfo; } @@ -1513,7 +1513,7 @@ impl assigned_slots::Config for Runtime { impl parachains_disputes::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RewardValidators = - parachains_reward_points::RewardValidatorsWithEraPoints; + parachains_reward_points::RewardValidatorsWithEraPoints; type SlashingHandler = parachains_slashing::SlashValidatorsForDisputes; type WeightInfo = weights::polkadot_runtime_parachains_disputes::WeightInfo; } @@ -1822,7 +1822,7 @@ mod runtime { 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)]