mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
staking: Flexible generation of reward curve and associated tweaks (#8327)
* Initial abstraction * Alter rest of APIs * Fixes * Some extra getters in Gilt pallet. * Refactor Gilt to avoid u128 conversions * Simplify and improve pow in per_things * Add scalar division to per_things * Renaming from_fraction -> from_float, drop _approximation * Fixes * Fixes * Fixes * Fixes * Make stuff build * Fixes * Fixes * Fixes * Fixes * Update .gitignore Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/gilt/src/lib.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/gilt/src/mock.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Fixes * Fixes * Fixes Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -471,7 +471,7 @@ parameter_types! {
|
||||
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
||||
pub const MaxIterations: u32 = 10;
|
||||
// 0.05%. The higher the value, the more strict solution acceptance becomes.
|
||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational(5u32, 10_000);
|
||||
pub OffchainSolutionWeightLimit: Weight = RuntimeBlockWeights::get()
|
||||
.get(DispatchClass::Normal)
|
||||
.max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed")
|
||||
@@ -496,7 +496,7 @@ impl pallet_staking::Config for Runtime {
|
||||
pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>
|
||||
>;
|
||||
type SessionInterface = Self;
|
||||
type RewardCurve = RewardCurve;
|
||||
type EraPayout = pallet_staking::ConvertCurve<RewardCurve>;
|
||||
type NextNewSession = Session;
|
||||
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
|
||||
type ElectionLookahead = ElectionLookahead;
|
||||
@@ -520,7 +520,7 @@ parameter_types! {
|
||||
pub const Fallback: pallet_election_provider_multi_phase::FallbackStrategy =
|
||||
pallet_election_provider_multi_phase::FallbackStrategy::Nothing;
|
||||
|
||||
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational_approximation(1u32, 10_000);
|
||||
pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000);
|
||||
|
||||
// miner configs
|
||||
pub const MultiPhaseUnsignedPriority: TransactionPriority = StakingUnsignedPriority::get() - 1u64;
|
||||
@@ -767,7 +767,7 @@ parameter_types! {
|
||||
pub const DepositPerContract: Balance = TombstoneDeposit::get();
|
||||
pub const DepositPerStorageByte: Balance = deposit(0, 1);
|
||||
pub const DepositPerStorageItem: Balance = deposit(1, 0);
|
||||
pub RentFraction: Perbill = Perbill::from_rational_approximation(1u32, 30 * DAYS);
|
||||
pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);
|
||||
pub const SurchargeReward: Balance = 150 * MILLICENTS;
|
||||
pub const SignedClaimHandicap: u32 = 2;
|
||||
pub const MaxDepth: u32 = 32;
|
||||
@@ -1065,6 +1065,7 @@ parameter_types! {
|
||||
impl pallet_gilt::Config for Runtime {
|
||||
type Event = Event;
|
||||
type Currency = Balances;
|
||||
type CurrencyBalance = Balance;
|
||||
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
|
||||
type Deficit = ();
|
||||
type Surplus = ();
|
||||
|
||||
Reference in New Issue
Block a user