mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 15:51:04 +00:00
companion for 11350 (#5489)
* fix all runtimes
* fix staking miner
* update lockfile for {"substrate"}
Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+171
-171
File diff suppressed because it is too large
Load Diff
@@ -439,6 +439,28 @@ impl onchain::Config for OnChainSeqPhragmen {
|
|||||||
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
|
||||||
|
type AccountId = AccountId;
|
||||||
|
type MaxLength = OffchainSolutionLengthLimit;
|
||||||
|
type MaxWeight = OffchainSolutionWeightLimit;
|
||||||
|
type Solution = NposCompactSolution24;
|
||||||
|
type MaxVotesPerVoter = <
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::DataProvider
|
||||||
|
as
|
||||||
|
frame_election_provider_support::ElectionDataProvider
|
||||||
|
>::MaxVotesPerVoter;
|
||||||
|
|
||||||
|
// The unsigned submissions have to respect the weight of the submit_unsigned call, thus their
|
||||||
|
// weight estimate function is wired to this call's weight.
|
||||||
|
fn solution_weight(v: u32, t: u32, a: u32, d: u32) -> Weight {
|
||||||
|
<
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::WeightInfo
|
||||||
|
as
|
||||||
|
pallet_election_provider_multi_phase::WeightInfo
|
||||||
|
>::submit_unsigned(v, t, a, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl pallet_election_provider_multi_phase::Config for Runtime {
|
impl pallet_election_provider_multi_phase::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
@@ -450,18 +472,17 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
|
|||||||
type SignedDepositBase = SignedDepositBase;
|
type SignedDepositBase = SignedDepositBase;
|
||||||
type SignedDepositByte = SignedDepositByte;
|
type SignedDepositByte = SignedDepositByte;
|
||||||
type SignedDepositWeight = ();
|
type SignedDepositWeight = ();
|
||||||
type SignedMaxWeight = Self::MinerMaxWeight;
|
type SignedMaxWeight =
|
||||||
|
<Self::MinerConfig as pallet_election_provider_multi_phase::MinerConfig>::MaxWeight;
|
||||||
|
type MinerConfig = Self;
|
||||||
type SlashHandler = (); // burn slashes
|
type SlashHandler = (); // burn slashes
|
||||||
type RewardHandler = (); // nothing to do upon rewards
|
type RewardHandler = (); // nothing to do upon rewards
|
||||||
type SignedPhase = SignedPhase;
|
type SignedPhase = SignedPhase;
|
||||||
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
||||||
type BetterSignedThreshold = ();
|
type BetterSignedThreshold = ();
|
||||||
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
|
|
||||||
type MinerMaxLength = OffchainSolutionLengthLimit;
|
|
||||||
type OffchainRepeat = OffchainRepeat;
|
type OffchainRepeat = OffchainRepeat;
|
||||||
type MinerTxPriority = NposSolutionPriority;
|
type MinerTxPriority = NposSolutionPriority;
|
||||||
type DataProvider = Staking;
|
type DataProvider = Staking;
|
||||||
type Solution = NposCompactSolution24;
|
|
||||||
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
||||||
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
||||||
type Solver = SequentialPhragmen<
|
type Solver = SequentialPhragmen<
|
||||||
|
|||||||
@@ -479,6 +479,28 @@ impl onchain::Config for OnChainSeqPhragmen {
|
|||||||
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
|
||||||
|
type AccountId = AccountId;
|
||||||
|
type MaxLength = OffchainSolutionLengthLimit;
|
||||||
|
type MaxWeight = OffchainSolutionWeightLimit;
|
||||||
|
type Solution = NposCompactSolution16;
|
||||||
|
type MaxVotesPerVoter = <
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::DataProvider
|
||||||
|
as
|
||||||
|
frame_election_provider_support::ElectionDataProvider
|
||||||
|
>::MaxVotesPerVoter;
|
||||||
|
|
||||||
|
// The unsigned submissions have to respect the weight of the submit_unsigned call, thus their
|
||||||
|
// weight estimate function is wired to this call's weight.
|
||||||
|
fn solution_weight(v: u32, t: u32, a: u32, d: u32) -> Weight {
|
||||||
|
<
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::WeightInfo
|
||||||
|
as
|
||||||
|
pallet_election_provider_multi_phase::WeightInfo
|
||||||
|
>::submit_unsigned(v, t, a, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl pallet_election_provider_multi_phase::Config for Runtime {
|
impl pallet_election_provider_multi_phase::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
@@ -491,17 +513,16 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
|
|||||||
type SignedDepositBase = SignedDepositBase;
|
type SignedDepositBase = SignedDepositBase;
|
||||||
type SignedDepositByte = SignedDepositByte;
|
type SignedDepositByte = SignedDepositByte;
|
||||||
type SignedDepositWeight = ();
|
type SignedDepositWeight = ();
|
||||||
type SignedMaxWeight = Self::MinerMaxWeight;
|
type SignedMaxWeight =
|
||||||
|
<Self::MinerConfig as pallet_election_provider_multi_phase::MinerConfig>::MaxWeight;
|
||||||
|
type MinerConfig = Self;
|
||||||
type SlashHandler = (); // burn slashes
|
type SlashHandler = (); // burn slashes
|
||||||
type RewardHandler = (); // nothing to do upon rewards
|
type RewardHandler = (); // nothing to do upon rewards
|
||||||
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
||||||
type BetterSignedThreshold = ();
|
type BetterSignedThreshold = ();
|
||||||
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
|
|
||||||
type MinerMaxLength = OffchainSolutionLengthLimit;
|
|
||||||
type OffchainRepeat = OffchainRepeat;
|
type OffchainRepeat = OffchainRepeat;
|
||||||
type MinerTxPriority = NposSolutionPriority;
|
type MinerTxPriority = NposSolutionPriority;
|
||||||
type DataProvider = Staking;
|
type DataProvider = Staking;
|
||||||
type Solution = NposCompactSolution16;
|
|
||||||
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
||||||
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
||||||
type Solver = SequentialPhragmen<
|
type Solver = SequentialPhragmen<
|
||||||
|
|||||||
@@ -382,6 +382,28 @@ impl onchain::Config for OnChainSeqPhragmen {
|
|||||||
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl pallet_election_provider_multi_phase::MinerConfig for Runtime {
|
||||||
|
type AccountId = AccountId;
|
||||||
|
type MaxLength = OffchainSolutionLengthLimit;
|
||||||
|
type MaxWeight = OffchainSolutionWeightLimit;
|
||||||
|
type Solution = NposCompactSolution16;
|
||||||
|
type MaxVotesPerVoter = <
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::DataProvider
|
||||||
|
as
|
||||||
|
frame_election_provider_support::ElectionDataProvider
|
||||||
|
>::MaxVotesPerVoter;
|
||||||
|
|
||||||
|
// The unsigned submissions have to respect the weight of the submit_unsigned call, thus their
|
||||||
|
// weight estimate function is wired to this call's weight.
|
||||||
|
fn solution_weight(v: u32, t: u32, a: u32, d: u32) -> Weight {
|
||||||
|
<
|
||||||
|
<Self as pallet_election_provider_multi_phase::Config>::WeightInfo
|
||||||
|
as
|
||||||
|
pallet_election_provider_multi_phase::WeightInfo
|
||||||
|
>::submit_unsigned(v, t, a, d)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl pallet_election_provider_multi_phase::Config for Runtime {
|
impl pallet_election_provider_multi_phase::Config for Runtime {
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
@@ -394,17 +416,16 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
|
|||||||
type SignedDepositBase = SignedDepositBase;
|
type SignedDepositBase = SignedDepositBase;
|
||||||
type SignedDepositByte = SignedDepositByte;
|
type SignedDepositByte = SignedDepositByte;
|
||||||
type SignedDepositWeight = ();
|
type SignedDepositWeight = ();
|
||||||
type SignedMaxWeight = Self::MinerMaxWeight;
|
type SignedMaxWeight =
|
||||||
|
<Self::MinerConfig as pallet_election_provider_multi_phase::MinerConfig>::MaxWeight;
|
||||||
|
type MinerConfig = Self;
|
||||||
type SlashHandler = (); // burn slashes
|
type SlashHandler = (); // burn slashes
|
||||||
type RewardHandler = (); // nothing to do upon rewards
|
type RewardHandler = (); // nothing to do upon rewards
|
||||||
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
type BetterUnsignedThreshold = BetterUnsignedThreshold;
|
||||||
type BetterSignedThreshold = ();
|
type BetterSignedThreshold = ();
|
||||||
type MinerMaxWeight = OffchainSolutionWeightLimit; // For now use the one from staking.
|
|
||||||
type MinerMaxLength = OffchainSolutionLengthLimit;
|
|
||||||
type OffchainRepeat = OffchainRepeat;
|
type OffchainRepeat = OffchainRepeat;
|
||||||
type MinerTxPriority = NposSolutionPriority;
|
type MinerTxPriority = NposSolutionPriority;
|
||||||
type DataProvider = Staking;
|
type DataProvider = Staking;
|
||||||
type Solution = NposCompactSolution16;
|
|
||||||
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
|
||||||
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
|
||||||
type Solver = SequentialPhragmen<
|
type Solver = SequentialPhragmen<
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ fn force_create_snapshot<T: EPM::Config>(ext: &mut Ext) -> Result<(), Error<T>>
|
|||||||
async fn print_info<T: EPM::Config>(
|
async fn print_info<T: EPM::Config>(
|
||||||
rpc: &SharedRpcClient,
|
rpc: &SharedRpcClient,
|
||||||
ext: &mut Ext,
|
ext: &mut Ext,
|
||||||
raw_solution: &EPM::RawSolution<EPM::SolutionOf<T>>,
|
raw_solution: &EPM::RawSolution<EPM::SolutionOf<T::MinerConfig>>,
|
||||||
extrinsic: &Bytes,
|
extrinsic: &Bytes,
|
||||||
) where
|
) where
|
||||||
<T as EPM::Config>::Currency: Currency<T::AccountId, Balance = Balance>,
|
<T as EPM::Config>::Currency: Currency<T::AccountId, Balance = Balance>,
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ enum Error<T: EPM::Config> {
|
|||||||
Codec(#[from] codec::Error),
|
Codec(#[from] codec::Error),
|
||||||
Crypto(sp_core::crypto::SecretStringError),
|
Crypto(sp_core::crypto::SecretStringError),
|
||||||
RemoteExternalities(&'static str),
|
RemoteExternalities(&'static str),
|
||||||
PalletMiner(EPM::unsigned::MinerError<T>),
|
PalletMiner(EPM::unsigned::MinerError),
|
||||||
PalletElection(EPM::ElectionError<T>),
|
PalletElection(EPM::ElectionError<T>),
|
||||||
PalletFeasibility(EPM::FeasibilityError),
|
PalletFeasibility(EPM::FeasibilityError),
|
||||||
AccountDoesNotExists,
|
AccountDoesNotExists,
|
||||||
@@ -254,8 +254,8 @@ impl<T: EPM::Config> From<sp_core::crypto::SecretStringError> for Error<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: EPM::Config> From<EPM::unsigned::MinerError<T>> for Error<T> {
|
impl<T: EPM::Config> From<EPM::unsigned::MinerError> for Error<T> {
|
||||||
fn from(e: EPM::unsigned::MinerError<T>) -> Error<T> {
|
fn from(e: EPM::unsigned::MinerError) -> Error<T> {
|
||||||
Error::PalletMiner(e)
|
Error::PalletMiner(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -463,7 +463,7 @@ async fn create_election_ext<T: EPM::Config, B: BlockT + DeserializeOwned>(
|
|||||||
fn mine_solution<T, S>(
|
fn mine_solution<T, S>(
|
||||||
ext: &mut Ext,
|
ext: &mut Ext,
|
||||||
do_feasibility: bool,
|
do_feasibility: bool,
|
||||||
) -> Result<EPM::RawSolution<EPM::SolutionOf<T>>, Error<T>>
|
) -> Result<EPM::RawSolution<EPM::SolutionOf<T::MinerConfig>>, Error<T>>
|
||||||
where
|
where
|
||||||
T: EPM::Config,
|
T: EPM::Config,
|
||||||
S: NposSolver<
|
S: NposSolver<
|
||||||
@@ -473,7 +473,7 @@ where
|
|||||||
{
|
{
|
||||||
ext.execute_with(|| {
|
ext.execute_with(|| {
|
||||||
let (solution, _) =
|
let (solution, _) =
|
||||||
<EPM::Pallet<T>>::mine_solution::<S>().map_err::<Error<T>, _>(Into::into)?;
|
<EPM::Pallet<T>>::mine_solution().map_err::<Error<T>, _>(Into::into)?;
|
||||||
if do_feasibility {
|
if do_feasibility {
|
||||||
let _ = <EPM::Pallet<T>>::feasibility_check(
|
let _ = <EPM::Pallet<T>>::feasibility_check(
|
||||||
solution.clone(),
|
solution.clone(),
|
||||||
@@ -489,7 +489,7 @@ fn mine_with<T>(
|
|||||||
solver: &Solver,
|
solver: &Solver,
|
||||||
ext: &mut Ext,
|
ext: &mut Ext,
|
||||||
do_feasibility: bool,
|
do_feasibility: bool,
|
||||||
) -> Result<EPM::RawSolution<EPM::SolutionOf<T>>, Error<T>>
|
) -> Result<EPM::RawSolution<EPM::SolutionOf<T::MinerConfig>>, Error<T>>
|
||||||
where
|
where
|
||||||
T: EPM::Config,
|
T: EPM::Config,
|
||||||
T::Solver: NposSolver<Error = sp_npos_elections::Error>,
|
T::Solver: NposSolver<Error = sp_npos_elections::Error>,
|
||||||
|
|||||||
Reference in New Issue
Block a user