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

Impossible to re-register a previously whitelisted candidate #1605

Open
enlight opened this issue Jan 24, 2020 · 1 comment
Open

Impossible to re-register a previously whitelisted candidate #1605

enlight opened this issue Jan 24, 2020 · 1 comment
Labels
bug Something isn't working dpos

Comments

@enlight
Copy link
Contributor

enlight commented Jan 24, 2020

Once a whitelisted candidate is unwhitelisted & unregistered it's impossible to whitelist & re-register them again, the only way to get them back into the candidate list is to allow the DPOS contract to deduct the 1.25M LOOM registration requirement.

Reproduction steps:

  1. loom dpos3 whitelist-candidate A
  2. loom dpos3 register-candidate A
  3. Wait a couple of election cycles.
  4. loom dpos3 remove-whitelisted-candidate A
  5. loom dpos3 unregister-candidate A
  6. Wait a couple of election cycles.
  7. Now try re-registering A:
    • loom dpos3 whitelist-candidate A - nope, Cannot whitelist an already whitelisted candidate.
    • loom dpos3 change-whitelist-info A - no error, but doesn't actually do anything since this only works on registered candidates.
    • loom dpos3 register-candidate A - attempts to transfer 1.25M LOOM to DPOS contract since the whitelist amount is still zero.
@enlight enlight added bug Something isn't working dpos labels Jan 24, 2020
@enlight
Copy link
Contributor Author

enlight commented Jan 27, 2020

We should fix a few things here:

  • DPOS.WhitelistCandidate should check that the candidate statistic has a zero WhitelistAmount & UpdateWhitelistAmount to determine if a candidate address is whitelisted rather than simply checking if the statistic is nil (because it won't be if the candidate is being re-whitelisted).
  • DPOS.RemoveWhitelistedCandidate should also check for a zero WhitelistAmount & UpdateWhitelistAmount to determine if a candidate address is whitelisted.
  • DPOS.ChangeWhitelistInfo should do the same thing WhitelistCandidate and RemoveWhitelistedCandidate do to check if a candidate address is whitelist or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dpos
Projects
None yet
Development

No branches or pull requests

1 participant