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
+4 -12
View File
@@ -36,7 +36,6 @@ use runtime_common::{
impls::ToAuthor,
BlockHashCount, BlockWeights, BlockLength, RocksDbWeight,
OffchainSolutionWeightLimit, OffchainSolutionLengthLimit,
elections::fee_for_submit_call,
};
use runtime_parachains::origin as parachains_origin;
@@ -65,7 +64,7 @@ use xcm_builder::{
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys, FixedPointNumber,
create_runtime_str, generic, impl_opaque_keys,
ApplyExtrinsicResult, KeyTypeId, Perbill, curve::PiecewiseLinear,
transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority},
traits::{
@@ -332,7 +331,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;
@@ -345,15 +343,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 WND as reward
pub SignedRewardBase: Balance = 1 * UNITS;
// fallback: emergency phase.
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
pallet_election_provider_multi_phase::FallbackStrategy::Nothing;
@@ -377,6 +368,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 SignedPhase = SignedPhase;
type UnsignedPhase = UnsignedPhase;
type SignedMaxSubmissions = SignedMaxSubmissions;
+1
View File
@@ -36,3 +36,4 @@ fn sample_size_is_sensible() {
assert!(max_weight * 2 < BlockWeights::get().max_block);
assert!(<Runtime as auctions::Config>::WeightInfo::on_initialize() * 2 < BlockWeights::get().max_block);
}