Clear ledger instead of recovering (bonded, no ledger or lock)#3866
Closed
Clear ledger instead of recovering (bonded, no ledger or lock)#3866
Conversation
… to recover all corrupted cases
…=dev --target_dir=substrate --pallet=pallet_staking
…=westend --target_dir=polkadot --pallet=pallet_staking
gpestana
commented
Mar 27, 2024
| // Some(total_444_before_corruption), | ||
| // None, | ||
| //)); | ||
| assert_ok!(Staking::restore_ledger(RuntimeOrigin::root(), 444, None, None, None),); |
Contributor
Author
There was a problem hiding this comment.
The problem with this is that this call will clear the 444 bond/ledger completely. However, you can see in the comments above and the test case that at no place the stash 444 wanted to unbond (it got to this state by a "kill(333)" by proxy).
So in sum, we should aim at:
- 333 killed and unbonded completely
- 444 recovered with a state pre-corruption
which the previous code ensured.
wdyt?
Contributor
There was a problem hiding this comment.
Yes this is true. In my approach, I would just clear out both storage and locks since on-chain connection between 333 and 444 is broken. We could make a modification though where we squash these two together so it works as in your case but then we trust staking admin on this connection.
Contributor
|
Will this be needed, or we settled to keep the existing fix? |
Contributor
|
ping? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.