[Pools] Fix issues with member migration to DelegateStake#4822
[Pools] Fix issues with member migration to DelegateStake#4822
DelegateStake#4822Conversation
396dded to
0c776b8
Compare
|
The CI pipeline was cancelled due to failure one of the required jobs. |
| ); | ||
| } | ||
|
|
||
| #[cfg(all(test, feature = "try-runtime"))] |
| /// Remove self from storage. | ||
| pub(crate) fn remove(key: &T::AccountId) { | ||
| debug_assert!(<Agents<T>>::contains_key(key), "Agent should exist in storage"); | ||
| <Agents<T>>::remove(key); |
There was a problem hiding this comment.
| <Agents<T>>::remove(key); | |
| Agents::<T>::remove(key); |
(same suggestion for fn update)
* master: (167 commits) Upgrade accidentally downgraded deps (#5365) [Pools] Fix issues with member migration to `DelegateStake` (#4822) Unify `no_genesis` check (#5360) [CI] Fix prdoc command (#5358) Beefy: add benchmarks for `report_fork_voting()` (#5188) Fix OurViewChange small race (#5356) Make ticket non-optional and add ensure_successful method to Consideration trait (#5359) [tests] dedup test code, add more tests, improve naming and docs (#5338) Stop running the wishlist workflow on forks (#5297) Migrate foreign assets v3::Location to v4::Location (#4129) Minor clean up (#5284) [Pools] Ensure members can always exit the pool gracefully (#4998) StorageWeightReclaim: set to node pov size if higher (#5281) [Bot] Add prdoc generation (#5331) Small nits found accidentally along the way (#5341) Create subsystem-benchmarks.yml (#5325) Bump libp2p-identity from 0.2.8 to 0.2.9 (#5232) Bump authoring duration for async backing to 2s. (#5195) Fix spelling issues (#5206) Bump the known_good_semver group across 1 directory with 3 updates (#5315) ...
* master: Remove redundant minimal template workspace (#5330) approval-distribution: Fix handling of conclude (#5375) More logs in `is_potential_spam` from `dispute-coordinator` (#5252) Fix zombienet bridges test (#5373) Update Readme of the `polkadot` crate (#5326) allow for `u8` to be used as hold/freeze reason (#5348) Moving cargo check for runtimes to GHA (#5340) Update links in the documentation (#5175) fix visibility for `pallet_nfts` types used as call arguments (#3634) Correct some typos in crates' descriptions (#5262) Aura: Ensure we are building on each relay chain fork (#5352) Update Identity pallet README.md (#5183) Bump trie-db from 0.29.0 to 0.29.1 (#5231) [Coretime] Always include UnpaidExecution, not just when revenue is > 0 (#5369) [Pools] fix derivation of pool account (#4999) Upgrade accidentally downgraded deps (#5365) [Pools] Fix issues with member migration to `DelegateStake` (#4822) Unify `no_genesis` check (#5360) [CI] Fix prdoc command (#5358) Beefy: add benchmarks for `report_fork_voting()` (#5188)
…ct-candidate-weight * ao-fix-parainclusion-weight-overestimation: Remove redundant minimal template workspace (#5330) approval-distribution: Fix handling of conclude (#5375) More logs in `is_potential_spam` from `dispute-coordinator` (#5252) Fix zombienet bridges test (#5373) Update Readme of the `polkadot` crate (#5326) allow for `u8` to be used as hold/freeze reason (#5348) Moving cargo check for runtimes to GHA (#5340) Update links in the documentation (#5175) fix visibility for `pallet_nfts` types used as call arguments (#3634) Correct some typos in crates' descriptions (#5262) Aura: Ensure we are building on each relay chain fork (#5352) Update Identity pallet README.md (#5183) Bump trie-db from 0.29.0 to 0.29.1 (#5231) [Coretime] Always include UnpaidExecution, not just when revenue is > 0 (#5369) [Pools] fix derivation of pool account (#4999) Upgrade accidentally downgraded deps (#5365) [Pools] Fix issues with member migration to `DelegateStake` (#4822) Unify `no_genesis` check (#5360) [CI] Fix prdoc command (#5358) Beefy: add benchmarks for `report_fork_voting()` (#5188)
|
@Ank4n Any chance that this change might reap accounts that withdraw on chains that never used a non-delegated nomination pool to begin with? |
Can you elaborate? In a delegated pool, the user fund should stay with the user account as a hold amount when in the pool, or free balance when withdrawn. Or do I misunderstand your question? |
|
We currently have the issue that accounts get reaped when the try and withdraw their unbounded funds and it seems one of the few changes to the runtime that alters provider count handling that which might cause the accidental reaping seems to be this PR (at least after some preliminary investigation). The account had thousand of staked and free tokens before triggering the withdrawal, far above the existential deposit. EDIT: I was now able to replicate the issue in testing. Seems if the funds are unbonded on an old runtime (v1.15), they will lead to the account to be reaped if the withdrawal happens after an upgrade to new runtime (v1.17): |
|
@FlorianFranzen So accounts are getting reaped even when they have more than ED balance? That's not good. Can you share your test code? |
|
The test "code" is rather simple: Run a chain with nomination pool and delegated staking on v1.15, unbond funds from any pool, upgrade to v1.17 (v1.16 might be similar) and withdrawn the unbonded funds. I will be able to provided some ready to use example once I am done downgrading out mainnet and reimbursing effected users. 🤞 |


Context
Pool members using the old
TransferStakestrategy were able to transfer all their funds to the pool. WithDelegateStakechanges, we want to ensure similar behaviour by allowing members to delegate all their stake to the pool.Changes
DelegateStakewhich can be used withKusamaandPolkadotruntime state. closes [Pools] Remote Externalities test for DelegateStake strategy #4629.Addressing possible migration errors
Pool members migrating can run into two types of errors:
DelegateStakesince this may mean they are able to use the same staked funds in the pool. Users would need to withdraw all their funds from staking, in order to migrate their pool funds.Another error that was earlier possible was when member's free balance is below ED. This PR adds a provider to delegator allowing all user balance including ED can be contributed towards the pool. This helps
1095accounts in Polkadot and41accounts in Kusama to migrate now which would have earlier failed.Results from RemoteExternalities Tests.
Kusama
Migration stats: success: 3017, direct_stakers: 361, unexpected_errors: 0Polkadot
Migration stats: success: 42859, direct_stakers: 643, unexpected_errors: 0TODO