mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 19:21:03 +00:00
Companion for substrate#9448 (#3527)
* Companion for substrate#9448 * fix on_disabled * use temporary beefy branch * revert beefy updates * update Substrate Co-authored-by: Andronik Ordian <write@reusable.software> Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+176
-176
File diff suppressed because it is too large
Load Diff
@@ -307,7 +307,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_shift_session_manager::Pallet<Runtime>;
|
type SessionManager = pallet_shift_session_manager::Pallet<Runtime>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = ();
|
|
||||||
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -423,7 +423,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_shift_session_manager::Pallet<Runtime>;
|
type SessionManager = pallet_shift_session_manager::Pallet<Runtime>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = ();
|
|
||||||
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,7 +162,6 @@ mod tests {
|
|||||||
type SessionManager = ();
|
type SessionManager = ();
|
||||||
type SessionHandler = TestSessionHandler;
|
type SessionHandler = TestSessionHandler;
|
||||||
type Keys = UintAuthorityId;
|
type Keys = UintAuthorityId;
|
||||||
type DisabledValidatorsThreshold = ();
|
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +175,7 @@ mod tests {
|
|||||||
|
|
||||||
fn on_new_session<Ks: sp_runtime::traits::OpaqueKeys>(_: bool, _: &[(AccountId, Ks)], _: &[(AccountId, Ks)]) {}
|
fn on_new_session<Ks: sp_runtime::traits::OpaqueKeys>(_: bool, _: &[(AccountId, Ks)], _: &[(AccountId, Ks)]) {}
|
||||||
|
|
||||||
fn on_disabled(_: usize) {}
|
fn on_disabled(_: u32) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_test_ext() -> TestExternalities {
|
fn new_test_ext() -> TestExternalities {
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ impl<T: pallet_session::Config> OneSessionHandler<T::AccountId>
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_disabled(_: usize) {}
|
fn on_disabled(_: u32) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A placeholder since there is currently no provided session key handler for parachain validator
|
/// A placeholder since there is currently no provided session key handler for parachain validator
|
||||||
@@ -179,7 +179,7 @@ impl<T: pallet_session::Config> OneSessionHandler<T::AccountId>
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_disabled(_: usize) {}
|
fn on_disabled(_: u32) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -326,10 +326,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pallet_session::Config for Runtime {
|
impl pallet_session::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type ValidatorId = AccountId;
|
type ValidatorId = AccountId;
|
||||||
@@ -339,7 +335,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
|
||||||
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -497,6 +492,7 @@ parameter_types! {
|
|||||||
// 27 eras in which slashes can be cancelled (slightly less than 7 days).
|
// 27 eras in which slashes can be cancelled (slightly less than 7 days).
|
||||||
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
||||||
pub const MaxNominatorRewardedPerValidator: u32 = 256;
|
pub const MaxNominatorRewardedPerValidator: u32 = 256;
|
||||||
|
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlashCancelOrigin = EnsureOneOf<
|
type SlashCancelOrigin = EnsureOneOf<
|
||||||
@@ -531,6 +527,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type EraPayout = EraPayout;
|
type EraPayout = EraPayout;
|
||||||
type NextNewSession = Session;
|
type NextNewSession = Session;
|
||||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||||
|
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
|
||||||
// Use the nominators map to iter voters, but also perform the bags-list migration and keep
|
// Use the nominators map to iter voters, but also perform the bags-list migration and keep
|
||||||
// it up-to-date.
|
// it up-to-date.
|
||||||
type SortedListProvider = runtime_common::elections::UseNominatorsAndUpdateBagsList<Runtime>;
|
type SortedListProvider = runtime_common::elections::UseNominatorsAndUpdateBagsList<Runtime>;
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ impl<T: pallet_session::Config + Config> OneSessionHandler<T::AccountId> for Pal
|
|||||||
<Pallet<T>>::on_new_session(changed, session_index, validators, Some(queued));
|
<Pallet<T>>::on_new_session(changed, session_index, validators, Some(queued));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_disabled(_i: usize) {}
|
fn on_disabled(_i: u32) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ impl<T: pallet_session::Config + Config> OneSessionHandler<T::AccountId> for Pal
|
|||||||
AssignmentKeysUnsafe::<T>::set(assignment_keys);
|
AssignmentKeysUnsafe::<T>::set(assignment_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_disabled(_i: usize) {}
|
fn on_disabled(_i: u32) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -348,10 +348,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pallet_session::Config for Runtime {
|
impl pallet_session::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type ValidatorId = AccountId;
|
type ValidatorId = AccountId;
|
||||||
@@ -361,7 +357,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
|
||||||
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,6 +459,7 @@ parameter_types! {
|
|||||||
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
||||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||||
pub const MaxNominatorRewardedPerValidator: u32 = 256;
|
pub const MaxNominatorRewardedPerValidator: u32 = 256;
|
||||||
|
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlashCancelOrigin = EnsureOneOf<
|
type SlashCancelOrigin = EnsureOneOf<
|
||||||
@@ -495,6 +491,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type SessionInterface = Self;
|
type SessionInterface = Self;
|
||||||
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
||||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||||
|
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
|
||||||
type NextNewSession = Session;
|
type NextNewSession = Session;
|
||||||
type ElectionProvider = ElectionProviderMultiPhase;
|
type ElectionProvider = ElectionProviderMultiPhase;
|
||||||
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
|
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ use sp_runtime::{
|
|||||||
OpaqueKeys, SaturatedConversion, Verify,
|
OpaqueKeys, SaturatedConversion, Verify,
|
||||||
},
|
},
|
||||||
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
|
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
|
||||||
ApplyExtrinsicResult, KeyTypeId, Perbill,
|
ApplyExtrinsicResult, KeyTypeId,
|
||||||
};
|
};
|
||||||
use sp_staking::SessionIndex;
|
use sp_staking::SessionIndex;
|
||||||
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
|
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
|
||||||
@@ -465,10 +465,6 @@ impl pallet_transaction_payment::Config for Runtime {
|
|||||||
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Special `ValidatorIdOf` implementation that is just returning the input as result.
|
/// Special `ValidatorIdOf` implementation that is just returning the input as result.
|
||||||
pub struct ValidatorIdOf;
|
pub struct ValidatorIdOf;
|
||||||
impl sp_runtime::traits::Convert<AccountId, Option<AccountId>> for ValidatorIdOf {
|
impl sp_runtime::traits::Convert<AccountId, Option<AccountId>> for ValidatorIdOf {
|
||||||
@@ -486,7 +482,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, ValidatorManager>;
|
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, ValidatorManager>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,10 +273,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
pub storage DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pallet_session::Config for Runtime {
|
impl pallet_session::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type ValidatorId = AccountId;
|
type ValidatorId = AccountId;
|
||||||
@@ -286,7 +282,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = Staking;
|
type SessionManager = Staking;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -315,6 +310,7 @@ parameter_types! {
|
|||||||
pub storage SlashDeferDuration: pallet_staking::EraIndex = 27;
|
pub storage SlashDeferDuration: pallet_staking::EraIndex = 27;
|
||||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||||
pub storage MaxNominatorRewardedPerValidator: u32 = 64;
|
pub storage MaxNominatorRewardedPerValidator: u32 = 64;
|
||||||
|
pub storage OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
pub const MaxAuthorities: u32 = 100_000;
|
pub const MaxAuthorities: u32 = 100_000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,6 +336,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type SessionInterface = Self;
|
type SessionInterface = Self;
|
||||||
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
||||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||||
|
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
|
||||||
type NextNewSession = Session;
|
type NextNewSession = Session;
|
||||||
type ElectionProvider =
|
type ElectionProvider =
|
||||||
frame_election_provider_support::onchain::OnChainSequentialPhragmen<Self>;
|
frame_election_provider_support::onchain::OnChainSequentialPhragmen<Self>;
|
||||||
|
|||||||
@@ -312,10 +312,6 @@ impl_opaque_keys! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
|
||||||
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl pallet_session::Config for Runtime {
|
impl pallet_session::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type ValidatorId = AccountId;
|
type ValidatorId = AccountId;
|
||||||
@@ -325,7 +321,6 @@ impl pallet_session::Config for Runtime {
|
|||||||
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
type SessionManager = pallet_session::historical::NoteHistoricalRoot<Self, Staking>;
|
||||||
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
|
||||||
type Keys = SessionKeys;
|
type Keys = SessionKeys;
|
||||||
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
|
|
||||||
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_session::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,6 +424,7 @@ parameter_types! {
|
|||||||
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
pub const SlashDeferDuration: pallet_staking::EraIndex = 27;
|
||||||
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
|
||||||
pub const MaxNominatorRewardedPerValidator: u32 = 64;
|
pub const MaxNominatorRewardedPerValidator: u32 = 64;
|
||||||
|
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_election_provider_support::onchain::Config for Runtime {
|
impl frame_election_provider_support::onchain::Config for Runtime {
|
||||||
@@ -454,6 +450,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type SessionInterface = Self;
|
type SessionInterface = Self;
|
||||||
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
||||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||||
|
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
|
||||||
type NextNewSession = Session;
|
type NextNewSession = Session;
|
||||||
type ElectionProvider = ElectionProviderMultiPhase;
|
type ElectionProvider = ElectionProviderMultiPhase;
|
||||||
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
|
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self>;
|
||||||
|
|||||||
Reference in New Issue
Block a user