-
Notifications
You must be signed in to change notification settings - Fork 330
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
Implement LQT reward distribution #5045
Conversation
One design quirk I'm running into is that the current tallying logic can actually reward a voter for multiple votes in the same epoch, if they vote for different assets, using the same address. (Voting for the same asset twice results in overwriting your vote, under the current logic). Conceptually, this would require amending the commitment source for LQTs to have several tx ids. |
19962b3
to
d6b8fbe
Compare
d6b8fbe
to
99b69dd
Compare
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.
Exciting, I did a first pass, will circle back to it later this morning
crates/core/component/funding/src/component/liquidity_tournament/rewards/mod.rs
Outdated
Show resolved
Hide resolved
crates/core/component/funding/src/component/liquidity_tournament/rewards/mod.rs
Show resolved
Hide resolved
crates/core/component/funding/src/component/liquidity_tournament/rewards/gauge.rs
Show resolved
Hide resolved
crates/core/component/funding/src/component/liquidity_tournament/rewards/mod.rs
Outdated
Show resolved
Hide resolved
crates/core/component/funding/src/component/liquidity_tournament/rewards/mod.rs
Show resolved
Hide resolved
Instead just log an error for now.
99b69dd
to
aca3788
Compare
Posted in a comment reply in vscode, but this doesn't show up here: That make sense to me, reaching for preallocs is a good instinct, and as is there is definitely massive allocator pressure. But I think this is a sign we shouldn't load the entire asset space in-memory to filter it, like discussed out of band. Instead, we can do another pass so that:
In retrospect, I regret not adding plausible ranges for With that in mind, we will be able to get rid of the nested
Thoughts? |
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.
Let's merge this and do an aggressive follow-up work so that:
- we can efficiently trim the assets below the cutoff without reading the whole index
- we only track the gauge weights and defer the heavy lifting to sorted prefix scans in rocksdb
I think the sketch above this comment achieves that
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
## Describe your changes This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch. There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:
Describe your changes
This integrates the recent work in the funding component, providing a full implementation of the reward calculation and distribution logic, running at the end of each epoch.
There are some unit and prop tests for some core tallying logic, but we'll need to do manual testing of the various RPCs an what not later.
Checklist before requesting a review
I have added guiding text to explain how a reviewer should test these changes.
If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: