Skip to content

[Staking] Cleanups and some improvements#8701

Merged
Ank4n merged 24 commits intomasterfrom
ankn/bounded-era-reward
Jun 10, 2025
Merged

[Staking] Cleanups and some improvements#8701
Ank4n merged 24 commits intomasterfrom
ankn/bounded-era-reward

Conversation

@Ank4n
Copy link
Copy Markdown
Contributor

@Ank4n Ank4n commented May 29, 2025

Changes

  • Introduced a new min_bond value, which is the minimum of MinValidatorBond and MinNominatorBond, with a fallback to ExistentialDeposit. Since ED on AH is much lower than on RC, this ensures we enforce some min bonds for staking to cover storage costs for staking ledger and related data.
  • Added an upper bound on era duration, protecting against anomalous conditions that could otherwise lead to excessive inflation.
  • Some refactors to gracefully handle unexpected validator activation in RC.

TODO

  • Set MaxEraDuration in WAH.
  • Port full unbond (will do in a separate PR)

@Ank4n Ank4n added the T2-pallets This PR/Issue is related to a particular pallet. label Jun 2, 2025
@Ank4n Ank4n marked this pull request as ready for review June 3, 2025 14:36
@Ank4n Ank4n requested a review from a team as a code owner June 3, 2025 14:36
@Ank4n Ank4n changed the title Bound era reward and introduce min bond [Staking] Cleanups and some improvements Jun 3, 2025
@Ank4n
Copy link
Copy Markdown
Contributor Author

Ank4n commented Jun 4, 2025

/cmd prdoc --audience runtime_dev

Copy link
Copy Markdown
Contributor

@sigurpol sigurpol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely not the most authoritative reviewer in town 😅 but it looks good to me

@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/15537362934
Failed job name: fmt

@Ank4n
Copy link
Copy Markdown
Contributor Author

Ank4n commented Jun 9, 2025

/cmd fmt

/// This function computes the smallest allowed bond among `MinValidatorBond` and
/// `MinNominatorBond`, but ensures it is not below the existential deposit required to keep an
/// account alive.
pub(crate) fn min_bond() -> BalanceOf<T> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub(crate) fn min_bond() -> BalanceOf<T> {
pub(crate) fn min_chilled_bond() -> BalanceOf<T> {

and then two more for

fn min_validator_bond
fn min_nominator_bond

?

Copy link
Copy Markdown
Contributor Author

@Ank4n Ank4n Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged but still pls check!

Copy link
Copy Markdown
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good 🚀

@Ank4n Ank4n added the R0-no-crate-publish-required The change does not require any crates to be re-published. label Jun 9, 2025
@Ank4n Ank4n added this pull request to the merge queue Jun 10, 2025
Merged via the queue into master with commit b8ccdb4 Jun 10, 2025
317 of 321 checks passed
@Ank4n Ank4n deleted the ankn/bounded-era-reward branch June 10, 2025 08:31
pgherveou pushed a commit that referenced this pull request Jun 11, 2025
## Changes
- Introduced a new `min_bond` value, which is the minimum of
`MinValidatorBond` and `MinNominatorBond`, with a fallback to
`ExistentialDeposit`. Since ED on AH is much lower than on RC, this
ensures we enforce some min bonds for staking to cover storage costs for
staking ledger and related data.
- Added an upper bound on era duration, protecting against anomalous
conditions that could otherwise lead to excessive inflation.
- Some refactors to gracefully handle unexpected validator activation in
RC.


## TODO
- [ ] Set `MaxEraDuration` in WAH.
- [ ] Port [full
unbond](#3811) (will do
in a separate PR)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ordian added a commit that referenced this pull request Jun 12, 2025
* master: (62 commits)
  release/build-macos-binaries: add missing FEATURES argument  (#8816)
  Add XCM Precompile to `pallet-xcm` (#8693)
  [Release|CI/CD] Exclude test runtimes from the runtimes build (#8820)
  Add freebsd sysinfo for telemetry (#7985)
  release-reusable-rc-build: add optional `features` input that can be considered for nodes building (#8755)
  [Staking] Cleanups and some improvements (#8701)
  Fix typos in 3 files in Implementers Guide (#8799)
  Update `RemoteExporter` docs to reflect removal of `forward_id_for` (#8795)
  Snowbridge: enforce fee when registering Polkadot native asset (#8725)
  Bump the ci_dependencies group across 1 directory with 7 updates (#8788)
  Docker hub 'master' image short sha (#8790)
  [Release|CI/CD] Combine branch-off and RC automation flows (#8754)
  Move Transaction depth limit checks (#8750)
  Add genesis presets for remaining runtimes in polkadot-parachain-bin (#8426)
  Do not make pallet-identity benchmarks signature-dependent (#8179)
  Introduction of Approval Slashes [Disabling Strategy Stage 4] (#6827)
  [AHM] Prepare For Westend Cleanup (#8715)
  Actually use RP offset in YAP parachain (#8745)
  [AHM] Relax the requirement for RC-Client to receive +1 session reports (#8702)
  Don't read storage items in logging (#8749)
  ...
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
## Changes
- Introduced a new `min_bond` value, which is the minimum of
`MinValidatorBond` and `MinNominatorBond`, with a fallback to
`ExistentialDeposit`. Since ED on AH is much lower than on RC, this
ensures we enforce some min bonds for staking to cover storage costs for
staking ledger and related data.
- Added an upper bound on era duration, protecting against anomalous
conditions that could otherwise lead to excessive inflation.
- Some refactors to gracefully handle unexpected validator activation in
RC.


## TODO
- [ ] Set `MaxEraDuration` in WAH.
- [ ] Port [full
unbond](#3811) (will do
in a separate PR)

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R0-no-crate-publish-required The change does not require any crates to be re-published. T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants