Skip to content

Conversation

paritytech-release-backport-bot[bot]
Copy link

@paritytech-release-backport-bot paritytech-release-backport-bot bot commented Sep 10, 2025

Backport #9619 into unstable2507 from kianenigma.

See the documentation on how to use this bot.

NOTE: this PR introduces major changes in the staking-async pallet, needed to address critical issues related to Staking vs VMP. They are needed to improve robustness and resilience of the staking machinery (paginated offences, retry mechanism for session report and validator set).

@paritytech-release-backport-bot
Copy link
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-9619-to-unstable2507
git worktree add --checkout .worktree/backport-9619-to-unstable2507 backport-9619-to-unstable2507
cd .worktree/backport-9619-to-unstable2507
git reset --hard HEAD^
git cherry-pick -x f7b0396e3b7f826166cb5acc4a4248307af6d708
git push --force-with-lease

@github-actions github-actions bot added the A3-backport Pull request is already reviewed well in another branch. label Sep 10, 2025
@github-actions github-actions bot requested a review from kianenigma September 10, 2025 07:57
kianenigma and others added 2 commits September 10, 2025 11:53
…et (#9619)

* Please see the full design do
[here](https://docs.google.com/document/d/1l2COWct1f-gC8nM0tq7Xs8pBWeAP6pX0LociWC6enUg/edit?tab=t.0)
* closes paritytech-secops/srlabs_findings#520

This PR makes the following changes:

* `SendToRelayChain` and `SendToAssetHub` traits now return a result,
allowing the caller to know if the underlying XCM was sent or not.
* Adds a number of testing facilities to `pallet-root-offences`, and
`staking-async/papi-tests`. Both of which can be ignored in the review.

* `SendToAssetHub::relay_new_offence` is removed. Instead, we use the
new `relay_new_offence_paged` which is a vector of self-contained
offences, not requiring us to group offences per session in each
message.
* Offences are not sent immediately anymore.
* Instead, they are stored in a paginated `OffenceSendQueue`.
* `on-init`, we grab one page of this storage map, and sent it.

* Session reports now also have a retry mechanism.
* Upon each failure, we emit an `UnexpectedEvent`
* If our retries run out and we still can't send the session report, we
will emit a different `UnexpectedEvent`. We also retore the validator
points that we meant to send, and merge them back, so that they are sent
in the next session report.

* Similar to offences, they are not sent immediately anymore.
* Instead, they are stored in a storage item, and are sent on subsequent
on-inits.
* A maximum retry count is added.

As noted above, ignore all changes in
* `staking-async/runtimes`
* `staking-async/runtimes/papi-tests`
* `root-offences`

As they are only related to testing.

---------

Co-authored-by: Ankan <[email protected]>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit f7b0396)
@sigurpol sigurpol force-pushed the backport-9619-to-unstable2507 branch from f0bf4f0 to a09e049 Compare September 10, 2025 10:01
@sigurpol sigurpol marked this pull request as ready for review September 10, 2025 10:02
@sigurpol sigurpol requested a review from a team as a code owner September 10, 2025 10:02
Copy link
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.

Whether to merge this PR on 2507 and include it in Kusama AHM is currently under discussion with a decision expected very soon.

Note: #9619 has been already merged to master and #9697 to stable2509, with the plan to be included in stable2509-rc2 and be part of upcoming Westend upgrade so that we have time to test before eventually going live on Kusama.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/17614484175
Failed job name: test-linux-stable-runtime-benchmarks

@sigurpol sigurpol changed the title [unstable2507] Backport #9619 [unstable2507] Backport #9619 [DO NOT MERGE YET - WE NEED FIRST TO AGREE IF WE WANT IT for KUSAMA AHM FROM DAY1] Sep 10, 2025
@sigurpol sigurpol changed the title [unstable2507] Backport #9619 [DO NOT MERGE YET - WE NEED FIRST TO AGREE IF WE WANT IT for KUSAMA AHM FROM DAY1] [unstable2507] Backport #9619 [DO NOT MERGE YET - WE WANT TO HAVE IT AFTER KAHM / AFTER 1.8 release] Sep 11, 2025
@sigurpol sigurpol self-requested a review September 11, 2025 08:10
@sigurpol
Copy link
Contributor

The decision is to merge this PR after KAHM and before PAHM. Putting it back to draft so no one is tempted to merge it

@sigurpol sigurpol marked this pull request as draft September 11, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A3-backport Pull request is already reviewed well in another branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants