Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Allow Removal of Session Key when Offboarded as Validator #8543

Closed
shawntabrizi opened this issue Apr 6, 2021 · 7 comments
Closed

Allow Removal of Session Key when Offboarded as Validator #8543

shawntabrizi opened this issue Apr 6, 2021 · 7 comments
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@shawntabrizi
Copy link
Member

There is an issue reported here: paritytech/subport#142

Where a user set up their account to be a validator, created a session key, then offboarded as a validator, but still have their Session Key in the system.

Because the session key is in the system, they have a reference counter which does not let them destroy their account.

In order to call purge_keys we need to call:

	fn do_purge_keys(account: &T::AccountId) -> DispatchResult {
		let who = T::ValidatorIdOf::convert(account.clone())
			.ok_or(Error::<T>::NoAssociatedValidatorId)?;
...

This conversion from AccountId to ValidatorId is needed because we store the session keys indexed by validator id.

The new extrinsic should allow a user to break this lock state by proving the validator doesn't exist in the system and purging their keys because they do not exist.

This should be a "permissionless" call meaning any user can provide this proof.

In this situation, the user facing this issue with cleaning up their account could provide that proof on their own old validator account and clean up their situation without needing to onboard as a validator again.

@shawntabrizi shawntabrizi added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Apr 6, 2021
@rphmeier
Copy link
Contributor

rphmeier commented Apr 6, 2021

The new extrinsic should allow a user to break this lock state by proving the validator doesn't exist in the system and purging their keys because they do not exist.

They'd have to prove that they have been out of the validator set for the entire bonding period. The old session keys are needed to verify misbehavior in the "past" and prevent long-range attacks. Once the funds leave the staking system, they should be able to remove the refcount.

@ghost
Copy link

ghost commented Jun 15, 2021

Have This issue been solved? I still can't remove my session key

@shawntabrizi
Copy link
Member Author

shawntabrizi commented Jun 15, 2021

@Zeusxs This is not a high priority issue for us since there is a solution i mentioned on the issue:

You will need to set your account to become a a validator again, remove the keys from your account, then stop being a validator. There may be another improvement we can make to the story here to make it so that you dont need to become a validator again, but this is something for the future.

So you should be able to solve it yourself. I also think we sent you a treasury tip for the funds that were locked right? (so you should come out of this ahead)

@ghost
Copy link

ghost commented Jun 16, 2021

OK, I have not cloudserver to become a validator again at right now, maybe I could propose some treasury tip? right?

@shawntabrizi
Copy link
Member Author

@Zeusxs you dont actually need to a run a validator. Just go through the steps in the UI.

A tip is also fine. Link to this chat.

@ghost
Copy link

ghost commented Jun 22, 2021

Thank you very much~, I propose a tip just now, here is my address: 123dYiYNBwu4Wy8FjPuz259e5zhfiFWxdFcPqEm1e8YsAMs8

@gavofyork
Copy link
Member

Closed by #10004

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
None yet
Development

No branches or pull requests

3 participants