-
Notifications
You must be signed in to change notification settings - Fork 2
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
Introduce compounder cap #220
Conversation
…cking in extra_cap based on their voting power in previous round.
… the new code - validate_denom() modified to be able to execute for past rounds as well
85fc37e
to
917e2e4
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.
Reviewed:
- Time-adjustment for constants
- Keeping historical values for user locks and total power
To-do:
- Compounder cap itself
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.
Just to check my understanding of the migration:
- USER_LOCKS will only be populated from the height of the migration onwards, and empty for earlier rounds (thus get_user_voting_power_for_past_rounds will be unpopulated)
- TOTAL_VOTING_POWER_PER_ROUND will be populated correctly for all rounds
- round height mappings will be populated only for future heights, and empty for earlier rounds
Do you think it's worth storing the height of the migration and erroring out when querying these if the asked-for height was before the migration height?
Pro: harder to mess up when calling these
Con: might make testing harder
Maybe we can do this just in the outward-facing queries. I think that would not impact testing too much, but assure us a bit more that noone will build on this and have it silently fail in a weird way.
That is correct.
I agree with storing the info during the migration and checking it later. Currently we only need this for the mentioned function, even though it doesn't get called from the outside (yet). |
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.
Reviewed everything except the tests for now.
Great work!
Ok, LGTM! Just a reminder to do the admin things (recompile & add changelog). We can do a separate PR for the queries. |
Description
This PR introduces the "compounder cap" which reserves certain amount of tokens (out of the total number of tokens allowed to be locked) and allows users that had voting power in previous round to exclusively lock in this cap, for a certain time frame. The "compounder cap" is meant to be active for some time at the beginning of the round. After this time has expired, any amount of tokens that wasn't locked by the compunders will be at disposal to any other user to freely lock, up to the limit of total cap, that is enforced at any time. Implementation also supports re-activation of "compunders cap" at any time during the round, which is controlled by the contract governance and handled by the
update_config()
action (as it is the case with initial activation).Techinical Details
Updated contract stores:
Newly added stores:
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
.changelog
make compile
and included content of the artifacts directory into the PRmake schema
and included generated files into the PR