-
Notifications
You must be signed in to change notification settings - Fork 292
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
multi: Implement DCP0012 subsidy consensus vote. #3092
Conversation
c7b5762
to
138127e
Compare
Note that I've disabled the RPC integration test ( |
138127e
to
1e60037
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.
While DCP0012 isn't actually published as of this comment, the code in the PR implements the approved proposal (1/89/10 split).
I haven't done manual tests on simnet yet, so that I can perform them with the upcoming pow algo change as well.
wantFull: 1896827356, | ||
wantWork: 11380963, | ||
wantVote: 337635269, | ||
wantTreasury: 113809641, |
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.
Manually verified the numbers in the tests.
// at the time of this writing. For testing purposes, the activation height | ||
// is estimated to be 782208 on mainnet. | ||
const dcp0010ActivationHeight = 657280 | ||
const estimatedDCP0012ActivationHeight = 782208 |
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.
First commit message has calculate calculate
typo
1e60037
to
b3fd35c
Compare
Fixed. |
837403d
to
032295a
Compare
This adds two new exported functions to the subsidy cache in blockchain/standalone to calculate the work and stake vote subsidies according to a provided subsidy split variant flag along with tests to ensure expected behavior. The available variants are: - The original subsidy split used at launch - The modified subsidy split defined by DCP0010 - The modified subsidy split defined by DCP0012 It should be noted that the values for the modified split are hard coded as opposed to using the subsidy cache params in order to avoid the need for a major module bump that would be required if the subsidy params interface were changed. The values are the same for all networks, so no additional logic is necessary on a per-network basis.
This implements the agenda for voting on the round 2 modified subsidy split defined in DCP0012 along with consensus tests. In particular, once the vote has passed and is active, the PoW subsidy will be 1% of the block reward and the PoS subsidy will be 89%. The Treasury subsidy will remain at 10%. In terms of the overall effects, this includes updates to: - The validation logic for votes, coinbases, and overall block subsidy - Enforcement when considering candidate votes for acceptance to the mempool, relaying, and inclusion into block templates - Mining template generation - The output of the getblocksubsidy RPC Also note that this does not implement the block version bump that will ultimately be needed by the mining code since there are multiple consensus votes gated behind it and will therefore be done separately. The following is an overview of the changes: - Introduce a convenience function for determining if the vote passed and is now active - Modify vote validation to enforce the new stake vote subsidy in accordance with the state of the vote - Modify coinbase validation to enforce the new work subsidy in accordance with the state of the vote - Modify block validation logic to enforce the total overall subsidy in accordance with the state of the vote - Add tests for determining if the agenda is active for both mainnet and testnet - Add tests for getblocksubsidy RPC - Add tests to ensure proper behavior for the modified subsidy splits as follows: - Ensure new blockchain validation semantics are enforced once the agenda is active - Ensure mempool correctly accepts and rejects votes in accordance with the state of the vote
This updates the simnet environment documentation to account for the different expected initial balances due to the subsidy split round 2 agenda since it is always active on simnet.
032295a
to
8f3e249
Compare
This requires #3090.
This implements the agenda for voting on the round 2 modified subsidy split defined in DCP0012 along with consensus tests.
In particular, once the vote has passed and is active, the PoW subsidy will be 1% of the block reward and the PoS subsidy will be 89%. The Treasury subsidy will remain at 10%.
In terms of the overall effects, this includes updates to:
mempool
, relaying, and inclusion into block templatesgetblocksubsidy
RPCAlso note that this does not implement the block version bump that will ultimately be needed by the mining code since there are multiple consensus votes gated behind it and will therefore be done separately.
The following is an overview of the changes:
blockchain/standalone
for calculating the work and stake vote subsidies according to a subsidy split variant flag:standalone.SSVOriginal
)standalone.SSVDCP0010
)standalone..SSVDCP0012
)mainnet
andtestnet
getblocksubsidy
RPCmempool
correctly accepts and rejects votes in accordance with the state of the vote