-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Prepare for DIP3 operator reward payments and switch to array in getblocktemplate #2216
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
Prepare for DIP3 operator reward payments and switch to array in getblocktemplate #2216
Conversation
UdjinM6
left a comment
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.
Looks good 👍 Just one issue with params/variables naming.
src/masternode-payments.cpp
Outdated
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.
std::vector<CTxOut>s have vout prefix in code currently (vout in CTransaction and voutSuperblockRet in mnpayments/governance/blocktemplate), let's keep it consistent maybe i.e. s/txoutsMasternodeRet/voutMasternodeRet/ or (even more descriptive) s/txoutsMasternodeRet/voutMasternodePaymentsRet/ ?
src/masternode-payments.cpp
Outdated
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.
same
src/miner.h
Outdated
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.
same
src/masternode-payments.cpp
Outdated
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.
same
src/masternode-payments.cpp
Outdated
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.
same
src/masternode-payments.cpp
Outdated
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.
same
src/rpc/mining.cpp
Outdated
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.
same
src/validation.cpp
Outdated
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.
same
10cf32d to
64d0572
Compare
64d0572 to
08e4c3c
Compare
|
Rebased on develop, so #2215 commits are removed from here now. |
src/validation.cpp
Outdated
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.
This looks like a temporary shortcut thb which would make little sense after there are many MNs paid in one block. Should probably write this part correctly i.e. "continue if one of paid masternodes is unknown" and "continue if one of masternodes is not upgraded" below.
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.
Actually, the idea behind voutMasternodePayments is not to pay multiple masternodes but to split the masternode reward into masternode payment and operator reward payment. Even in the case of masternode shares, a block will still only pay a single masternode but split the reward into multiple recipients.
I added a commit on top which loops through all txouts and if none of them is a masternode payment, it continues.
…locktemplate This commit allows to later split MN rewards into multiple recipients, e.g. the owner reward and operator reward. It also updates the getblocktemplate output to return an array of MN payments instead of a single entry. This should allow MN miners and pool operators to prepare themself for the upcoming changes in regard to operator rewards.
08e4c3c to
e9fe5fc
Compare
UdjinM6
left a comment
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.
utACK
- Change `masternode` to array of objects - Related to dashpay/dash#2216
- Change `masternode` to array of objects - Related to dashpay/dash#2216
…e recent refactorings (dashpay#2237) partially reverts dashpay#2216
This PR also includes the commits of #2215. I'll rebase and force-push after that one is merged. Only the last commit is actually part of this PR.This refactoring might look useless without the operator rewards from DIP3, but I'd like at least include the getblocktemplate change ASAP so that miners and pools operators can prepare themself for the upcoming changes.