Skip to content

Clear ledger instead of recovering (bonded, no ledger or lock)#3866

Closed
gpestana wants to merge 35 commits intomasterfrom
gpestana/ledger-badstate-clean-clear
Closed

Clear ledger instead of recovering (bonded, no ledger or lock)#3866
gpestana wants to merge 35 commits intomasterfrom
gpestana/ledger-badstate-clean-clear

Conversation

@gpestana
Copy link
Contributor

No description provided.

// Some(total_444_before_corruption),
// None,
//));
assert_ok!(Staking::restore_ledger(RuntimeOrigin::root(), 444, None, None, None),);
Copy link
Contributor Author

@gpestana gpestana Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Base automatically changed from gpestana/ledger-badstate-clean to master March 27, 2024 17:44
@paritytech-ci paritytech-ci requested a review from a team as a code owner March 27, 2024 17:44
@kianenigma
Copy link
Contributor

Will this be needed, or we settled to keep the existing fix?

@kianenigma
Copy link
Contributor

ping?

@kianenigma kianenigma closed this May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants