Project Information
- Repository: https://github.com/busyorg/busy
- Project Name: Busy
I reported the issue and made the fix and PR that has been merged already. So you can't see this bug anymore.
Expected behavior
A weekly powerdown amount can't exceed the remaining powerdown amount.
Actual behavior
A weekly powerdown amount may exceeds the remaining powerdown amount; thus, voting value can be negative.
How to reproduce
- Pick a user who finished 13 week powerdown but still need one more week powerdown due to the bug: https://github.com/steemit/steem/issues/3237
- See voting value.
Note that this kind of user may be hard to find, but one current example is Ned, as shown in the recording of the bug. Ned's 14-week powerdown will finish at 11:09pm on 24 Jan 2019, so you should find another example after that.
- busy version: current development version: https://staging.busy.org
- Browser/App version: Any
- Operating system: Any
Recording Of The Bug
- Voting value is negative
- Powerdown amount is more than current SP, which is impossible.
Cause and Fix
This bug is due to the floor operation in the calculation of weekly powerdown amount, as explained in details in https://github.com/steemit/steem/issues/3237 Due to this, the entire powerdown may take 14 weeks. Thus when calculating 14-week powerdown amount, it should be at most the remaining withdrawal.
While I fixed that bug at steemd level, until the fix is applied in production, any client (e.g., busy) should user their own fix. Thus, I made the fix.
After the fix is applied, voting value and powerdown amount (0 SP since it's 11 vests) are shown correctly.