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

Unlock time calculated wrong for punished delegate #3743

Closed
punkrock opened this issue Aug 24, 2021 · 1 comment
Closed

Unlock time calculated wrong for punished delegate #3743

punkrock opened this issue Aug 24, 2021 · 1 comment
Assignees

Comments

@punkrock
Copy link

punkrock commented Aug 24, 2021

My delegate got punished and I unvoted myself. Unlocking usually takes 30 days but due to the fact I was punished the unlock time is not 30 days, as a punishment locks the LSK that were in use for "self-vote" at the time of the punishement for 90 days.

error

This is the error message on my Lisk Core Server:

0|lisk-core  | 20:11:51 ERROR lisk-framework: Failed to add transaction to pool. (module=lisk:app)
0|lisk-core  | Message: Unlocking is not permitted as the delegate is currently being punished. 
0|lisk-core  |  Trace: TransactionApplyError: Unlocking is not permitted as the delegate is currently being punished.
0|lisk-core  |     at Processor.verifyTransactions (/home/lisk/.nvm/versions/node/v12.22.1/lib/node_modules/lisk-core/node_modules/lisk-framework/dist-node/node/processor/processor.js:224:23) 

You should use this error message and tell users in Lisk Desktop what is wrong. But this is not even needed, if Lisk Dekstop would calculate the unlocking time correctly.

So, let's go on with the root issue: The unlock button should only be available when you really are allowed to unlock your funds.

Example 1 (watch the dates!):
01.04.2021: Delegate A votes itself with 400 LSK.
02.04.2021: Delegate A gets punished.
02.04.2021: Delegate A unvotes itself with 400 LSK.
Now Lisk Desktop starts an unlocking-timer of 30 days but it should be a timer of 90 days due to the punishment that happened the same day.

Example 2 (watch the dates!):
01.04.2021: Delegate A votes itself with 400 LSK.
02.04.2021: Delegate A gets punished.
09.04.2021: Delegate A unvotes itself with 400 LSK.
Now Lisk Desktop starts an unlocking-timer of 30 days but it should be a timer of 82 days due to the punishment.

Example 3 (watch the dates!):
01.04.2021: Delegate A votes itself with 400 LSK.
02.04.2021: Delegate A gets punished.
25.06.2021: Delegate A unvotes itself with 400 LSK.
Now Lisk Desktop starts an unlocking-timer of 30 days and this would be correct as the punishment ends earlier.

How to fix this?
When unvoting was done, Lisk Desktop needs to check if a delegate is punished or not and if the LSK are part of this punishment. Based on this information, Lisk Desktop should calculate the correct unlocking period and only make the unlocking button available when you really are allowed to unlock your LSK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants