Skip to content

[AHM/Staking] Allow own stake to be collected in all pages#10051

Merged
kianenigma merged 11 commits into
masterfrom
kiz-fix-exposure-own-collection
Oct 20, 2025
Merged

[AHM/Staking] Allow own stake to be collected in all pages#10051
kianenigma merged 11 commits into
masterfrom
kiz-fix-exposure-own-collection

Conversation

@kianenigma

@kianenigma kianenigma commented Oct 19, 2025

Copy link
Copy Markdown
Contributor

TLDR: Thanks to a number of reports from Kusama validator, we have been investigating an issue where the self stake of some validators is not present in ErasStakersPaged and ErasStakersOverview, and consequently not earning staking rewards.

After investigation, it was clear that the polkadot-staking-miner is doing the right thing, and the self-stake is indeed submitted to the chain as a part of the staking election result.

The root cause in how pallet-staking-async ingests the staking election result. This code made a (wrong) assumption that self-stake is only present in the first page of a multi-page election. This PR fixes this issue.


@kianenigma kianenigma added A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch A4-backport-stable2509 Pull request must be backported to the stable2509 release branch labels Oct 19, 2025
@kianenigma

Copy link
Copy Markdown
Contributor Author

/cmd prdoc --bump patch

@kianenigma kianenigma marked this pull request as ready for review October 19, 2025 16:06
@kianenigma kianenigma requested a review from a team as a code owner October 19, 2025 16:06
Comment thread substrate/frame/staking-async/src/session_rotation.rs

@sigurpol sigurpol left a comment

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.

Don’t have my laptop with me so I did look only at code diff on mobile , changes sound proper but it’s definitely not an accurate review as I would love to have at this stage and time pre PAHM. Hopefully unlike me, @Ank4n can double check everything properly.

Also the current bug is maybe something we would like to add to the checklist of the long running staking test we are deploying for AHM

@seadanda seadanda left a comment

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.

Upgrading Ankan's review. Also passed sanity check, but I'm missing some context

@kianenigma kianenigma added this pull request to the merge queue Oct 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2025

@franciscoaguirre franciscoaguirre left a comment

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.

For what it's worth, looks good overall

@kianenigma kianenigma added this pull request to the merge queue Oct 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2025
@kianenigma kianenigma enabled auto-merge October 20, 2025 14:13
@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/18654825072
Failed job name: quick-benchmarks-omni

@kianenigma kianenigma added this pull request to the merge queue Oct 20, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2025
@kianenigma kianenigma added this pull request to the merge queue Oct 20, 2025
Merged via the queue into master with commit 56e4b10 Oct 20, 2025
242 of 244 checks passed
@kianenigma kianenigma deleted the kiz-fix-exposure-own-collection branch October 20, 2025 19:47
@paritytech-release-backport-bot

Copy link
Copy Markdown

Successfully created backport PR for unstable2507:

paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Oct 20, 2025
TLDR: Thanks to a number of reports from Kusama validator, we have been
investigating an issue where the self stake of some validators is not
present in `ErasStakersPaged` and `ErasStakersOverview`, and
consequently not earning staking rewards.

After investigation, it was clear that the `polkadot-staking-miner` is
doing the right thing, and the self-stake is indeed submitted to the
chain as a part of the staking election result.

The root cause in how `pallet-staking-async` ingests the staking
election result. This code **made a (wrong) assumption that self-stake
is only present in the first page of a multi-page election. This PR
fixes this issue.**

---

- [x] (nice to have) revisit try-state checks of the pallet,
`ErasStakersPaged`, `ErasStakersOverview` and `ErasTotalStake` are
triple checked for correctness
- [ ] (nice to have) fix related displays in PJS:
polkadot-js/apps#11930
- [ ] backport to 2507 and 2509
- Westend
- [ ] Find a similar issue in westend for monitoring
(paritytech/devops#4402)
  - [ ] Upgrade westend to a branch/release containing this fix
- [ ] Upgrade westend with this fix, observe test examples are resolved
- [ ] Bump backported version in `fellowship/runtimes`
- [ ] Release 1.9.3 for Kusama with this fix
- [ ] Ensure known test cases are fixed
- One example: `F2WyUUFXLYnBg6acv7t2KFzH6D7CyNcvC4mRCwUdsHTUB4t` (in
election round 46, likely repeating in subsequent ones too)
- This PR will be part of Polkadot release 2.0.0, the Polkadot AHM.
- [ ] Forum post with further explanation once PR is merged.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 56e4b10)
paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Oct 20, 2025
TLDR: Thanks to a number of reports from Kusama validator, we have been
investigating an issue where the self stake of some validators is not
present in `ErasStakersPaged` and `ErasStakersOverview`, and
consequently not earning staking rewards.

After investigation, it was clear that the `polkadot-staking-miner` is
doing the right thing, and the self-stake is indeed submitted to the
chain as a part of the staking election result.

The root cause in how `pallet-staking-async` ingests the staking
election result. This code **made a (wrong) assumption that self-stake
is only present in the first page of a multi-page election. This PR
fixes this issue.**

---

- [x] (nice to have) revisit try-state checks of the pallet,
`ErasStakersPaged`, `ErasStakersOverview` and `ErasTotalStake` are
triple checked for correctness
- [ ] (nice to have) fix related displays in PJS:
polkadot-js/apps#11930
- [ ] backport to 2507 and 2509
- Westend
- [ ] Find a similar issue in westend for monitoring
(paritytech/devops#4402)
  - [ ] Upgrade westend to a branch/release containing this fix
- [ ] Upgrade westend with this fix, observe test examples are resolved
- [ ] Bump backported version in `fellowship/runtimes`
- [ ] Release 1.9.3 for Kusama with this fix
- [ ] Ensure known test cases are fixed
- One example: `F2WyUUFXLYnBg6acv7t2KFzH6D7CyNcvC4mRCwUdsHTUB4t` (in
election round 46, likely repeating in subsequent ones too)
- This PR will be part of Polkadot release 2.0.0, the Polkadot AHM.
- [ ] Forum post with further explanation once PR is merged.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 56e4b10)
@paritytech-release-backport-bot

Copy link
Copy Markdown

Successfully created backport PR for stable2509:

kianenigma added a commit that referenced this pull request Oct 20, 2025
Backport #10051 into `unstable2507` from kianenigma.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
kianenigma added a commit that referenced this pull request Oct 20, 2025
Backport #10051 into `stable2509` from kianenigma.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Polkadot-Forum

Copy link
Copy Markdown

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/psa-disruption-to-kusama-validators-self-stake-and-rewards/15599/1

fellowship-merge-bot Bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Oct 21, 2025
Brings paritytech/polkadot-sdk#10051 to here, to
be made into a 1.9.3 release for Kusama.

Can be merged, but a 1.9.3 release should come only after we verify the
fix in westend.

---------

Co-authored-by: Dónal Murray <donalm@seadanda.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2509 Pull request must be backported to the stable2509 release branch A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants