Skip to content

Conversation

@andreitrand
Copy link
Contributor

The "staking-async" pallet has inherited the list of invulnerable validators from the "staking" pallet, but these are no longer used. We can therefore remove them, together with additional clean-up.

@andreitrand andreitrand self-assigned this Nov 18, 2025
@andreitrand andreitrand requested a review from a team as a code owner November 18, 2025 17:47
@andreitrand andreitrand added T2-pallets This PR/Issue is related to a particular pallet. T14-system_parachains This PR/Issue is related to system parachains. labels Nov 18, 2025
@andreitrand andreitrand marked this pull request as draft November 18, 2025 17:47
@andreitrand andreitrand force-pushed the andreitrand-staking-async-remove-invulnerables branch from 731b526 to 46d4497 Compare November 18, 2025 17:48
@sigurpol
Copy link
Contributor

sigurpol commented Nov 19, 2025

beside the usual pr_doc, grepping for MaxInvulnerables and set_invulnerables and invulnerables in general under staking-async still show quite few occurrences. Do we want to remove the invulnerable feature completely from the staking-async pallet? If yes, there is more cleanup needed in staking-async and in the runtimes.

It would be great to explain in the PR also if the feature was used in other runtimes (including polkadot, kusama under fellowship) and describe breaking changes there that will need to be addressed once integrated.

Do we also need to cleanup storage items once we remove Invulnerables?

(For some of these questions, surely @kianenigma and @Ank4n can help 😄 )

@kianenigma
Copy link
Contributor

kianenigma commented Nov 19, 2025

My previous understanding was that while we still mistakenly read Invulnerables (such as in slashing), I am pretty sure we never set it anywhere (other than in genesis), and even if we set it, it has no meaning other than "don't slash these guys". In other words, even if Invulnerables are set, they will not become active validators. So there might be many occurrences left, but I suspect most are a noop and won't break any tests etc.

If there are entanglements that we are not aware of, for example if a million test cases break, @andreitrand please share your findings first and then we can revise if it is sensible to continue with this.

@andreitrand andreitrand force-pushed the andreitrand-staking-async-remove-invulnerables branch from 46d4497 to 535884a Compare November 21, 2025 12:54
@andreitrand
Copy link
Contributor Author

/cmd prdoc

@andreitrand andreitrand force-pushed the andreitrand-staking-async-remove-invulnerables branch from 54323ec to c7f6f94 Compare November 21, 2025 15:30
@andreitrand
Copy link
Contributor Author

Based on the original issue I aimed to remove references to (type) Invulnerables, MaxInvulnerables and any related getters, setters (ex: fn set_invulnerables(...)) and tests (ex: fn invulnerables_are_not_slashed()) that appeared in the staking-async pallet only. To this end I made sure the following checks succeed:

cargo build --release
cargo test -p pallet-staking-async
cargo test -p pallet-staking-async --features runtime-benchmarks benchmark
cargo test -p pallet-staking
cargo test -p pallet-staking --features runtime-benchmarks benchmark
cargo check -p asset-hub-westend-runtime
cargo check -p pallet-staking-async
cargo check -p pallet-staking

Having said that, multiple references to type MaxInvulnerables and type Invulnerables remain as part of the collator pallet's Config which is referenced across multiple parachains in Cumulus. Multiple references to variables named invulnerables also remain, in Cumulus and other pallets as well.

Are there any other suitable test commands that can help me which of these are no longer relevant, given what I've removed so far?

@andreitrand andreitrand force-pushed the andreitrand-staking-async-remove-invulnerables branch from c7f6f94 to 38c62e7 Compare November 21, 2025 17:10
andreitrand and others added 2 commits November 21, 2025 19:11
The "staking-async" pallet has inherited the list of invulnerable validators
from the "staking" pallet, but these are no longer used. We can therefore
remove them, together with additional clean-up.

---------

Signed-off-by: Andrei Trandafir <andrei.trandafir@parity.io>
@andreitrand andreitrand force-pushed the andreitrand-staking-async-remove-invulnerables branch from 38c62e7 to 310ab2f Compare November 21, 2025 17:11
@andreitrand andreitrand marked this pull request as ready for review November 21, 2025 17:33
@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/19578544815
Failed job name: cargo-clippy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T2-pallets This PR/Issue is related to a particular pallet. T14-system_parachains This PR/Issue is related to system parachains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants