-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Exclusive reserves for pallet-balances #7223
Comments
Take this account for example (picked randomly) https://polkascan.io/kusama/account/DwFd1YbZD2cZjox1CrsdDXFVsnSY8Fw2YWgcVgeaxrvwYfv#transactions Reserved 0.05 KSM to |
+1 Accounts that technically lost some money due to this bug can and should be fixed through governance. And the elections module will transition to bookkeeping in this PR #7040 |
Would be good to sweep and clean these incidents before they get too old. |
@xlc I want to move on with the above PR, but if the issue that you named has happened, I should clean that first. Are you sure the voting bond has changed in kusama? it seem to be 5 * some power of ten even now: |
This is the change reduce all the fees on Kusama https://github.com/paritytech/polkadot/pull/1252/files#diff-50080fd40b82a07448f519b041450378R22 Use This is on block 100
This is on a recent head
You can see the voting bond changed from |
I'll try and prepare a scrape of the chain that includes the list of all accounts affected soon. |
Here are the list of accounts that need to be refunded:
This is basically a scrape of Once someone else confirms the list, I'll move forward. |
EDIT: short explanation as to how I got to my list -
(All in the JS console on the apps UI) My list, 192 ids (converted to 42) -
|
An important first step toward this is to be able to correctly de-compose the current reserved balance of each account into separate modules. We worked with @shawntabrizi on a small half-finished script to do this a while ago. I couldn't finish it because in the case of anonymous proxies and multisig accounts, it gets a bit complicated. |
What we can do is introduce named reserve and unnamed reserve (the current reserve) and have new pallets using named reserve so the situation will not become worsen. And then we can migrate unnamed reserve to named reserve one by one. |
I will give this a go this week. |
Currently the reserved balances are shared. Every pallets that uses reserve feature should keep a record how much is reserved so later it can unreserve / slash the same amount. Otherwise if deposits changes, a wrong value will be unserved / slashed.
Given that we should always have the reserved amount stored somewhere (or you may have bugs), we should just have pallet-balances (or another pallet) to do the bookkeeping. Also fund reserved by different pallets should not be shared. Reserve from
pallet-identity
cannot be used bypallet-proxy
. This will simplify code, eliminates a category of bugs, and improve UX (How do I unreserve my money?).Examples of extra deposit bookkeeping codes:
substrate/frame/identity/src/lib.rs
Lines 377 to 378 in 596f377
substrate/frame/treasury/src/lib.rs
Lines 275 to 276 in 596f377
substrate/frame/treasury/src/lib.rs
Lines 295 to 296 in 596f377
substrate/frame/indices/src/lib.rs
Line 79 in 596f377
substrate/frame/proxy/src/lib.rs
Lines 157 to 160 in 596f377
Missing bookkeeping:
substrate/frame/elections-phragmen/src/lib.rs
Line 828 in 596f377
substrate/frame/elections-phragmen/src/lib.rs
Line 581 in 596f377
I suspect some fund may already be locked forever for early Kusama council voters as the deposit have decreased once.
This will at same time closes #6724
The text was updated successfully, but these errors were encountered: