Conversation
0811d17 to
011373f
Compare
guilherme-brandao
left a comment
There was a problem hiding this comment.
Looks good! Just need to add tests that check the topic weight recalculation
011373f to
b8286a9
Compare
Done. |
76c8251 to
60ec66f
Compare
There was a problem hiding this comment.
I noticed that there's an end blocker updating topic weights, AFAIU topic weights depends on stake only, so since we now update topic weights when stake is added or removed we should removed this end blocker cc @xmariachi @guilherme-brandao
60ec66f to
f84b926
Compare
xmariachi
left a comment
There was a problem hiding this comment.
Please do not merge this just yet; there is a quirk I want to check with research re. cadence of updates. Setting review as "Request Changes" to block it explicitly
f1ecf0e
53a330b to
0307085
Compare
Hey @amimart , topic weights depend on reputers' stake and topicFeeRevenue. In the |
@xmariachi Yeah you're right we need to keep this |
13d24fb to
53f7ee1
Compare
xmariachi
left a comment
There was a problem hiding this comment.
I think it is consistent with the other topic operations (which happen at that time too).
LGTM, please rebase.
dbaec55
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! You're awesome! ✰ v Please note that maintainers will only review those PRs with a completed PR template. ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> The issue: - The RemoveStakes and RemoveDelegateStakes functions were reducing a topic's staking amount - However, they were not updating the topic's weight or the totalSumPreviousTopicWeights - This was causing unfair distribution of rewards, as inactive topics or topics with reduced stake were still receiving a share of rewards they shouldn't The fix: - When stake is removed from a topic, the topic's weight is immediately recalculated - The totalSumPreviousTopicWeights value is updated accordingly - This ensures that reward distribution is fair and accurate - Topics that should receive a larger share now do https://linear.app/alloralabs/issue/ENGN-3511/136-the-removestakes-function-does-not-update-the-topics-state-or - [x] If tested, please describe how. If not, why tests are not needed. - [ ] If documented, please describe where. If not, describe why docs are not needed. - [x] Added to `Unreleased` section of `CHANGELOG.md`? *Fill this out if this is a Draft PR so others can help.*
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! You're awesome! ✰ v Please note that maintainers will only review those PRs with a completed PR template. ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> The issue: - The RemoveStakes and RemoveDelegateStakes functions were reducing a topic's staking amount - However, they were not updating the topic's weight or the totalSumPreviousTopicWeights - This was causing unfair distribution of rewards, as inactive topics or topics with reduced stake were still receiving a share of rewards they shouldn't The fix: - When stake is removed from a topic, the topic's weight is immediately recalculated - The totalSumPreviousTopicWeights value is updated accordingly - This ensures that reward distribution is fair and accurate - Topics that should receive a larger share now do https://linear.app/alloralabs/issue/ENGN-3511/136-the-removestakes-function-does-not-update-the-topics-state-or - [x] If tested, please describe how. If not, why tests are not needed. - [ ] If documented, please describe where. If not, describe why docs are not needed. - [x] Added to `Unreleased` section of `CHANGELOG.md`? *Fill this out if this is a Draft PR so others can help.*
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! You're awesome! ✰ v Please note that maintainers will only review those PRs with a completed PR template. ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> The issue: - The RemoveStakes and RemoveDelegateStakes functions were reducing a topic's staking amount - However, they were not updating the topic's weight or the totalSumPreviousTopicWeights - This was causing unfair distribution of rewards, as inactive topics or topics with reduced stake were still receiving a share of rewards they shouldn't The fix: - When stake is removed from a topic, the topic's weight is immediately recalculated - The totalSumPreviousTopicWeights value is updated accordingly - This ensures that reward distribution is fair and accurate - Topics that should receive a larger share now do https://linear.app/alloralabs/issue/ENGN-3511/136-the-removestakes-function-does-not-update-the-topics-state-or - [x] If tested, please describe how. If not, why tests are not needed. - [ ] If documented, please describe where. If not, describe why docs are not needed. - [x] Added to `Unreleased` section of `CHANGELOG.md`? *Fill this out if this is a Draft PR so others can help.*
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺ v ✰ Thanks for creating a PR! You're awesome! ✰ v Please note that maintainers will only review those PRs with a completed PR template. ☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --> The issue: - The RemoveStakes and RemoveDelegateStakes functions were reducing a topic's staking amount - However, they were not updating the topic's weight or the totalSumPreviousTopicWeights - This was causing unfair distribution of rewards, as inactive topics or topics with reduced stake were still receiving a share of rewards they shouldn't The fix: - When stake is removed from a topic, the topic's weight is immediately recalculated - The totalSumPreviousTopicWeights value is updated accordingly - This ensures that reward distribution is fair and accurate - Topics that should receive a larger share now do https://linear.app/alloralabs/issue/ENGN-3511/136-the-removestakes-function-does-not-update-the-topics-state-or - [x] If tested, please describe how. If not, why tests are not needed. - [ ] If documented, please describe where. If not, describe why docs are not needed. - [x] Added to `Unreleased` section of `CHANGELOG.md`? *Fill this out if this is a Draft PR so others can help.* # Conflicts: # x/emissions/keeper/keeper_test.go # x/emissions/module/rewards/nonce_management_test.go # x/emissions/module/rewards/rewards_test.go # x/emissions/module/rewards/scores_test.go # x/emissions/module/rewards/topic_rewards_test.go
Purpose of Changes and their Description
The issue:
The fix:
Link(s) to Ticket(s) or Issue(s) resolved by this PR
https://linear.app/alloralabs/issue/ENGN-3511/136-the-removestakes-function-does-not-update-the-topics-state-or
Are these changes tested and documented?
Unreleasedsection ofCHANGELOG.md?Still Left Todo
Fill this out if this is a Draft PR so others can help.