mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +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:
@@ -100,11 +100,7 @@ use frame_support::{
|
||||
},
|
||||
Parameter,
|
||||
};
|
||||
use frame_system::ensure_none;
|
||||
use frame_system::offchain::{
|
||||
SendTransactionTypes,
|
||||
SubmitTransaction,
|
||||
};
|
||||
use frame_system::{ensure_none, offchain::{SendTransactionTypes, SubmitTransaction}};
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
pub mod sr25519 {
|
||||
@@ -813,7 +809,7 @@ impl<Offender: Clone> Offence<Offender> for UnresponsivenessOffence<Offender> {
|
||||
// basically, 10% can be offline with no slash, but after that, it linearly climbs up to 7%
|
||||
// when 13/30 are offline (around 5% when 1/3 are offline).
|
||||
if let Some(threshold) = offenders.checked_sub(validator_set_count / 10 + 1) {
|
||||
let x = Perbill::from_rational_approximation(3 * threshold, validator_set_count);
|
||||
let x = Perbill::from_rational(3 * threshold, validator_set_count);
|
||||
x.saturating_mul(Perbill::from_percent(7))
|
||||
} else {
|
||||
Perbill::default()
|
||||
|
||||
Reference in New Issue
Block a user