Skip to content

R4R: allow multiple simultaneous redelegations/ubds between same delegator/validator(s) addresses#3243

Merged
rigelrozanski merged 34 commits intodevelopfrom
rigel/delegation-index
Jan 16, 2019
Merged

R4R: allow multiple simultaneous redelegations/ubds between same delegator/validator(s) addresses#3243
rigelrozanski merged 34 commits intodevelopfrom
rigel/delegation-index

Conversation

@rigelrozanski
Copy link
Copy Markdown
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
Copy Markdown

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
// perform slashing on all entries within the unbonding delegation
for i, entry := range unbondingDelegation.Entries {

if unbondingDelegation.MinTime.Before(now) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@cwgoes
Copy link
Copy Markdown
Contributor

cwgoes commented Jan 13, 2019

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

Copy link
Copy Markdown
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 :)

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