Skip to content
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

refactor(minor-rewards): param updates take effect in current epoch #639

Merged
merged 5 commits into from
Oct 9, 2024

Conversation

cjcobb23
Copy link
Contributor

@cjcobb23 cjcobb23 commented Sep 25, 2024

There was too much complexity around when parameter updates take effect. Sometimes they took effect in the current epoch, and sometimes they took effect in the next epoch, and it was hard to reason about when each happened. Instead, I think it is simpler and easier to maintain by having parameter updates always take effect in the current epoch.

https://axelarnetwork.atlassian.net/browse/AXE-5297

@cjcobb23 cjcobb23 requested a review from a team as a code owner September 25, 2024 15:37
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.68%. Comparing base (8b0df43) to head (473cc49).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #639      +/-   ##
==========================================
+ Coverage   93.61%   93.68%   +0.07%     
==========================================
  Files         243      243              
  Lines       35226    35647     +421     
==========================================
+ Hits        32976    33397     +421     
  Misses       2250     2250              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cgorenflo cgorenflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as I can tell your tests cover the edge cases and because distribution is trailing behind 2 epochs it's probably ok to change the current epoch params, but please make sure you really thought it through completely (I'm not deeply enough versed in rewards at the moment to speak with confidence). One thing to consider: what happens if the epoch shortens enough that new epochs are three times or more shorter? Do we cut multiple epochs that will be immediately eligible for distribution or do we just cut the current epoch short to this block and start a new one?

contracts/rewards/src/contract/execute.rs Outdated Show resolved Hide resolved
contracts/rewards/src/contract/execute.rs Outdated Show resolved Hide resolved
@cjcobb23 cjcobb23 merged commit b36fb4a into main Oct 9, 2024
8 checks passed
@cjcobb23 cjcobb23 deleted the rewards_params_update branch October 9, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants