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

feat(mint): add mint module #794

Merged
merged 8 commits into from
May 16, 2022
Merged

feat(mint): add mint module #794

merged 8 commits into from
May 16, 2022

Conversation

giunatale
Copy link
Contributor

Closes #780
Closes #781

What does this PR does?

Adds a forked version of the mint module.
Unfortunately I could not fork the osmosis module since it depends on their epoch module, and so it was unfit.
I opted to start with the vanilla mint module as a baseline, with the dynamic inflation rate. In the future, we could explore some capping mechanism, for instance a reduction after a year worth of blocks as done in the juno mint module.

The module distributes inflation to 3 parties:

  • staking
  • the future-to-be module account of the incentive modules (currently commented out in keeper.go)
    the idea is to send rewards directly to the incentives module account so that the module itself can handle the accumulated rewards independently.
  • community pool

I have opted to not include at this time a "developers" rewards or "strategic reserve" rewards because this need to be thought out later. We could explore a similar design as per osmosis where a weighted list of addresses, that can be changed through governance, receive rewards from inflation. Not sure if doing this per-block is efficient though. Hence, leaving it aside.

@codecov
Copy link

codecov bot commented May 13, 2022

Codecov Report

Merging #794 (381e6b3) into develop (af6dccb) will decrease coverage by 0.08%.
The diff coverage is 8.28%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #794      +/-   ##
===========================================
- Coverage    10.73%   10.65%   -0.09%     
===========================================
  Files          286      302      +16     
  Lines        69593    72212    +2619     
===========================================
+ Hits          7473     7693     +220     
- Misses       61940    64333    +2393     
- Partials       180      186       +6     
Impacted Files Coverage Δ
x/mint/abci.go 0.00% <0.00%> (ø)
x/mint/genesis.go 0.00% <0.00%> (ø)
x/mint/types/genesis.go 0.00% <0.00%> (ø)
x/mint/types/query.pb.gw.go 0.00% <0.00%> (ø)
x/mint/types/mint.pb.go 0.57% <0.57%> (ø)
x/mint/types/query.pb.go 0.94% <0.94%> (ø)
x/mint/types/genesis.pb.go 1.10% <1.10%> (ø)
x/mint/types/params.go 9.03% <9.03%> (ø)
x/mint/client/rest/query.go 31.57% <31.57%> (ø)
x/mint/keeper/querier.go 74.28% <74.28%> (ø)
... and 7 more

Copy link
Contributor

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

LGTM staking rewards can be distributed

I would suggest setting params for the module in config.yml

@giunatale giunatale requested a review from lumtis May 13, 2022 10:23
lumtis
lumtis previously approved these changes May 13, 2022
Copy link

@aljo242 aljo242 left a comment

Choose a reason for hiding this comment

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

This and a minor lint issue need to be fixed imo. I can just push these minor changes.

x/mint/module.go Outdated Show resolved Hide resolved
@aljo242 aljo242 self-requested a review May 16, 2022 12:46
@aljo242 aljo242 requested a review from lumtis May 16, 2022 14:06
@lumtis lumtis merged commit b8c079a into develop May 16, 2022
@lumtis lumtis deleted the feat/mint branch May 16, 2022 15:12
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.

mint module: introduce a parameter for community pool block rewards Fork mint module
3 participants