Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Fix valset pref unbonding bugs #5967
Fix: Fix valset pref unbonding bugs #5967
Changes from 18 commits
fe7290f
fcdc961
58792cc
2f8dea8
f4c0dab
144f0d1
41cd2f6
7403e06
fbd4ba4
2f5caca
d3cec49
90e9fb2
b317a0e
b1ece1b
53a14d9
5d54956
11bc176
3799111
dcfc806
d9891dd
5ac4023
25cdc5f
20f7c29
e27f258
54b4dec
77a9655
324a281
365b721
31e9008
1c48875
9e98292
eedd243
ce280e8
30af740
246d95e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
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.
dev was in favor of keeping the algorithm as verbose as possible, so i didn't make any change
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.
Oh this removal suggestion is due to duplicate lines right below!
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.
oh right i see, i will remove 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.
what's the reason these numbers changed?
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.
refactored the test to check for undelegated tokens:https://github.com/osmosis-labs/osmosis/pull/5967/files#diff-e8d94c443b26e1cda354d150b30ce5542344099e0bbbb8e84e507d9df791daf7R309
however, the reason why this was changed was because we sort the tokens and take out the remaining amount from the last validator in the new algorithm
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.
Don't quite follow exactly how we do re-calculation and use target ratio here , can you give me some examples with numbers? 👀
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.
yup so if we have 2 validators and have userA who has staked 20token
this is a full flow of how the algorithm works, please lmk if that makes sense. Happy to explain more :))
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.
Ah this is awesome, thanks for the example, would you mind adding this to readme? It personally helped me understand what's going on right away with this example
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.
Not sure if this is valid, I don't think it is currently possible to have a vratio greater than 1. Would love to see a test case that touches steps 5-7
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 issue with the described calculation in this example is the Vratio. In this example we take 10/15 and 10/5. This would be possible if we used GetValSetPreferences method in the withdraw logic, but we instead use GetValSetPreferencesWithDelegations. This transforms the weights based on the amount actually delegated to the validators. So in that case, the numerator could never be larger than the denominator.
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.
note: i'm a little worried about this part of the algorithm. would appreciate a thorough review here
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.
Which part in specific are you worried about?