Reduce staking miner reward (companion substrate/pull/9395) (#3465)

* Reduce staking miner reward

* Add EOF

* Fix stuff

* remove import

* Add tyoe

* remove redundant stuff

* update Substrate

Co-authored-by: kianenigma <kian@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Zeke Mostov
2021-07-23 02:58:29 -07:00
committed by GitHub
parent 7788de8164
commit aac9d77ee2
6 changed files with 170 additions and 216 deletions
+5 -12
View File
@@ -35,7 +35,7 @@ use runtime_common::{
claims, paras_registrar, xcm_sender, slots, auctions, crowdloan,
SlowAdjustingFeeUpdate, CurrencyToVote, impls::DealWithFees,
BlockHashCount, RocksDbWeight, BlockWeights, BlockLength,
OffchainSolutionWeightLimit, OffchainSolutionLengthLimit, elections::fee_for_submit_call,
OffchainSolutionWeightLimit, OffchainSolutionLengthLimit,
ToAuthor,
};
@@ -66,7 +66,7 @@ use xcm_executor::XcmExecutor;
use sp_arithmetic::Perquintill;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys, ApplyExtrinsicResult, KeyTypeId, Percent,
Permill, Perbill, FixedPointNumber,
Permill, Perbill,
transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority},
traits::{
BlakeTwo256, Block as BlockT, OpaqueKeys, ConvertInto, AccountIdLookup,
@@ -347,7 +347,6 @@ impl pallet_session::historical::Config for Runtime {
type FullIdentificationOf = pallet_staking::ExposureOf<Runtime>;
}
use pallet_election_provider_multi_phase::WeightInfo;
parameter_types! {
// phase durations. 1/4 of the last session for each.
pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
@@ -360,15 +359,8 @@ parameter_types! {
// This formula is currently adjusted such that a typical solution will spend an amount equal
// to the base deposit for every 50 kb.
pub const SignedDepositByte: Balance = deposit(1, 0) / (50 * 1024);
pub SignedRewardBase: Balance = fee_for_submit_call::<Runtime>(
// give 20% threshold.
sp_runtime::FixedU128::saturating_from_rational(12, 10),
// maximum weight possible.
weights::pallet_election_provider_multi_phase::WeightInfo::<Runtime>::submit(SignedMaxSubmissions::get()),
// assume a solution of 100kb length.
100 * 1024
);
// Each good submission will get 1/10 KSM as reward
pub SignedRewardBase: Balance = UNITS / 10;
// fallback: emergency phase.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
pallet_election_provider_multi_phase::FallbackStrategy::Nothing;
@@ -391,6 +383,7 @@ sp_npos_elections::generate_solution_type!(
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type Currency = Balances;
type EstimateCallFee = TransactionPayment;
type UnsignedPhase = UnsignedPhase;
type SignedMaxSubmissions = SignedMaxSubmissions;
type SignedRewardBase = SignedRewardBase;