-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Supply Module #4255
R4R: Supply Module #4255
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4255 +/- ##
=========================================
+ Coverage 54.62% 54.83% +0.2%
=========================================
Files 260 272 +12
Lines 16538 17020 +482
=========================================
+ Hits 9034 9333 +299
- Misses 6858 7001 +143
- Partials 646 686 +40 |
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.
Good job @fedekunze! I left some initial feedback. I'm also still a bit confused as to the "AC" of this PR. I thought the supply keeper would be the module keeping track of all sorts of supplies (ie. the staking keeper will not store bonded/unbonded supply internally)?
Looks like this PR isn't complete. Should we close @fedekunze ? |
Co-Authored-By: fedekunze <[email protected]>
…mos-sdk into fedekunze/3972-supply
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.
Tested, all good! What a massive work, thanks Fede!
I forgot to add the |
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.
ACK -- just a few more points of nitpicking.
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
Co-Authored-By: Alexander Bezobchuk <[email protected]>
…mos-sdk into fedekunze/3972-supply
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.
ACK ⚡️ 🐸 🎉 💯
Closes #3972
closes #3628
closes #4472
Full Spec: #4599
This PR creates a new
x/supply
module that passively keeps track of the total supply of the network. It introduces the concept of aModuleAccount
, which is a module/pool that holds or mint coins. TheModuleAccount
address is created from the hash of a root string (akaModuleAccount.Name
).Additionally, the supply
Keeper
has bank functionalities to transfer coins from and to anModuleAccount
using only its name.With respect to breaking changes, this PR gets rid of all the pools of coins from store and replaces each of them with a
ModuleAccount
. The pools added/affected by this change are:FeeCollectionKeeper
replaced for a fee collectorBaseAccount
(to avoid import cycles)Pool
was replaced for aNotBonded
(held in staking as opposed to before) andBonded
ModuleAccount
deposit
andburn
addresses: for agov
ModuleAccount
ModuleAccount
which controls the flow of coins into (from the fee collector acc) and out of the module store (to withdraw addresses).ModuleMinterAccount
that is allowed to mint coins before redistributing them to the fee collector account.TODOs:
x/staking
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added a relevant changelog entry:
clog add [section] [stanza] [message]
rereviewed
Files changed
in the github PR explorerFor Admin Use: