Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

unlockHeight is not considered on unlockToken transaction during punishment #6793

Closed
shuse2 opened this issue Sep 21, 2021 · 0 comments · Fixed by #6807
Closed

unlockHeight is not considered on unlockToken transaction during punishment #6793

shuse2 opened this issue Sep 21, 2021 · 0 comments · Fixed by #6807
Assignees
Milestone

Comments

@shuse2
Copy link
Collaborator

shuse2 commented Sep 21, 2021

Expected behavior

According to the LIP

lastPomHeight < U.unvoteHeight + 2000
or 
lastPomHeight < U.unvoteHeight + 260,000

needs to be considered, so that if unvoted 2000 blocks before, it the token will not be locked.

Actual behavior

https://github.com/LiskHQ/lisk-sdk/blob/main/framework/src/modules/dpos/transaction_assets/unlock_transaction_asset.ts#L108-L127

https://github.com/LiskHQ/lisk-sdk/blob/a1e9c65edee71b7d415bfed9b7cfa29f03a3d385/framework/src/modules/dpos/utils.ts#L62-L72

Currently, during the execution of unlocking, the unvote height is not considered for the condition. Therefore, if the voter unvoted the delegate but not unlocked, then delegate got punished, the token will become locked until first condition is met

Also, this feature should be abled to switched on by genesis config using height

Steps to reproduce

  1. Vote for a delegate
  2. Unvote a delegate
  3. Punish a delegate

Which version(s) does this affect? (Environment, OS, etc...)

5.1.4-

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants