-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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]: Vesting Account(s) Implementation #2694
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2694 +/- ##
===========================================
+ Coverage 55.18% 55.75% +0.56%
===========================================
Files 134 134
Lines 9526 9702 +176
===========================================
+ Hits 5257 5409 +152
- Misses 3938 3949 +11
- Partials 331 344 +13 |
Rebased. |
// | ||
// CONTRACT: The account's coins, delegation coins, vesting coins, and delegated | ||
// vesting coins must be sorted. | ||
func (bva *BaseVestingAccount) trackDelegation(vestingCoins, amount sdk.Coins) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
This is an extremely good candidate for the hard fork game of stakes upgrade after merged. |
I think this could be merged. Does anyone else want to review it? |
Don't merge. |
docs/spec/auth/vesting.md
Outdated
|
||
// Delegation and undelegation accounting that returns the resulting base | ||
// coins amount. | ||
TrackDelegation(Time, Coins) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TrackDelegation/TrackUndelegation are weird names. DelegateCoins/UndelegateCoins seems fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ehhh, but you're not actually delegating or undelegating. You're simply performing some accounting where the actual delegation/undelegation is performed upstream (i.e. stake keeper => accnt keeper). I think Track*
is just fine imho.
If we don't prioritize Undelegating into Furthermore, can we change the name of |
Yes, technically I think so. But why not support undelegating? It works.
Hmmm, why? For example, the stake keeper calls
I think we talked about that and we decided not to support such a feature. I still need to address @jaekwon's comments :) |
Essentially I want to reduce the breaking of the abstraction barriers here between
Hmm, you're right. I don't like that either. An alternative: A
I was just thinking, it gets rid of the tracking of delegated coins, simplifying this module significantly. I can see that intuitively, prioritizing vested coins makes logical sense. But, is the increase complexity worth it? Idk, fine either way, but could we at least call it
Oh, I didn't realize that. What was the reason for this? Was this discussion recorded somewhere? |
- Fix any glaring grammatical errors - Update to reflect latest PR updates
Ok @jaekwon and @cwgoes, I've updated the code and spec to address the major comments, namely:
At this point, I think the vesting spec and implementation are in a good place -- lmk your thoughts. |
@alexanderbez Thanks; your changes look fine to me - my approval stands. |
@jackzampolin Can you check if your suggestions have been addressed? @jaekwon Did you have any further suggestions or concerns? |
Implementation of the vesting account specification (per #2589):
sdk.MaxInt
andsdk.MaxUint
.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 explorerFor Admin Use: