Skip to content

Commit 09dcd16

Browse files
bkchrkianenigmaNikVolfjoepetrowski
authored
pallet-staking: Expose missing consts (#6456)
* `pallet-staking`: Expose missing consts * Apply suggestions from code review Co-authored-by: Nikolay Volf <[email protected]> Co-authored-by: joe petrowski <[email protected]> * Update the source docs Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Nikolay Volf <[email protected]> Co-authored-by: joe petrowski <[email protected]>
1 parent 03ab1fd commit 09dcd16

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

src/lib.rs

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,10 @@ pub trait Trait: frame_system::Trait + SendTransactionTypes<Call<Self>> {
865865
/// Number of eras that staked funds must remain bonded for.
866866
type BondingDuration: Get<EraIndex>;
867867

868-
/// Number of eras that slashes are deferred by, after computation. This should be less than the
869-
/// bonding duration. Set to 0 if slashes should be applied immediately, without opportunity for
870-
/// intervention.
868+
/// Number of eras that slashes are deferred by, after computation.
869+
///
870+
/// This should be less than the bonding duration. Set to 0 if slashes
871+
/// should be applied immediately, without opportunity for intervention.
871872
type SlashDeferDuration: Get<EraIndex>;
872873

873874
/// The origin which can cancel a deferred slash. Root can always do this.
@@ -884,6 +885,7 @@ pub trait Trait: frame_system::Trait + SendTransactionTypes<Call<Self>> {
884885
type NextNewSession: EstimateNextNewSession<Self::BlockNumber>;
885886

886887
/// The number of blocks before the end of the era from which election submissions are allowed.
888+
///
887889
/// Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
888890
/// be used.
889891
///
@@ -894,14 +896,15 @@ pub trait Trait: frame_system::Trait + SendTransactionTypes<Call<Self>> {
894896
/// The overarching call type.
895897
type Call: Dispatchable + From<Call<Self>> + IsSubType<Module<Self>, Self> + Clone;
896898

897-
/// Maximum number of balancing iterations to run in the offchain submission. If set to 0,
898-
/// balance_solution will not be executed at all.
899+
/// Maximum number of balancing iterations to run in the offchain submission.
900+
///
901+
/// If set to 0, balance_solution will not be executed at all.
899902
type MaxIterations: Get<u32>;
900903

901904
/// The threshold of improvement that should be provided for a new solution to be accepted.
902905
type MinSolutionScoreBump: Get<Perbill>;
903906

904-
/// The maximum number of nominator rewarded for each validator.
907+
/// The maximum number of nominators rewarded for each validator.
905908
///
906909
/// For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
907910
/// their reward. This used to limit the i/o cost for the nominator payout.
@@ -1275,6 +1278,36 @@ decl_module! {
12751278
/// Number of eras that staked funds must remain bonded for.
12761279
const BondingDuration: EraIndex = T::BondingDuration::get();
12771280

1281+
/// Number of eras that slashes are deferred by, after computation.
1282+
///
1283+
/// This should be less than the bonding duration.
1284+
/// Set to 0 if slashes should be applied immediately, without opportunity for
1285+
/// intervention.
1286+
const SlashDeferDuration: EraIndex = T::SlashDeferDuration::get();
1287+
1288+
/// The number of blocks before the end of the era from which election submissions are allowed.
1289+
///
1290+
/// Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
1291+
/// be used.
1292+
///
1293+
/// This is bounded by being within the last session. Hence, setting it to a value more than the
1294+
/// length of a session will be pointless.
1295+
const ElectionLookahead: T::BlockNumber = T::ElectionLookahead::get();
1296+
1297+
/// Maximum number of balancing iterations to run in the offchain submission.
1298+
///
1299+
/// If set to 0, balance_solution will not be executed at all.
1300+
const MaxIterations: u32 = T::MaxIterations::get();
1301+
1302+
/// The threshold of improvement that should be provided for a new solution to be accepted.
1303+
const MinSolutionScoreBump: Perbill = T::MinSolutionScoreBump::get();
1304+
1305+
/// The maximum number of nominators rewarded for each validator.
1306+
///
1307+
/// For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
1308+
/// their reward. This used to limit the i/o cost for the nominator payout.
1309+
const MaxNominatorRewardedPerValidator: u32 = T::MaxNominatorRewardedPerValidator::get();
1310+
12781311
type Error = Error<T>;
12791312

12801313
fn deposit_event() = default;

0 commit comments

Comments
 (0)