Companion for substrate/pull/9442 (#3594)

* Fix compact build

* Fix again

* fix staking miner

* fmt

* update Substrate

Co-authored-by: parity-processbot <>
This commit is contained in:
Kian Paimani
2021-08-11 18:24:13 +02:00
committed by GitHub
parent a8245e4a3e
commit b8eefc2d47
5 changed files with 185 additions and 192 deletions
+156 -170
View File
File diff suppressed because it is too large Load Diff
+8 -6
View File
@@ -392,7 +392,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type OffchainRepeat = OffchainRepeat;
type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking;
type CompactSolution = NposCompactSolution24;
type Solution = NposCompactSolution24;
type OnChainAccuracy = Perbill;
type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
@@ -484,7 +484,7 @@ type SlashCancelOrigin = EnsureOneOf<
impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 =
<NposCompactSolution24 as sp_npos_elections::CompactSolution>::LIMIT as u32;
<NposCompactSolution24 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances;
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
@@ -1044,14 +1044,16 @@ impl InstanceFilter<Call> for ProxyType {
Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..)
),
ProxyType::Staking =>
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
),
ProxyType::CancelProxy =>
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
}
}
fn is_superset(&self, o: &Self) -> bool {
+8 -6
View File
@@ -398,7 +398,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking;
type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16;
type Solution = NposCompactSolution16;
type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureOneOf<
@@ -443,7 +443,7 @@ type SlashCancelOrigin = EnsureOneOf<
impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 =
<NposCompactSolution16 as sp_npos_elections::CompactSolution>::LIMIT as u32;
<NposCompactSolution16 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances;
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
@@ -994,14 +994,16 @@ impl InstanceFilter<Call> for ProxyType {
Call::Treasury(..) | Call::Bounties(..) |
Call::Tips(..) | Call::Utility(..)
),
ProxyType::Staking =>
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::IdentityJudgement => matches!(
c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
),
ProxyType::CancelProxy =>
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
}
}
fn is_superset(&self, o: &Self) -> bool {
+11 -8
View File
@@ -380,7 +380,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type MinerTxPriority = NposSolutionPriority;
type DataProvider = Staking;
type OnChainAccuracy = Perbill;
type CompactSolution = NposCompactSolution16;
type Solution = NposCompactSolution16;
type Fallback = Fallback;
type BenchmarkingConfig = runtime_common::elections::BenchmarkConfig;
type ForceOrigin = EnsureRoot<AccountId>;
@@ -411,7 +411,7 @@ parameter_types! {
impl pallet_staking::Config for Runtime {
const MAX_NOMINATIONS: u32 =
<NposCompactSolution16 as sp_npos_elections::CompactSolution>::LIMIT as u32;
<NposCompactSolution16 as sp_npos_elections::NposSolution>::LIMIT as u32;
type Currency = Balances;
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
@@ -708,11 +708,13 @@ impl InstanceFilter<Call> for ProxyType {
Call::Slots(..) |
Call::Auctions(..) // Specifically omitting the entire XCM Pallet
),
ProxyType::Staking =>
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..)),
ProxyType::Staking => {
matches!(c, Call::Staking(..) | Call::Session(..) | Call::Utility(..))
},
ProxyType::SudoBalances => match c {
Call::Sudo(pallet_sudo::Call::sudo(ref x)) =>
matches!(x.as_ref(), &Call::Balances(..)),
Call::Sudo(pallet_sudo::Call::sudo(ref x)) => {
matches!(x.as_ref(), &Call::Balances(..))
},
Call::Utility(..) => true,
_ => false,
},
@@ -720,8 +722,9 @@ impl InstanceFilter<Call> for ProxyType {
c,
Call::Identity(pallet_identity::Call::provide_judgement(..)) | Call::Utility(..)
),
ProxyType::CancelProxy =>
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..))),
ProxyType::CancelProxy => {
matches!(c, Call::Proxy(pallet_proxy::Call::reject_announcement(..)))
},
}
}
fn is_superset(&self, o: &Self) -> bool {
+2 -2
View File
@@ -65,7 +65,7 @@ macro_rules! construct_runtime_prelude {
mod private {
use super::*;
pub(crate) fn [<create_uxt_ $runtime>](
raw_solution: EPM::RawSolution<EPM::CompactOf<Runtime>>,
raw_solution: EPM::RawSolution<EPM::SolutionOf<Runtime>>,
witness: u32,
signer: crate::signer::Signer,
nonce: crate::prelude::Index,
@@ -334,7 +334,7 @@ fn mine_unchecked<T: EPM::Config>(
ext: &mut Ext,
iterations: usize,
do_feasibility: bool,
) -> Result<(EPM::RawSolution<EPM::CompactOf<T>>, u32), Error> {
) -> Result<(EPM::RawSolution<EPM::SolutionOf<T>>, u32), Error> {
ext.execute_with(|| {
let (solution, _) = <EPM::Pallet<T>>::mine_solution(iterations)?;
if do_feasibility {