Open facundomedica opened 4 days ago
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
This PR is a proposal to remove the dependency that exists between x/distribution and x/protocolpool.
Main changes:
x/distribution does not require x/protocolpool anymore, it sends a simple bank send to a predefined x/protocolpool account. This is an "intermediary" account, that its only purpose is to hold this tokens until they get distributed by x/protocolpool (otherwise it's difficult to know how many tokens were added to be distributed).
x/protocolpool now has its own BeginBlocker where it takes the funds from the intermediary account and sends them to community pool and the stream account.
x/distribution uses the bank module to interact with x/protocolpool (there are a couple of instances in which it does a send "impersonating" x/protocolpool, but those are deprecated endpoints).
Before: x/distr would make a bank send to the community pool and also call SetToDistribute (because we needed to know how many tokens there were to distribute).
After this PR: x/distribution does a simple bank send to an intermediary account held by protocol pool (pool_distr), which then in its own BeginBlock x/protocolpool will distribute accordingly. x/distribution knows nothing other than the name of the intermediary account.
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...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...