forked from DiviProject/Divi
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Conversation
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
from
April 28, 2021 14:27
f207367 to
919895e
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
5 times, most recently
from
May 18, 2021 11:49
641be27 to
cad445b
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
3 times, most recently
from
May 31, 2021 12:56
f4babcd to
551e72b
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
3 times, most recently
from
June 17, 2021 12:44
ea6a3b5 to
b2d4e5c
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
from
June 29, 2021 12:16
b2d4e5c to
5a3311b
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
2 times, most recently
from
July 7, 2021 13:47
5910359 to
511505f
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
2 times, most recently
from
August 19, 2021 13:51
c400b74 to
774b715
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
4 times, most recently
from
August 20, 2021 13:33
58c0cd9 to
e059323
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
2 times, most recently
from
September 9, 2021 09:17
a157b4a to
d0fff31
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
3 times, most recently
from
October 14, 2021 11:21
68a38ef to
4e31101
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
3 times, most recently
from
November 2, 2021 13:26
84b987a to
2582ecf
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
5 times, most recently
from
November 3, 2021 14:18
bebd6ba to
c683b9d
Compare
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
from
November 10, 2021 12:52
c683b9d to
29a76bc
Compare
This adds a new field, CScript rewardScript, to the masternode data structures. For now, we just add it, return it from the RPCs, and set it to the script corresponding to the collateral pubkey on creation. We also serialise the new field as part of CMasternode, which is used e.g. in the on-disk cache, but not the wire protocol (where CMasternodeBroadcast is used instead). Thus this change invalidates the mncache format, but has no other effects on compatibility. In the future, we will implement a protocol upgrade and also network fork that will use this new field so masternodes can specify an arbitrary script to which they want to receive their payments, rather than being paid always to the collateral address.
Define a new wire protocol version, and for peers that match the version, send the reward script as explicit part of the masternode broadcast messages. Also, if the reward script is not the default value, include it in the signature message of the broadcast (so that the field is authenticated by the collateral signature). Until the protocol version is bumped on the network (which is not yet the case with this commit), masternodes with non-default reward script will not be accepted as valid.
Instead of using the collateral pubkey, pay to the declared reward script of masternodes (and use that to check payments).
This extends the setupmasternode RPC method so that it allows setting a non-default reward address. The reward address is an optional sixth argument following the ip_address.
Use a custom reward address for one of the two masternodes in the mnoperation.py regtest, verifying that this works. For the test, we activate the new protocol version on regtest without any forking logic.
Custom reward addresses are one of the core features needed for proper masternode vaults. With them implemented now, we can update the mnvaults.py test (resolving two FIXME's in there) to actually make use of an explicit reward address so that the masternode rewards are received and not lost (as we want them to be in practice).
This defines a new time-activated "fork", Fork::CustomRewardAddresses. For now, it is scheduled at timestamp 2000000000; that will be set to the actual activation time once it is determined. When this fork becomes active (i.e. the current best block's timestamp goes beyond the activation time), we require peers to use the new protocol version that supports custom reward addresses. The fork has no other (in particular, no consensus-level) consequences.
This adds a new regtest, custom_address_update.py. The test runs two masternodes, where we explicitly set the protocol version of one of the nodes to the "old" version not supporting custom reward scripts for masternodes. With this test, we ensure that all the masternode networking works fine between "old" and "new" nodes before the update is activated, at least as closely as we can without running a real old node.
@domob1812
domob1812
force-pushed
the
custom-reward-address
branch
from
November 16, 2021 11:54
29a76bc to
d9ee191
Compare
@galpHub
galpHub
force-pushed
the
Development
branch
from
March 22, 2023 21:29
1fce65e to
bc11fc0
Compare
@galpHub
galpHub
force-pushed
the
Development
branch
from
June 26, 2023 19:07
4543595 to
1333814
Compare
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.
Currently, masternode rewards are paid to the address that holds the collateral. In some situations, this is restrictive, and it would be useful to give masternode owners a choice about where the reward should be paid to (for instance, this will allow easier setup of masternode vaults for improved security).
This set of changes implements a protocol upgrade, which then allows masternodes to (optinally) configure an arbitrary script to which rewards should be paid. Until the upgrade and until a particular masternode owner decides to explicitly opt into this feature, rewards will continue to be paid to the default script (matching the collateral address).
The protocol update itself will be activated at a hard-coded activation time using the fork activation framework from staking vaults. For now, the activation time is set to 2'000'000'000 (i.e. "far away") and will need to be adjusted once we are ready to schedule the fork.
This is #44 rebased and reopened to some changes done to the git branches.