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: allow multiple simultaneous redelegations/ubds between same delegator/validator(s) addresses #3243

Merged
merged 34 commits into from
Jan 16, 2019

Conversation

rigelrozanski
Copy link
Contributor

@rigelrozanski rigelrozanski commented Jan 7, 2019

closes #1402
follow up ref issue: #3270

  • Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote tests
  • Updated relevant documentation (docs/) - more major doc updates to come during spec upgrade
  • 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)

@rigelrozanski rigelrozanski changed the base branch from rigel/revert-KV-seperation to develop January 7, 2019 20:43
@codecov
Copy link

codecov bot commented Jan 9, 2019

Codecov Report

Merging #3243 into develop will decrease coverage by <.01%.
The diff coverage is 64.86%.

@@             Coverage Diff             @@
##           develop    #3243      +/-   ##
===========================================
- Coverage    55.65%   55.64%   -0.01%     
===========================================
  Files          134      134              
  Lines         9716     9746      +30     
===========================================
+ Hits          5407     5423      +16     
- Misses        3965     3980      +15     
+ Partials       344      343       -1

@rigelrozanski rigelrozanski changed the title WIP: allow multiple unbonding/redelegations between same addresses R4R: allow multiple unbonding/redelegations between same addresses Jan 10, 2019
@rigelrozanski rigelrozanski added C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine). labels Jan 10, 2019

if unbondingDelegation.MinTime.Before(now) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note this subtle change of this line to instead use of entry.IsMature(now) - previously a delegation would have been slashed if it was at MinTime (which is a bit of an ambiguous name supposed to represent "min time to completion"). Under the updates the delegation will not be slashed if now==completionTime (rename from MinTime) as this would be considered a mature bond.

return sdk.ZeroInt()
}

if redelegation.MinTime.Before(now) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same subtle change as previously mentioned

@rigelrozanski rigelrozanski changed the title R4R: allow multiple unbonding/redelegations between same addresses R4R: allow multiple simultaneous redelegations/ubds between same delegator/validator(s) addresses Jan 10, 2019
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, tests look fine, one minor comment. We can delete ErrConflictingRedelegation in x/stake/types/errors.go.

x/stake/keeper/slash.go Outdated Show resolved Hide resolved
x/stake/keeper/slash.go Outdated Show resolved Hide resolved
@cwgoes
Copy link
Contributor

cwgoes commented Jan 13, 2019

This could use another reviewer, maybe @sunnya97 or @jaekwon.

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.

Left a few minor comments, but the changes look reasonable to me :)

docs/spec/staking/state.md Outdated Show resolved Hide resolved
x/staking/keeper/delegation.go Show resolved Hide resolved
x/staking/keeper/delegation.go Show resolved Hide resolved
docs/spec/staking/state.md Outdated Show resolved Hide resolved
x/staking/genesis.go Show resolved Hide resolved
x/staking/genesis.go Show resolved Hide resolved
x/staking/keeper/slash.go Outdated Show resolved Hide resolved
x/staking/keeper/slash.go Show resolved Hide resolved
x/staking/types/delegation.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/staking T: API Breaking Breaking changes that impact APIs and the SDK only (not state machine).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/stake: Add global redelegation/unbonding index
4 participants