Skip to content

Implementation of ah-client and rc-client staking pallets#7582

Merged
kianenigma merged 34 commits intomasterfrom
tsv-ahm-staking-pallets
Feb 18, 2025
Merged

Implementation of ah-client and rc-client staking pallets#7582
kianenigma merged 34 commits intomasterfrom
tsv-ahm-staking-pallets

Conversation

@tdimitrov
Copy link
Copy Markdown
Contributor

Recreation of #7357 on top of master. The old PR messes up the git history too much so I am recreating it from scratch.

This PR is work in progress. It's purpose is to commit initial structure of pallet-staking-ah-client and pallet-staking-rc-client to master. The changes will be polished by a follow up PRs which will be backported.

Related issues: #6167 and #6166

This PR introduces the initial structure for pallet-ah-client and pallet-rc-client. These pallets will reside on the relay chain and AssetHub, respectively, and will manage the interaction between pallet-session on the relay chain and pallet-staking on AssetHub.

Both pallets are experimental and not intended for production use.

TODOs:

@tdimitrov tdimitrov added T2-pallets This PR/Issue is related to a particular pallet. T8-polkadot This PR/Issue is related to/affects the Polkadot network. R1-breaking_change This PR introduces a breaking change and should be highlighted in the upcoming release. labels Feb 15, 2025
@tdimitrov tdimitrov requested a review from a team as a code owner February 15, 2025 07:06
@kianenigma kianenigma enabled auto-merge February 17, 2025 15:25
@kianenigma kianenigma added this pull request to the merge queue Feb 18, 2025
Merged via the queue into master with commit 669b889 Feb 18, 2025
222 of 232 checks passed
@kianenigma kianenigma deleted the tsv-ahm-staking-pallets branch February 18, 2025 03:46
clangenb pushed a commit to clangenb/polkadot-sdk that referenced this pull request Feb 19, 2025
…#7582)

Recreation of paritytech#7357 on
top of master. The old PR messes up the git history too much so I am
recreating it from scratch.

This PR is work in progress. It's purpose is to commit initial structure
of `pallet-staking-ah-client` and `pallet-staking-rc-client` to master.
The changes will be polished by a follow up PRs which will be
backported.

Related issues: paritytech#6167
and paritytech#6166

This PR introduces the initial structure for `pallet-ah-client` and
`pallet-rc-client`. These pallets will reside on the relay chain and
AssetHub, respectively, and will manage the interaction between
`pallet-session` on the relay chain and `pallet-staking` on AssetHub.

Both pallets are experimental and not intended for production use.

TODOs:
- [ ] Probably handle
paritytech#6344 here.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
@kianenigma kianenigma mentioned this pull request Mar 14, 2025
40 tasks
tdimitrov added a commit that referenced this pull request Mar 16, 2025
Ank4n added a commit that referenced this pull request Mar 16, 2025
@miss-stake miss-stake moved this from In progress to Scheduled in Security Audit (PRs) - SRLabs Mar 24, 2025
github-merge-queue bot pushed a commit that referenced this pull request Mar 24, 2025
#7939)

Revert the following PRs which we are pulling from release stable2503:
- #7582
- #7424
- #7282

and leave pallet-staking in its pre-AHM state.

## Context

We are forking pallet-staking into `pallet-staking` (also referred as
staking-classic, this is the version that will stay on RC) and
`pallet-staking-next` which will live on AH post AHM.

Additional context:
#7858 (comment)

These changes in crate `pallet-staking` will become the staking classic.
The staking next version is worked in the PR #7601.

## For AHM migration
The `UnappliedSlashes` storage will need to be translated from
`rc::staking-classic` to `ah::staking-next`.
[Bookmarking](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/staking/src/migrations.rs#L91)
the code that can be referred for this.

## Follow ups
(cc: @tdimitrov and @seadanda )
1) Revert pallet-staking v17 migration in westend.
- Update `in code storage version` of pallet-staking storage from 17 to
16 (separate PR).
- Update `on chain storage version` of pallet-staking storage from 17 to
16. The storage key for pallet-staking on chain version is
`0x5f3e4907f716ac89b6347d15ececedca4e7b9012096b41c4eb3aaf947f6ea429`
which should be set currently to `0x1100`, and needs to be updated to
`0x1000`.
- After the runtime upgrade with the code from this PR is deployed on
Westend, kill the following storage prefixes under the Pallet prefix
`Staking`:
  - OffenceQueue
  - OffenceQueueEras
  - ProcessingOffence
- UnappliedSlashes: This also exists in staking-classic as a storage map
(one key) and in pre-revert code as double storage map (two keys).
Killing with prefix `UnappliedSlashes` may kill the ones created post
upgrade (but that's okay for westend).
  - VoterSnapshotStatus
  - NextElectionPage
  - ElectableStashes

2) Remove exposure dependency
Worked in the PR: #7936.

---------

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Maciej <maciej.zyszkiewicz@parity.io>
Ank4n added a commit that referenced this pull request Mar 25, 2025
#7939)

Revert the following PRs which we are pulling from release stable2503:
- #7582
- #7424
- #7282

and leave pallet-staking in its pre-AHM state.

We are forking pallet-staking into `pallet-staking` (also referred as
staking-classic, this is the version that will stay on RC) and
`pallet-staking-next` which will live on AH post AHM.

Additional context:
#7858 (comment)

These changes in crate `pallet-staking` will become the staking classic.
The staking next version is worked in the PR #7601.

The `UnappliedSlashes` storage will need to be translated from
`rc::staking-classic` to `ah::staking-next`.
[Bookmarking](https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/staking/src/migrations.rs#L91)
the code that can be referred for this.

(cc: @tdimitrov and @seadanda )
1) Revert pallet-staking v17 migration in westend.
- Update `in code storage version` of pallet-staking storage from 17 to
16 (separate PR).
- Update `on chain storage version` of pallet-staking storage from 17 to
16. The storage key for pallet-staking on chain version is
`0x5f3e4907f716ac89b6347d15ececedca4e7b9012096b41c4eb3aaf947f6ea429`
which should be set currently to `0x1100`, and needs to be updated to
`0x1000`.
- After the runtime upgrade with the code from this PR is deployed on
Westend, kill the following storage prefixes under the Pallet prefix
`Staking`:
  - OffenceQueue
  - OffenceQueueEras
  - ProcessingOffence
- UnappliedSlashes: This also exists in staking-classic as a storage map
(one key) and in pre-revert code as double storage map (two keys).
Killing with prefix `UnappliedSlashes` may kill the ones created post
upgrade (but that's okay for westend).
  - VoterSnapshotStatus
  - NextElectionPage
  - ElectableStashes

2) Remove exposure dependency
Worked in the PR: #7936.

---------

Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Maciej <maciej.zyszkiewicz@parity.io>
@miss-stake miss-stake moved this from Scheduled to In progress in Security Audit (PRs) - SRLabs Apr 29, 2025
@redzsina redzsina moved this from In progress to Waiting for fix in Security Audit (PRs) - SRLabs Jun 30, 2025
@redzsina redzsina moved this from Waiting for fix to Audited in Security Audit (PRs) - SRLabs Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R1-breaking_change This PR introduces a breaking change and should be highlighted in the upcoming release. T2-pallets This PR/Issue is related to a particular pallet. T8-polkadot This PR/Issue is related to/affects the Polkadot network.

Projects

Status: Audited
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants