-
Notifications
You must be signed in to change notification settings - Fork 61
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
fix: refactor redelegations distribution logic #490
Conversation
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.
LGTM, cleannn
Co-authored-by: Alex Johnson <[email protected]>
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.
LGTM
nits addressed @aljo242 @ajansari95 |
Co-authored-by: Alex Johnson <[email protected]>
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.
LGTM
DNM for now |
1. Summary
Remove complexity and improve readability in rebalancing.
2.Type of change
3. Implementation details
Rewrite logic for readability and efficiency; don't handle locked tokens twice (potential bug?).
Use specific Delta types instead of trying to reuse ValidatorIntents and casting between Dec and Int all of the place 🤮
CalculateDeltasNew will supercede CalculateDeltas and be renamed with future work. It now outputs two slices, for targets and sources, instead of a single slice containing positive and negative deltas. The latter was far more difficult to reason about and required more complex logic to handle.
6. Limitations
Currently only affects redelegations. Deposit and unbonding logic uses legacy distribution.
7. Future Work (optional)
Update deposits and unbonding to use the new types and logic.