Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
R4R: F1 fee distribution #3099
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.
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).
For Admin Use:
@@ 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
referenced this pull request
Dec 14, 2018
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.
rigelrozanski left a comment •
Generally a very clean implementation