From d5eb80fed1b453c8f2519d435c345091a85f903f Mon Sep 17 00:00:00 2001 From: thephez Date: Thu, 7 Sep 2017 16:15:34 -0400 Subject: [PATCH] Governance subsection (P2P) - Start adding govobj, govobjvote details - Add spork references --- _includes/devdoc/ref_p2p_networking.md | 60 +++++++++++++++++++++++++- _includes/references.md | 2 + 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 83808565..82ea32db 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -1144,8 +1144,7 @@ section][section message header] for an example of a message without a payload. {% autocrossref %} -The `getsporks` message requests `spork` messages from the receiving -node. +The `getsporks` message requests `spork` messages from the receiving node. There is no payload in a `getsporks` message. See the [message header section][section message header] for an example of a message without a payload. @@ -1294,6 +1293,8 @@ not immediately made active (or “enforced”). Enforcement of the updated code can be activated remotely. Should problems arise, the code can be deactivated in the same manner, without the need for a network-wide rollback or client update. +A `spork` message may be sent in response to a `getsporks` message. + The `spork` message tells the receiving peer the status of the spork defined by the SporkID field. @@ -1672,6 +1673,52 @@ The following network messages enable the Governance features built in to Dash. {% autocrossref %} +The `govobj` message is ... + +| Bytes | Name | Data type | Required | Description | +| ---------- | ----------- | --------- | -------- | -------- | +| 32 | nHashParent | uint256 | Required | Parent object, 0 is root +| 4 | nRevision | int | Required | Object revision in the system +| 8 | nTime | int64_t | Required | Time which this object was created +| 32 | nCollateralHash | uint256 | Required | Hash of the collateral fee transaction +| 0-16384 | strData | string | Required | Data field - can be used for anything (leading varint indicates size of data) +| 4 | nObjectType | int | Required | Type of governance object as defined by src/governance-object.h +| 41 | vinMasternode | CTxIn | Required | Unspent output for the masternode which is signing this object +| 66* | vchSig | char[] | Required | Signature of the masternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) + +The following annotated hexdump shows a `govobj` message. (The +message header has been omitted.) + +{% highlight text %} +00000000000000000000000000000000 +00000000000000000000000000000000 ..... Parent Hash (0 = root) +01000000 ............................. Revision (1) +911ea85900000000 ..................... Create timestamp (2017-08-31 10:34:57 EDT) +00000000000000000000000000000000 +00000000000000000000000000000000 ..... Collateral Hash + +Data +| ae11 ............................... Data length (4526) +| fdae11356235623 ... 376435643564 ... Data (truncated) + +02000000 ............................. Object Type (2 = GOVERNANCE_OBJECT_TRIGGER) + +Transaction input +| UTXO +| | ffefbe4959085907bcd2ba29e357a441 +| | fa7b6e26e25896d8127332bba2419e97 ... Outpoint TXID +| | 00000000 ........................... Outpoint index number (0) +| 00 ................................... Script length (0) +| ...................................... Signature (None) +| ffffffff ............................. Sequence + +1ce3b782f66be8ae9fc4158680128864 +341202b6006384083ab2d9cfa73795e2 +6000668e84af4ef6a284a52b53843524 +72037d51bd9079ffd5c087d9632865ee +75 ................................... Masternode Signature +{% endhighlight %} + {% endautocrossref %} #### govobjvote @@ -1679,6 +1726,15 @@ The following network messages enable the Governance features built in to Dash. {% autocrossref %} +| Bytes | Name | Data type | Required | Description | +| ---------- | ----------- | --------- | -------- | -------- | +| 41+ | vinMasternode | CTxIn | Required | Unspent output for the masternode which is voting +| 32 | nParentHash | uint256 | Required | Object which we're voting on (proposal, contract, setting or final budget) +| 4 | nVoteOutcome | int | Required | +| 4 | nVoteSignal | int | Required | +| 8 | nTime | int64_t | Required | Time which the vote was created +| 66* | vchSig | char[] | Required | Signature of the masternode (66 bytes in most cases. Length (1 byte) + Signature (65 bytes)) + {% endautocrossref %} #### govsync diff --git a/_includes/references.md b/_includes/references.md index 26514428..8e23570f 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -211,6 +211,7 @@ http://opensource.org/licenses/MIT. [getblocks message]: /en/developer-reference#getblocks "A P2P protocol message used to request an inv message containing a range of block header hashes" [getdata message]: /en/developer-reference#getdata "A P2P protocol message used to request one or more transactions, blocks, or merkle blocks" [getheaders message]: /en/developer-reference#getheaders "A P2P protocol message used to request a range of block headers" +[getsporks message]: /en/developer-reference#getsporks "A P2P network message used to request the status of sporks" [headers message]: /en/developer-reference#headers "A P2P protocol message containing one or more block headers" [inv message]: /en/developer-reference#inv "A P2P protocol message used to send inventories of transactions and blocks known to the transmitting peer" [ix message]: /en/developer-reference#ix "A P2P protocol message which sends a single serialized transaction via InstantSend" @@ -221,6 +222,7 @@ http://opensource.org/licenses/MIT. [pong message]: /en/developer-reference#pong "A P2P network message used to reply to a P2P network ping message" [reject message]: /en/developer-reference#reject "A P2P network message used to indicate a previously-received message was rejected for some reason" [sendheaders message]: /en/developer-reference#sendheaders "A P2P network message used to request new blocks be announced through headers messages rather than inv messages" +[spork message]: /en/developer-reference#spork "A P2P network message used to send the activation status of a spork" [tx message]: /en/developer-reference#tx "A P2P protocol message which sends a single serialized transaction" [txlvote message]: /en/developer-reference#txlvote "A P2P protocol message which masternodes send in response to an ix (transaction lock request) message if the transaction inputs can be locked." [verack message]: /en/developer-reference#verack "A P2P network message sent in reply to a version message to confirm a connection has been established"