-
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
feat!: facilitate the tokenization of vested delegation in the LSM module #19614
Conversation
delVestingAmount := account.GetDelegatedVesting().AmountOf(coin.Denom) | ||
delVested := account.GetDelegatedFree() | ||
|
||
// Calculate the new vested delegated 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.
Why do we need to perform any calc here? Shouldn't the vesting type give us the amount of total vested?
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.
The LSM module needs the total delegations vested at the current block time to know how many can be tokenized. Since the DelegatedVesting
and DelegatedFree
are lazily computed and therefore not rebalanced according to the new vested coins over time, we need these extra calculations.
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.
Ahh, right we don't have an API for that. Would be nice to have this on the vesting types, but since it's legacy now maybe not worth it.
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
@@ -64,6 +64,7 @@ require ( | |||
google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 | |||
google.golang.org/grpc v1.60.1 | |||
google.golang.org/protobuf v1.32.0 | |||
gopkg.in/yaml.v2 v2.4.0 |
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.
Why are there 2 imports for gopkg.in/yaml.v2 v2.4.0
?
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.
Good catch. Was probably duplicated while resolving conflicts with feature/v0.47.x-ics-lsm
.
Removed by 987a86d.
The test |
Thanks for the heads-up @MSalopek. The tests pass again. |
delVestingAmount := account.GetDelegatedVesting().AmountOf(coin.Denom) | ||
delVested := account.GetDelegatedFree() | ||
|
||
// Calculate the new vested delegated 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.
Ahh, right we don't have an API for that. Would be nice to have this on the vesting types, but since it's legacy now maybe not worth it.
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.
Great work @sainoe
@sainoe Add a changelog entry before merging. |
Description
This PR introduces a solution to facilitate the tokenizination of vested delegations in the LSM module.
More details are available in the Gaia #2877 issue.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...