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

Unjustifiable reserved amount. Bug? #4160

Closed
michalisFr opened this issue Oct 27, 2021 · 4 comments · Fixed by #4655
Closed

Unjustifiable reserved amount. Bug? #4160

michalisFr opened this issue Oct 27, 2021 · 4 comments · Fixed by #4655
Assignees
Labels
I3-bug Fails to follow expected behavior.

Comments

@michalisFr
Copy link

This account:
https://polkadot.subscan.io/account/14iGCDW2cEphmcXH22RhbuQBxjAzPP8UJAX8EQw4p5T2ZwsW
has a reserved balance of 4.95 DOT which should have been released.

The user voted for Council here:
https://polkadot.subscan.io/extrinsic/3643932-1
and reserved 5 DOT for the vote. Then he removed the votes:
https://polkadot.subscan.io/extrinsic/4767206-1
but only 0.05 DOT was unreserved.

He uses the old pallet (electionPhragmen which is now phragmenElections). But the "removeVoter" was also with the old pallet.

@shawntabrizi
Copy link
Member

@kianenigma Looks like maybe the after effect of a migration or change to deposit config?

@shawntabrizi shawntabrizi added the I3-bug Fails to follow expected behavior. label Oct 27, 2021
@kianenigma
Copy link
Contributor

kianenigma commented Oct 30, 2021

yeah #2562, and more specifically #2562 (comment)

@michalisFr
Copy link
Author

@shawntabrizi Was the extrinsic to release incorrectly reserved amounts through governance added to any of the recent runtime upgrades? To remind you, we were discussing this in Element for the similar issue with the nicks pallet.

If it has, then this would be a solution for these accounts too, right?

@kianenigma
Copy link
Contributor

kianenigma commented Jan 4, 2022

A follow up on my comment here. Using this script, I found all the accounts that submitted vote or remove_voter in the problematic period, ad got a list of those that require a refund. Here's the output of the script, which is a bit more verbose than the list of accounts, but also helpful in validating the results. Any account starting with 🚨 needs a refund of 4.95 DOTs from their reserved balance to their free balance.

Connected to node polkadot Polkadot [ss58: 0]
using api key: DEFAULT_KEY
fetched remove_voter 10 transactions from page 0
🚨 14udY48vCbPLtF2VEpUmqfJLHesmAZWi5ShzeKgnqkuigYaR at 4871298 // preReserve: 25.2580 DOT postReserved: 25.2080 DOT // preDeposit 50.0000 mDOT
🚨 14iGCDW2cEphmcXH22RhbuQBxjAzPP8UJAX8EQw4p5T2ZwsW at 4767206 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 14FrHPF7UWDZCe811yBUXMch8VS7hE4CvV26UR92Pvz5BUia at 4755832 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
😮‍💨 14M7jxZGVjp8DKNgmqCRPmrJyVpFSNvrUG6CfX7TGcS48JZw at 4702622, not issues with PreDeposit of 20.0960 DOT [reserved: 245.0460 DOT -> 224.9500 DOT]
🚨 14BpBd1EhsbzSAarjKJmpNHA2evTj1B4FjryWACycBCqTxDQ at 4560728 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 13Smi6KLQxEfBNYNPAbiMPiVFVPRpu8WM2qQv42jkmZKnkfo at 4515728 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 128qRiVjxU3TuT37tg7AX99zwqfPtj2t4nDKUv9Dvi5wzxuF at 4515722 // preReserve: 0 postReserved: 0 // preDeposit 50.0000 mDOT
        but something seems off here...
😮‍💨 16kbrXtdXwQKEPrswWQXLtBTao1PqiGhRcXFvyh4ysF5pmoK at 4365787, not issues with PreDeposit of 20.2240 DOT [reserved: 25.1740 DOT -> 4.9500 DOT]
🚨 1A6Tb4x8T9WbN2Rvq1kQFdFoFQxbNv6GBhc5GAMY9ACQV4j at 4300648 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
fetched remove_voter 10 transactions from page 1
🚨 14cstG1jBDJuPGcAf41cmX6QWuF2AxN3sMWaxtPac9D5cToJ at 4254397 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 165gfcRhaqPSiwhhw3Vsb6S4iWxALtQtEK5MbtrfJsgDEHQi at 4247172 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 1gNBZtAbG75p4cVcdCJNh6NE8YB7X1F7jr67J8fCBeV96cp at 4188969 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 1EP1PHmnjwpL2X53CToLFJg8UuXqzbuAv3ySXQjkJaCw3Y6 at 4186222 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
fetched remove_voter 10 transactions from page 2
🚨 14v1h36tNjUkxaMGugURtXZncrXns47pkQ86gJcxyPtknsN at 4178007 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 14dQWQ6URVDwApf58KWd61FjGcQ4UPujw7gsz5o8Mcitp24y at 4166496 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 15Xx6ToS88iUagZ6BNJsEMKDbo4V7RcjdJk1FGfdxLtgqVs4 at 4159039 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
🚨 121YKGZBCaLyCkZjrwfqEkZHHVns1Kt5Q1g6gEfdU6MgbkFy at 4109803 // preReserve: 15.0000 DOT postReserved: 14.9500 DOT // preDeposit 50.0000 mDOT
🚨 14pXP1DJVJnZDt6CcPkuwfT6NHh9nQ22J8LnsUCvkk2LRH65 at 4050558 // preReserve: 85.4050 DOT postReserved: 85.3550 DOT // preDeposit 50.0000 mDOT
😮‍💨 14B7G8NRMt2YuV6n3TKf2wyiGSew1wwdVjEEvWwqdDbKa7aZ at 4037353, not issues with PreDeposit of 20.0960 DOT [reserved: 80.0960 DOT -> 60.0000 DOT]
😮‍💨 14B7G8NRMt2YuV6n3TKf2wyiGSew1wwdVjEEvWwqdDbKa7aZ at 4030195, not issues with PreDeposit of 20.0960 DOT [reserved: 80.0960 DOT -> 60.0000 DOT]
fetched remove_voter 2 transactions from page 3
🚨 14tye3sQ1L3z3p4DSKhvhbXFMW6jQfFQYFd5xi4LBhJ2TJem at 3911406 // preReserve: 5.0000 DOT postReserved: 4.9500 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 0, 9 of which are invalid
🚨 14gUmUjQooUqAgbkP8zEdz5tkLyCqPSz8GZ41AnLLyFzhVw2 at 4872948 // preReserve: 5.0000 DOT postReserved: 25.2700 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 1, 5 of which are invalid
🚨 16c552whYN6dr8jJtNdRLm8FKyxMpYwFDP5f5enw26VquJk5 at 4712339 // preReserve: 5.0000 DOT postReserved: 25.0780 DOT // preDeposit 50.0000 mDOT
🚨 16UJBPHVqQ3xYXnmhEpaQtvSRnrP9k1XeE7WxoyCxsrL9AvV at 4712336 // preReserve: 125.2580 DOT postReserved: 145.3360 DOT // preDeposit 50.0000 mDOT
😮‍💨 17RjhSFdg4EhX8aJk8uU1uaP3PYBgCFDvd4xUvwMzWmJhJ6 at 4684959, not issues with PreDeposit of 0 [reserved: 0 -> 20.0960 DOT]
😮‍💨 1LWcBbCTEc1E1vvVSSPXXiMfGdX9ZLPv9su3cWN3m9xWEjE at 4611618, not issues with PreDeposit of 20.0960 DOT [reserved: 25.0460 DOT -> 25.0460 DOT]
😮‍💨 1629Shw6w88GnyXyyUbRtX7YFipQnjScGKcWr1BaRiMhvmAg at 4602476, not issues with PreDeposit of 20.5760 DOT [reserved: 185.8900 DOT -> 185.8900 DOT]
fetched vote 10 transactions from page 2, 10 of which are invalid
fetched vote 10 transactions from page 3, 9 of which are invalid
🚨 16aHHHXnTYAV72qngKmEDVGXwRw8cknqgioY75BsTtMNJEg3 at 4542259 // preReserve: 5.0000 DOT postReserved: 25.3340 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 4, 9 of which are invalid
😮‍💨 15iqv4E9F7uX2Xjiyh8uopqEPaP4VTSTvJzX1ccFiwv4G56Y at 4504284, not issues with PreDeposit of 20.5120 DOT [reserved: 20.5120 DOT -> 20.5120 DOT]
fetched vote 10 transactions from page 5, 10 of which are invalid
fetched vote 10 transactions from page 6, 8 of which are invalid
😮‍💨 12BuY6MV83eYkEtSTtQRTVNpZGFinykGnnUPmtAuQ2T9y6nk at 4407969, not issues with PreDeposit of 0 [reserved: 0 -> 20.0960 DOT]
😮‍💨 122aN5GNh5UMQB2ZnVGf8v8RaaVz8xbvCmFNj9GnoPbGGE65 at 4387779, not issues with PreDeposit of 0 [reserved: 0 -> 20.0960 DOT]
fetched vote 10 transactions from page 7, 10 of which are invalid
fetched vote 10 transactions from page 8, 7 of which are invalid
🚨 16X6fA9y2kPoUDN3wo2Y5PhAfYCd7R8b8soH9jKo754TEoHh at 4353551 // preReserve: 5.0000 DOT postReserved: 25.0460 DOT // preDeposit 50.0000 mDOT
🚨 14M7jxZGVjp8DKNgmqCRPmrJyVpFSNvrUG6CfX7TGcS48JZw at 4340355 // preReserve: 225.0000 DOT postReserved: 245.0460 DOT // preDeposit 50.0000 mDOT
🚨 16kbrXtdXwQKEPrswWQXLtBTao1PqiGhRcXFvyh4ysF5pmoK at 4315138 // preReserve: 5.0000 DOT postReserved: 25.1740 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 9, 3 of which are invalid
😮‍💨 14K6CfR5NsTg1SZQVKpCVvwXS1bz1Bx1DpG98fYCcqo4gpaQ at 4299264, not issues with PreDeposit of 0 [reserved: 0 -> 20.1280 DOT]
😮‍💨 15iqv4E9F7uX2Xjiyh8uopqEPaP4VTSTvJzX1ccFiwv4G56Y at 4260325, not issues with PreDeposit of 20.5120 DOT [reserved: 20.5120 DOT -> 20.5120 DOT]
🚨 1LWcBbCTEc1E1vvVSSPXXiMfGdX9ZLPv9su3cWN3m9xWEjE at 4204227 // preReserve: 5.0000 DOT postReserved: 25.0460 DOT // preDeposit 50.0000 mDOT
🚨 1n1B9ZPkg9cv152c6UwtQrXuNwR2tXPXvwKDX9cYeMh4fNQ at 4200259 // preReserve: 5.0000 DOT postReserved: 25.2060 DOT // preDeposit 50.0000 mDOT
🚨 1RVaJptRF1XompgRCXuda3Vs8Cxjt22ww5ndSRSvaW7WJBf at 4200243 // preReserve: 5.0000 DOT postReserved: 25.1740 DOT // preDeposit 50.0000 mDOT
😮‍💨 1629Shw6w88GnyXyyUbRtX7YFipQnjScGKcWr1BaRiMhvmAg at 4200190, not issues with PreDeposit of 20.5760 DOT [reserved: 165.8370 DOT -> 165.8370 DOT]
😮‍💨 15iqv4E9F7uX2Xjiyh8uopqEPaP4VTSTvJzX1ccFiwv4G56Y at 4171728, not issues with PreDeposit of 0 [reserved: 0 -> 20.5120 DOT]
fetched vote 10 transactions from page 10, 7 of which are invalid
🚨 1243tzEb446NSpWzPcaeMGpJh2YZ4TwMb4B85yVCt4275fD8 at 4158458 // preReserve: 5.0000 DOT postReserved: 25.1740 DOT // preDeposit 50.0000 mDOT
🚨 14XetcVhGUWtf2W1tbtA6wxP3MwWxTquLsLhZMgKGBG4W7R5 at 4143160 // preReserve: 25.2580 DOT postReserved: 45.5280 DOT // preDeposit 50.0000 mDOT
🚨 15rqGn147Drr6nY5Xvyzqo6NgDWJoQzooiqaJHEzkcavFryy at 4111281 // preReserve: 5.0000 DOT postReserved: 25.0460 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 11, 7 of which are invalid
😮‍💨 14B7G8NRMt2YuV6n3TKf2wyiGSew1wwdVjEEvWwqdDbKa7aZ at 4030206, not issues with PreDeposit of 0 [reserved: 60.0000 DOT -> 80.0960 DOT]
😮‍💨 14B7G8NRMt2YuV6n3TKf2wyiGSew1wwdVjEEvWwqdDbKa7aZ at 4030100, not issues with PreDeposit of 0 [reserved: 60.0000 DOT -> 80.0960 DOT]
🚨 1629Shw6w88GnyXyyUbRtX7YFipQnjScGKcWr1BaRiMhvmAg at 4029209 // preReserve: 145.3110 DOT postReserved: 165.8370 DOT // preDeposit 50.0000 mDOT
fetched vote 10 transactions from page 12, 10 of which are invalid
✅ Done
[
  '14udY48vCbPLtF2VEpUmqfJLHesmAZWi5ShzeKgnqkuigYaR',
  '14iGCDW2cEphmcXH22R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rswWQXLtBTao1PqiGhRcXFvyh4ysF5pmoK',
  '1LWcBbCTEc1E1vvVSSPXXiMfGdX9ZLPv9su3cWN3m9xWEjE',
  '1n1B9ZPkg9cv152c6UwtQrXuNwR2tXPXvwKDX9cYeMh4fNQ',
  '1RVaJptRF1XompgRCXuda3Vs8Cxjt22ww5ndSRSvaW7WJBf',
  '1243tzEb446NSpWzPcaeMGpJh2YZ4TwMb4B85yVCt4275fD8',
  '14XetcVhGUWtf2W1tbtA6wxP3MwWxTquLsLhZMgKGBG4W7R5',
  '15rqGn147Drr6nY5Xvyzqo6NgDWJoQzooiqaJHEzkcavFryy',
  '1629Shw6w88GnyXyyUbRtX7YFipQnjScGKcWr1BaRiMhvmAg'
]

Note that there is only one (rather well known) account that is somehow not making sense here, because they should have had some reserved balance left for refund, but somehow they don't. This could probably be linked to the known fact/issue that slashing reserved balances can very well exceed the reserved amount of one pallet and eat the reserved amount of another pallet (something that named-reserves will fix). In any case, I personally think the outcome here is sounds, and I will proceed with making a pull request that does the refund.

Lastly, the account of example in this issue is already found and taken care of: 14iGCDW2cEphmcXH22RhbuQBxjAzPP8UJAX8EQw4p5T2ZwsW

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug Fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants