Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRAME] Remove Gov V1 from Polkadot and Kusama & unlock/unreserve funds #485

Closed
11 of 12 tasks
kianenigma opened this issue Feb 20, 2023 · 17 comments
Closed
11 of 12 tasks
Assignees
Labels
I5-enhancement An additional feature request.

Comments

@kianenigma
Copy link
Contributor

kianenigma commented Feb 20, 2023

Originally posted by @kianenigma in paritytech/polkadot#6701 (comment)

Tasks

Unreserving / unlocking details

We need to unreserve / unlock all funds in the pallets before we delete the storage.

more info from @kianenigma :

do a quick analysis of the code of these pallets and find all deposit instances within FRAME, every time we reserve a deposit, we alway store it somewhere in the storage of the pallet as well (namely because we only recently started to use named deposits, so it was hard to keep record). Example: https://github.com/paritytech/substrate/blob/master/frame/elections-phragmen/src/lib.rs#L154

Then you can create some kind fake storage map for these maps (using #[storage_alist] macro), iterate the map, unreserve.

For locks it is similar, but simpler because the locks are all stored in the balances pallet; you just need to recover the PalletId of all of these pallets, then call into Balances::remove_lock.

@Gioyik
Copy link

Gioyik commented Mar 2, 2023

@kianenigma I would like to work on this if that is ok. A few questions:

  • I will use runtime/kusama/src/lib.rs as reference for the polkadot section. Does the same needs to be done for rococo and westend libs?
  • I can identify clean up in node/service/src/chain_spec.rs and runtime/**/src/xcm_config.rs. Is there another place I might be missing?

@Gioyik
Copy link

Gioyik commented Mar 15, 2023

fyi, I have been working on this, in this branch: https://github.com/Gioyik/polkadot/tree/gio-opengov1-storage-cleanup

@liamaharon liamaharon changed the title Cleanup storage associated with Gov V1 from Polkadot an Kusama Remove Gov V1 from Polkadot an Kusama Apr 6, 2023
@liamaharon liamaharon changed the title Remove Gov V1 from Polkadot an Kusama Remove Gov V1 from Polkadot and Kusama Apr 6, 2023
@liamaharon
Copy link
Contributor

Hey @Gioyik, the task isn't about removing the pallets from the runtime code (already done in paritytech/polkadot#6701) but rather about cleaning up the DB storage used by those pallets. I've updated the issue description with some more details, still up for grabs if you want it but obviously no obligation :).

@muharem
Copy link
Contributor

muharem commented Apr 24, 2023

Whats the status? Anyone working on this?

@ggwpez
Copy link
Member

ggwpez commented Apr 24, 2023

Whats the status? Anyone working on this?

No. Gov V1 must first be properly disabled & undeployed as XLC commented here paritytech/polkadot#6977 (comment)
I am not sure what the proposed timeline for this is, i imagine there is an overlap period also no Polkadot for Gov V1.

@muharem
Copy link
Contributor

muharem commented Apr 24, 2023

Removal of Kusama Gov V1 already in master.
And I think this migration can be part of the pallet, we will need it for Polkadot as well. Also might be useful for others.

@liamaharon
Copy link
Contributor

liamaharon commented Apr 27, 2023

Removal of Kusama Gov V1 already in master. And I think this migration can be part of the pallet, we will need it for Polkadot as well. Also might be useful for others.

Given Gov V1 is removed from Kusama (correct is us we're wrong @ggwpez) I'm going to start working on a migration to unlock gov v1 funds and remove the storage in the next couple days.

@ggwpez
Copy link
Member

ggwpez commented Apr 28, 2023

Okay i missed that we already un-deployed it on Kusama in paritytech/polkadot#6701.
Then yes, please go ahead @liamaharon

@xlc
Copy link
Contributor

xlc commented May 23, 2023

The upcoming Kusama runtime 9420 have removed gov1 yet does not refund locked tokens. It means people still have token locked in gov1 will not able to access those token.

@liamaharon
Copy link
Contributor

liamaharon commented May 23, 2023

Thanks for bumping this @xlc, prioritising it now

@xlc
Copy link
Contributor

xlc commented May 30, 2023

@liamaharon can we do those in a lazy migration way?
i.e. add a permissionless extrinsic to return deposits so users can call those to get their funds back
this makes this migration suitable for parachains without worrying big pov issue.

@liamaharon
Copy link
Contributor

liamaharon commented May 30, 2023

Valid concern @xlc, thanks for raising.

If we find an instance where one of the migrations is too risky to run due to PoV issues I can convert it to be multi-block, finalizing multi-block migrations is high on the priority stack and this seems like a perfect application for it. If for some reason multi-block migrations are delayed and parachains need to migrate, then we should consider adding a lazy option as you suggest.

@ggwpez
Copy link
Member

ggwpez commented May 30, 2023

Yea I am working on a small version of #198. The migration gets in an optional Cursor and can advance that to its liking.

@kianenigma kianenigma changed the title Remove Gov V1 from Polkadot and Kusama & unlock/unreserve funds [FRAME] Remove Gov V1 from Polkadot and Kusama & unlock/unreserve funds Jun 26, 2023
@juangirini juangirini transferred this issue from paritytech/polkadot Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
@liamaharon
Copy link
Contributor

@jam10o-new
Copy link

Heya.

I'm sitting on a Kusama account that still has a democracy lock on it. Not completely sure what's going on there, but it looks like many, many other accounts are affected. Somewhere to start looking around could be accounts with votes that were expired (ready to unlock) but not unlocked during the migration (ie, they would not be visible in VotingOf or DepositOf, the storage you checked in your migration, and just needed a simple call to democracy.unlock()), but I also notice some high-conviction votes that wouldn't have been expired at the time of migration with this issue, so it's probably not that simple.

To illustrate the scale of this issue, you can go to any gov1 referendum:

https://kusama.subscan.io/referenda

and look through the voters. Almost all voters who have votes that are not labelled as expired also still have a democracy lock, but this is not a rule.

(for illustration, here's the final referendum: https://kusama.subscan.io/referenda/273, and the first voter you see there: https://kusama.subscan.io/account/D3Fh5td8SjuWn3GR7WEQyZx6TncxwFLaix2YTvygMyxDcU9, has a substantial lock still on their account. This can also be verified in the apps UI in case you don't trust block explorers for whatever reason)

fwiw, I suspect that the reason why folks haven't been noticing this is because it primarily effects older members of the community and active or previously high conviction voters 🙃 - our wallets and gov UI's generally automatically set vote sizes to the amount currently already locked for voting, so unless you stopped voting and let other locks expire like I have, you wouldn't notice that you have a permanent gov1 lock on your account.

I'm frankly not interested in participating in this community anymore tbqh, just want my tokens unlocked, so forgive me for not speaking up about/looking into this earlier, that's it for my free labor, good luck. 🤷

@liamaharon
Copy link
Contributor

Hey @jam10o-new, the runtimes have not been deployed yet, that is responsibility of the fellowship. Deployment can be tracked on their repo here: polkadot-fellows/runtimes#20

@jam10o-new
Copy link

jam10o-new commented Oct 4, 2023

apologies.

Verify Kusama unreserve & unlock of all funds was successful

Threw me off, as it seemed to imply these changes had already been deployed - I just realized that Polkadot still has Gov1 pallets but has apparently also been verified, so I guess y'all are talking about tests.

serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
bkchr pushed a commit that referenced this issue Apr 10, 2024
* Copy-Pasta owner and freezing code from `message-lane`

* Halt pallet if bridge hasn't been initialized

* Make owner optional in `message-lane` pallet

* Add `is_halted` to `InitializationData`

* Fix initialization tests

* Only allow pallet to be initialized once

* Add some logging around halting and ownership changes

* Remove `target` in debugging calls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
Status: Done
Status: Done
Development

No branches or pull requests

8 participants