diff --git a/_includes/devdoc/ref_p2p_networking.md b/_includes/devdoc/ref_p2p_networking.md index 7aa2690d..22478d7d 100644 --- a/_includes/devdoc/ref_p2p_networking.md +++ b/_includes/devdoc/ref_p2p_networking.md @@ -542,6 +542,34 @@ to the `getheaders` message will include as many as 2,000 block headers. {% endautocrossref %} +#### GetMNListD +{% include helpers/subhead-links.md %} + +{% autocrossref %} + +*Added in protocol version 70211* + +The `getmnlistd` message is sent to request a full masternode list or an +update to a previously requested masternode list. + +| Bytes | Name | Data type | Required | Description | +| ---------- | ----------- | --------- | -------- | -------- | +| 32 | baseBlockHash | uint256 | Required | Hash of a block the requester already has a valid masternode list of.
_Note: Can be all-zero to indicate that a full masternode list is requested._ +| 32 | blockHash | uint256 | Required | Hash of the block for which the masternode list diff is requested + +The following annotated hexdump shows a `getmnlistd` message. (The +message header has been omitted.) + +{% highlight text %} +000001ee5108348a2c59396da29dc576 +9b2a9bb303d7577aee9cd95136c49b9b ........... Base block hash + +0000030f51f12e7069a7aa5f1bc9085d +db3fe368976296fd3b6d73fdaf898cc0 ........... Block hash +{% endhighlight %} + +{% endautocrossref %} + #### Headers {% include helpers/subhead-links.md %} @@ -849,6 +877,87 @@ template near the beginning of this subsection. {% endautocrossref %} +#### MnListDiff +{% include helpers/subhead-links.md %} + +{% autocrossref %} + +*Added in protocol version 70211* + +The `mnlistdiff` message is a reply to a `getmnlistd` message which +requested either a full masternode list or a diff for a range of blocks. + +| Bytes | Name | Data type | Required | Description | +| ---------- | ----------- | --------- | -------- | -------- | +| 32 | baseBlockHash | uint256 | Required | Hash of a block the requester already has a valid masternode list of. Can be all-zero to indicate that a full masternode list is requested. +| 32 | blockHash | uint256 | Required | Hash of the block for which the masternode list diff is requested +| 4 | totalTransactions | uint32_t | Required | Number of total transactions in `blockHash` +| 1-9 | merkleHashesCount | compactSize uint | Required | Number of Merkle hashes +| variable | merkleHashes | vector | Required | Merkle hashes in depth-first order +| 1-9 | merkleFlagsCount | compactSize uint | Required | Number of Merkle flag bytes +| variable | merkleFlags | vector | Required | Merkle flag bits, packed per 8 in a byte, least significant bit first +| variable | cbTx | CTransaction | Required | The fully serialized coinbase transaction of `blockHash` +| variable | deletedMNs | vector | Required | A list of ProRegTx hashes for masternode which were deleted after `baseBlockHash` +| variable | mnList | vector | Required | The list of SML entries which were added or updated since `baseBlockHash` + +The following annotated hexdump shows a `mnlistdiff` message. (The +message header has been omitted.) + +{% highlight text %} +000001ee5108348a2c59396da29dc576 +9b2a9bb303d7577aee9cd95136c49b9b ........... Base block hash + +0000030f51f12e7069a7aa5f1bc9085d +db3fe368976296fd3b6d73fdaf898cc0 ........... Block hash + +05000000 ................................... Transactions: 5 + +04 ......................................... Merkle hash count: 4 + +4488a599e5d61709664c32305befd58b +ef29e33bc6e718af0233f938557a57a9 ........... Merkle hash 1 +5c8119b7b136d94e477a0d2917d5f724 +5ff299cc6e31994f6236a8fb34fec88f ........... Merkle hash 2 +905efa3e6743c889823f00147d36d12f +d12ad401c19089f0affcabd423deef67 ........... Merkle hash 3 +3f3a7f84d7ad33214994b5aecf4c1e19 +2cb65b86750b1377e069073d1eba477a ........... Merkle hash 4 + +01 ......................................... Merkle flag count: 1 +0f ......................................... Flags: 0 0 0 0 1 1 1 1 + +[...]....................................... Coinbase Tx (Not shown) + +00 ......................................... Deleted masternodes: 0 + +02 ......................................... Masternode list entries: 2 + +Masternode List +| Masternode 1 +| | 01040eb32f760490054543356cff4638 +| | 65633439dd073cffa570305eb086f70e ....... ProRegTx hash +| | 00000000000000000000000000000000 ....... IP Address: ::ffff:0.0.0.0 +| | 0000 ................................... Port: 0 +| | +| | 0000000000000000000000000000000000000000 +| | 0000000000000000000000000000000000000000 +| | 0000000000000000 ....................... Operator public key (BLS) +| | c2ae01fb4084cbc3bc31e7f59b36be228a320404 Voting pubkey hash (ECDSA) +| +| Masternode 2 +| | f7737beb39779971e9bc59632243e13f +| | c5fc9ada93b69bf48c2d4c463296cd5a ....... ProRegTx hash +| | 000000000000000000000000cf9af40d ....... IP Address: ::ffff:207.154.244.13 +| | 4e1f ................................... Port: 19999 +| | +| | 88d719278eef605d9c19037366910b59bc28d437 +| | de4a8db4d76fda6d6985dbdf10404fb9bb5cd0e8 +| | c22f4a914a6c5566 ....................... Operator public key (BLS) +| | 43ce12751c4ba45dcdfe2c16cefd61461e17a54d Voting pubkey hash (ECDSA) +{% endhighlight %} + +{% endautocrossref %} + #### NotFound {% include helpers/subhead-links.md %} diff --git a/img/dev/en-p2p-data-messages.dot b/img/dev/en-p2p-data-messages.dot index 2e47a418..72e090ac 100644 --- a/img/dev/en-p2p-data-messages.dot +++ b/img/dev/en-p2p-data-messages.dot @@ -10,6 +10,7 @@ edge [ penwidth = 1.75, fontname="Sans", dir="none" ] node [ penwidth = 1.75, shape = "box", fontname="Sans", ] graph [ penwidth = 1.75, fontname="Sans" ] +getmnlistd -> mnlistdiff [ minlen = 3 ]; getblocktxn -> blocktxn [ minlen = 3 ]; getblocks -> inv; diff --git a/img/dev/en-p2p-data-messages.png b/img/dev/en-p2p-data-messages.png index 39ada934..9b511c8d 100644 Binary files a/img/dev/en-p2p-data-messages.png and b/img/dev/en-p2p-data-messages.png differ diff --git a/img/dev/en-p2p-data-messages.svg b/img/dev/en-p2p-data-messages.svg index 73699941..38ba1556 100644 --- a/img/dev/en-p2p-data-messages.svg +++ b/img/dev/en-p2p-data-messages.svg @@ -4,128 +4,142 @@ - - + + %3 - + Overview Of P2P Protocol Data Request And Reply Messages + +getmnlistd + +getmnlistd + + +mnlistdiff + +mnlistdiff + + +getmnlistd->mnlistdiff + + -getblocktxn - -getblocktxn +getblocktxn + +getblocktxn -blocktxn - -blocktxn +blocktxn + +blocktxn -getblocktxn->blocktxn - +getblocktxn->blocktxn + -getblocks - -getblocks +getblocks + +getblocks -inv - -inv +inv + +inv -getblocks->inv - +getblocks->inv + -getdata - -getdata +getdata + +getdata -inv->getdata - +inv->getdata + -mempool - -mempool +mempool + +mempool -mempool->inv - +mempool->inv + -tx - -tx +tx + +tx -getdata->tx - +getdata->tx + -block - -block +block + +block -getdata->block - +getdata->block + -merkleblock - -merkleblock +merkleblock + +merkleblock -getdata->merkleblock - +getdata->merkleblock + -notfound - -notfound +notfound + +notfound -getdata->notfound - +getdata->notfound + -getheaders - -getheaders +getheaders + +getheaders -headers - -headers +headers + +headers -getheaders->headers - +getheaders->headers + -label1 -Request For Help -Getting Up To Date +label1 +Request For Help +Getting Up To Date -label2 -Reply With -Inventory +label2 +Reply With +Inventory -label3 -Request For Specific Data +label3 +Request For Specific Data -label4 -Reply With -Requested Data +label4 +Reply With +Requested Data