-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: F1 fee distribution #3099
R4R: F1 fee distribution #3099
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3099 +/- ##
==========================================
+ Coverage 55.64% 55.8% +0.16%
==========================================
Files 134 132 -2
Lines 9746 9488 -258
==========================================
- Hits 5423 5295 -128
+ Misses 3980 3858 -122
+ Partials 343 335 -8 |
a6964b6
to
e7e30e8
Compare
e7e30e8
to
c0babcc
Compare
67a555f
to
ff6ffe5
Compare
57b1f5d
to
11515c2
Compare
ba26c9b
to
d5404bf
Compare
c627e11
to
63a589f
Compare
63a589f
to
c9a4978
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.
Did a first run through and left some comments. Overall, looks really good 👍
Co-Authored-By: cwgoes <cwgoes@pluranimity.org>
Co-Authored-By: cwgoes <cwgoes@pluranimity.org>
So there will be no need to implement a specific Auto Withdraw + Delegate fee script for validators ? |
This instantiation of F1 does not include automatic inflation calculation, so re-bonding will still be necessary. Future versions may implement inflation per the spec, which would render it unnecessary. |
Got it. Thanks. |
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.
Generally a very clean implementation 👏
Main considerations:
- currently the file organization is unintuitively shuffled for me - within keeper, we really ought to reorg functions into files relating to either objects (aka
delegation.go
,validator.go
) or abci calls (tx.go
,end_block.go
etc. ) - use of sdk.Dec for staking should be removed (see comment)
- lack of NewXxx functions
- there is a missing test which would ease my heart.
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.
🏁 🏁 🏁 🏎
🏅
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.
Ready for merge! Great work @cwgoes and @cosmos/cosmossdk team!
Closes #2916
Implement the F1 spec in the "simple form" (inflation is left separate for the time being).
This PR is structured to be reviewed as a sequence of commits, commit-by-commit.
Each is independent (builds / passes simulations successfully, except for the import/export test which I left for the end).
PENDING.md
( 😉 )Saved for a separate PR: queriers and CLI commands to view state (mostly reincarnated from last time). I can add that as a PR to this one if we want to wait on those to merge, but easier to review just the substance first I think.
In my view, this version of fee distribution compares favorably to our current one: it is not approximate (so e.g. the whole class of concerns illuminated by #2764 are eliminated), it completely separates withdrawal for separate users (no delegator or validator can cause another to be forced to withdraw fees, thus eliminating the class of concerns of #2914), it makes it far easier for us to change the distribution function per-validator (so e.g. #2525 and #3023 can more easily be addressed), it is implementationally simpler, and it is more amenable to future improvements (see the spec).
One concern is potential error introduced by utilizing decimals - although F1 is analytically exact, we cannot use arbitrary-precision rational numbers in the state machine and must make do with decimals.
The validator update delay renders fee payments slightly inaccurate (e.g. delegations will be paid a block before their validator actually signs), but I don't think this impacts the implementation. The most complex / nuanced part is probably dealing with slashes, which must be iterated through on withdrawal.
F1 has not yet been tested on a testnet. Depending on results of review, given our current timeline, this seems like a candidate for "Red Wedding" (#3079).
docs/
)PENDING.md
with issue #Files changed
in the github PR explorerFor Admin Use: