Skip to content

Commit

Permalink
Add missing staking constants to chain metadata. (#1675)
Browse files Browse the repository at this point in the history
* Add missing staking constants to chain metadata.

* Bump spec version only.
  • Loading branch information
Neopallium authored May 22, 2024
1 parent 2e5d646 commit 941182a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pallets/runtime/develop/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
authoring_version: 1,
// `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc`
// N.B. `d` is unpinned from the binary version
spec_version: 6_003_000,
spec_version: 6_003_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
Expand Down
2 changes: 1 addition & 1 deletion pallets/runtime/mainnet/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
authoring_version: 1,
// `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc`
// N.B. `d` is unpinned from the binary version
spec_version: 6_003_000,
spec_version: 6_003_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
Expand Down
2 changes: 1 addition & 1 deletion pallets/runtime/testnet/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
authoring_version: 1,
// `spec_version: aaa_bbb_ccd` should match node version v`aaa.bbb.cc`
// N.B. `d` is unpinned from the binary version
spec_version: 6_003_000,
spec_version: 6_003_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
Expand Down
9 changes: 9 additions & 0 deletions pallets/staking/src/pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ pub mod pallet {
///
/// This should be less than the bonding duration. Set to 0 if slashes
/// should be applied immediately, without opportunity for intervention.
#[pallet::constant]
type SlashDeferDuration: Get<EraIndex>;

/// Weight information for extrinsics in this pallet.
Expand Down Expand Up @@ -181,6 +182,7 @@ pub mod pallet {
///
/// This is bounded by being within the last session. Hence, setting it to a value more than the
/// length of a session will be pointless.
#[pallet::constant]
type ElectionLookahead: Get<Self::BlockNumber>;

/// The overarching call type.
Expand All @@ -189,15 +191,18 @@ pub mod pallet {
/// Maximum number of balancing iterations to run in the offchain submission.
///
/// If set to 0, balance_solution will not be executed at all.
#[pallet::constant]
type MaxIterations: Get<u32>;

/// The threshold of improvement that should be provided for a new solution to be accepted.
#[pallet::constant]
type MinSolutionScoreBump: Get<Perbill>;

/// The maximum number of nominators rewarded for each validator.
///
/// For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
/// their reward. This used to limit the i/o cost for the nominator payout.
#[pallet::constant]
type MaxNominatorRewardedPerValidator: Get<u32>;

/// The fraction of the validator set that is safe to be offending.
Expand Down Expand Up @@ -234,15 +239,19 @@ pub mod pallet {

/// Maximum amount of validators that can run by an identity.
/// It will be MaxValidatorPerIdentity * Self::validator_count().
#[pallet::constant]
type MaxValidatorPerIdentity: Get<Permill>;

/// Maximum amount of total issuance after which fixed rewards kicks in.
#[pallet::constant]
type MaxVariableInflationTotalIssuance: Get<BalanceOf<Self>>;

/// Yearly total reward amount that gets distributed when fixed rewards kicks in.
#[pallet::constant]
type FixedYearlyReward: Get<BalanceOf<Self>>;

/// Minimum bond amount.
#[pallet::constant]
type MinimumBond: Get<BalanceOf<Self>>;
}

Expand Down

0 comments on commit 941182a

Please sign in to comment.