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

R4R: Ensure Legacy Validator Delegation Invariants #2198

Merged
merged 10 commits into from
Aug 31, 2018

Conversation

rigelrozanski
Copy link
Contributor

Recreation of PR #2176 After Reverted Merge
Need to merge in develop and fix errors


  • Add Delegation to ValidatorSet type. The motivation was to be able to determine
    if a validator has a self-delegation in the unjail message handler.
    • Note, the keeper implementing the ValidatorSet interface already has Delegation defined.
  • Update handleMsgUnjail to not allow a validator to unjail itself if it has no
    self-bonded delegation (it may have other delegated power).
  • Update handleMsgDelegate to allow a validator to self-bond when jailed.
  • Added unit tests to ensure the following:

When a validator removes it's final self-bonded share:

  • the validator is jailed (existing behavior)
  • delegators cannot delegate to said validator
  • the validator CAN self-delegate to itself
  • validator cannot unjail themselves UNLESS they have self self-bonded
  • after self-bonding and unjailing themselves - the validator should be able to accept delegations again

closes: #1883


  • Targeted PR against correct branch (see CONTRIBUTING.md)

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.

  • Wrote tests

  • Updated relevant documentation (docs/)

  • Added entries in PENDING.md with issue #

  • rereviewed Files changed in the github PR explorer


For Admin Use:

  • Added appropriate labels to PR (ex. wip, ready-for-review, docs)
  • Reviewers Assigned
  • Squashed all commits, uses message "Merge pull request #XYZ: [title]" (coding standards)

@alexanderbez
Copy link
Contributor

Thank you @rigelrozanski! Will address this today 👍

@codecov
Copy link

codecov bot commented Aug 31, 2018

Codecov Report

Merging #2198 into develop will increase coverage by 0.04%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #2198      +/-   ##
===========================================
+ Coverage    63.51%   63.55%   +0.04%     
===========================================
  Files          136      136              
  Lines         8370     8380      +10     
===========================================
+ Hits          5316     5326      +10     
  Misses        2692     2692              
  Partials       362      362

@alexanderbez
Copy link
Contributor

@rigelrozanski updated + fixed! Thanks again.

@rigelrozanski
Copy link
Contributor Author

Oh dope! - if you want to approve this PR I'll merge in

Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK 👍

@rigelrozanski rigelrozanski merged commit b92ac31 into develop Aug 31, 2018
@rigelrozanski rigelrozanski deleted the bez/1883-ensure-legacy-val-invariant branch August 31, 2018 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure a legacy validator can't accept new delegations
2 participants