-
Notifications
You must be signed in to change notification settings - Fork 113
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
go staking: three-way fee split #2794
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-Authored-By: Peter Gilbert <[email protected]>
pro-wh
added
c:consensus/cometbft
Category: CometBFT
c:staking
Category: staking
labels
Mar 30, 2020
pro-wh
force-pushed
the
pro-wh/feature/nextprop
branch
from
March 30, 2020 20:46
5f07be5
to
b1ef913
Compare
pro-wh
force-pushed
the
pro-wh/feature/nextprop
branch
from
March 30, 2020 20:48
b1ef913
to
4c5f068
Compare
Codecov Report
@@ Coverage Diff @@
## master #2794 +/- ##
==========================================
+ Coverage 61.63% 61.70% +0.06%
==========================================
Files 386 386
Lines 37095 37131 +36
==========================================
+ Hits 22865 22912 +47
+ Misses 11222 11213 -9
+ Partials 3008 3006 -2
Continue to review full report at Codecov.
|
peterjgilbert
approved these changes
Mar 30, 2020
ptrus
reviewed
Mar 31, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We should give more to the previous block proposer, which is the block that first ran the transactions that paid the fees in the
LastBlockFees
. Currently they only get paid as a voter.Proposed design
Summary
The fee for block$h$ is split into $k$ portions, where $k$ is the number of validators at block $h$ , one for each of those validators.$h$ , pay the proposer share of all portions to the proposer of block $h$ .$h+1$ , for each portion where its validator's vote is included in block $h+1$ , pay the voter share to the validator and pay the next proposer share to the proposer of block $h+1$ .
Each portion is split by constant weights into a proposer share, a voter share, and a next proposer share.
At the end of block
At the beginning of block
Changes to genesis document
In
.staking.params
:fee_split_*
is renamed tofee_split_weight_*
fee_split_weight_next_propose
, aquantity.Quantity
fee_split_weight_propose
controls the proposer share (previously controlled the next proposer share)Setting idea:
fee_split_weight_propose
: 2fee_split_weight_vote
: 1fee_split_weight_next_propose
: 1Changes to block context
proposerEntityKey
, the block proposer, with the entity of the proposer (needed to remember the proposer fromBeginBlock
for use inEndBlock
)Changes to ABCI state
lastBlockFeesKeyFmt
, the last block fees, now stores only the voter shares and next proposer sharesAlgorithms
In cases where resolving an entity ID from a node address fails, skip movements to its balance.
In
BeginBlock
:In
EndBlock
: