substrate
substrate copied to clipboard
Fast Unstake Pallet
Fixes #8436
This is a pallet that does one thing and one thing only: allow you to unstake from the staking system quickly IFF you are not exposed (i.e. not in the Exposure of any validator) in any of the last BondingDuration eras. Optionally, this pallet allows one to join a pool on the fly as they unstake.
Multiple ideas exist to implement this, all of which have been discussed in #8436. This PR is probably the most conservative approach in terms of security, yet it is the least efficient for the chain. To be specific, the pallet will schedule background tasks to check the entire exposure table of the stash who wants to unstake over multiple blocks. This is not fast, does waste chain resources, but it is safe.
@rossbulat and I have the intention to merge this before 9.29 release and implement it in the staking dashboard as well, hopefully providing a much better UX for those who wish to migrate from staking to Pools.
TODO:
- [x] Tests @rossbulat
- [ ] Issue for future task: de-couple this from the
nomination_poolspallet.
/cmd queue -c fmt $ 1
@kianenigma https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1821792 was started for your command "$PIPELINE_SCRIPTS_DIR/fmt.sh" 1. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment /cmd cancel 64-18b8c03f-5490-45c1-b956-56a81fbf8497 to cancel this command or /cmd cancel to cancel all commands in this pull request.
@kianenigma Command "$PIPELINE_SCRIPTS_DIR/fmt.sh" 1 has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1821792 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1821792/artifacts/download.
First superficial look at this PR: we need to explain what the heck "not exposed" means in layman's terms. Stating that it's not in the Exposure of any validator is not good enough, because it begs the question "what exactly is an Exposure for a validator?"
First superficial look at this PR: we need to explain what the heck "not exposed" means in layman's terms. Stating that it's not in the
Exposureof any validator is not good enough, because it begs the question "what exactly is anExposurefor a validator?"
https://github.com/paritytech/substrate/pull/12129/commits/c925741d271716d21f0e34b9f4f16e08707a8852
Do you want more docs for review and developer purposes, or for end users?
For the former, I think adding more context here is moot. This pallet relies on pallet_staking and concepts such as Exposure are explained there.
For the latter, I also think more than this is not useful because I don't think anyone wants (or is capable of) checking whether they are exposed or not. The wallet would identify this, and if the user is eligible, would report it to them. So the real audience here is wallet developers. s
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/nomination-pools-integration/361/1
Minor nitpicks but LGTM! :+1:
/cmd queue -c fmt $ 1
@kianenigma https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1861972 was started for your command "$PIPELINE_SCRIPTS_DIR/fmt.sh" 1. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment /cmd cancel 37-5c1b3b9b-da7c-4321-b653-9f26689237fc to cancel this command or /cmd cancel to cancel all commands in this pull request.
@kianenigma Command "$PIPELINE_SCRIPTS_DIR/fmt.sh" 1 has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1861972 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1861972/artifacts/download.
merging this, won't go to Polkadot yet.
bot merge
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/path-to-fast-unstake-in-polkadot-kusama/1539/1
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/polkadot-digest-17-jan-2023/1706/1