Content - P2P - Add DIP4 p2p messages

getmnlistd and mnlistdiff with details
Update data message image with DIP4 messages
This commit is contained in:
thephez 2018-11-08 15:04:17 -05:00
parent 3e3660ffef
commit 00649c5928
4 changed files with 193 additions and 69 deletions

View file

@ -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.<br>_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<uint8_t> | 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 %}

View file

@ -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;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

@ -4,128 +4,142 @@
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="450pt" height="234pt"
viewBox="0.00 0.00 450.00 234.49" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(0.758853 0.758853) rotate(0) translate(4 305)">
<svg width="450pt" height="265pt"
viewBox="0.00 0.00 450.00 264.84" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(0.758853 0.758853) rotate(0) translate(4 345)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-305 589,-305 589,4 -4,4"/>
<polygon fill="white" stroke="none" points="-4,4 -4,-345 589,-345 589,4 -4,4"/>
<text text-anchor="middle" x="292.5" y="-7.8" font-family="Sans" font-size="14.00">Overview Of P2P Protocol Data Request And Reply Messages</text>
<!-- getmnlistd -->
<g id="node1" class="node"><title>getmnlistd</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="119.5,-59 30.5,-59 30.5,-23 119.5,-23 119.5,-59"/>
<text text-anchor="middle" x="75" y="-37.3" font-family="Sans" font-size="14.00">getmnlistd</text>
</g>
<!-- mnlistdiff -->
<g id="node2" class="node"><title>mnlistdiff</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="561.5,-59 481.5,-59 481.5,-23 561.5,-23 561.5,-59"/>
<text text-anchor="middle" x="521.5" y="-37.3" font-family="Sans" font-size="14.00">mnlistdiff</text>
</g>
<!-- getmnlistd&#45;&gt;mnlistdiff -->
<g id="edge1" class="edge"><title>getmnlistd&#45;&gt;mnlistdiff</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M119.856,-41C206.988,-41 397.863,-41 481.217,-41"/>
</g>
<!-- getblocktxn -->
<g id="node1" class="node"><title>getblocktxn</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="124,-59 26,-59 26,-23 124,-23 124,-59"/>
<text text-anchor="middle" x="75" y="-37.3" font-family="Sans" font-size="14.00">getblocktxn</text>
<g id="node3" class="node"><title>getblocktxn</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="124,-99 26,-99 26,-63 124,-63 124,-99"/>
<text text-anchor="middle" x="75" y="-77.3" font-family="Sans" font-size="14.00">getblocktxn</text>
</g>
<!-- blocktxn -->
<g id="node2" class="node"><title>blocktxn</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="559,-59 484,-59 484,-23 559,-23 559,-59"/>
<text text-anchor="middle" x="521.5" y="-37.3" font-family="Sans" font-size="14.00">blocktxn</text>
<g id="node4" class="node"><title>blocktxn</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="559,-99 484,-99 484,-63 559,-63 559,-99"/>
<text text-anchor="middle" x="521.5" y="-77.3" font-family="Sans" font-size="14.00">blocktxn</text>
</g>
<!-- getblocktxn&#45;&gt;blocktxn -->
<g id="edge1" class="edge"><title>getblocktxn&#45;&gt;blocktxn</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M124.061,-41C213.997,-41 403.414,-41 483.967,-41"/>
<g id="edge2" class="edge"><title>getblocktxn&#45;&gt;blocktxn</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M124.061,-81C213.997,-81 403.414,-81 483.967,-81"/>
</g>
<!-- getblocks -->
<g id="node3" class="node"><title>getblocks</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="115.5,-179 34.5,-179 34.5,-143 115.5,-143 115.5,-179"/>
<text text-anchor="middle" x="75" y="-157.3" font-family="Sans" font-size="14.00">getblocks</text>
<g id="node5" class="node"><title>getblocks</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="115.5,-219 34.5,-219 34.5,-183 115.5,-183 115.5,-219"/>
<text text-anchor="middle" x="75" y="-197.3" font-family="Sans" font-size="14.00">getblocks</text>
</g>
<!-- inv -->
<g id="node4" class="node"><title>inv</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="231,-159 177,-159 177,-123 231,-123 231,-159"/>
<text text-anchor="middle" x="204" y="-137.3" font-family="Sans" font-size="14.00">inv</text>
<g id="node6" class="node"><title>inv</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="231,-199 177,-199 177,-163 231,-163 231,-199"/>
<text text-anchor="middle" x="204" y="-177.3" font-family="Sans" font-size="14.00">inv</text>
</g>
<!-- getblocks&#45;&gt;inv -->
<g id="edge2" class="edge"><title>getblocks&#45;&gt;inv</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M115.835,-154.727C135.767,-151.588 159.329,-147.877 176.927,-145.106"/>
<g id="edge3" class="edge"><title>getblocks&#45;&gt;inv</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M115.835,-194.727C135.767,-191.588 159.329,-187.877 176.927,-185.106"/>
</g>
<!-- getdata -->
<g id="node6" class="node"><title>getdata</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="389,-159 319,-159 319,-123 389,-123 389,-159"/>
<text text-anchor="middle" x="354" y="-137.3" font-family="Sans" font-size="14.00">getdata</text>
<g id="node8" class="node"><title>getdata</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="389,-199 319,-199 319,-163 389,-163 389,-199"/>
<text text-anchor="middle" x="354" y="-177.3" font-family="Sans" font-size="14.00">getdata</text>
</g>
<!-- inv&#45;&gt;getdata -->
<g id="edge4" class="edge"><title>inv&#45;&gt;getdata</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M231.119,-141C255.516,-141 292.082,-141 318.797,-141"/>
<g id="edge5" class="edge"><title>inv&#45;&gt;getdata</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M231.119,-181C255.516,-181 292.082,-181 318.797,-181"/>
</g>
<!-- mempool -->
<g id="node5" class="node"><title>mempool</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="114.5,-139 35.5,-139 35.5,-103 114.5,-103 114.5,-139"/>
<text text-anchor="middle" x="75" y="-117.3" font-family="Sans" font-size="14.00">mempool</text>
<g id="node7" class="node"><title>mempool</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="114.5,-179 35.5,-179 35.5,-143 114.5,-143 114.5,-179"/>
<text text-anchor="middle" x="75" y="-157.3" font-family="Sans" font-size="14.00">mempool</text>
</g>
<!-- mempool&#45;&gt;inv -->
<g id="edge3" class="edge"><title>mempool&#45;&gt;inv</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M114.794,-127.109C134.927,-130.28 158.986,-134.069 176.888,-136.888"/>
<g id="edge4" class="edge"><title>mempool&#45;&gt;inv</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M114.794,-167.109C134.927,-170.28 158.986,-174.069 176.888,-176.888"/>
</g>
<!-- tx -->
<g id="node7" class="node"><title>tx</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="548.5,-219 494.5,-219 494.5,-183 548.5,-183 548.5,-219"/>
<text text-anchor="middle" x="521.5" y="-197.3" font-family="Sans" font-size="14.00">tx</text>
<g id="node9" class="node"><title>tx</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="548.5,-259 494.5,-259 494.5,-223 548.5,-223 548.5,-259"/>
<text text-anchor="middle" x="521.5" y="-237.3" font-family="Sans" font-size="14.00">tx</text>
</g>
<!-- getdata&#45;&gt;tx -->
<g id="edge5" class="edge"><title>getdata&#45;&gt;tx</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-153.432C420.536,-164.759 466.011,-181.246 494.393,-191.535"/>
<g id="edge6" class="edge"><title>getdata&#45;&gt;tx</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-193.432C420.536,-204.759 466.011,-221.246 494.393,-231.535"/>
</g>
<!-- block -->
<g id="node8" class="node"><title>block</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="548.5,-179 494.5,-179 494.5,-143 548.5,-143 548.5,-179"/>
<text text-anchor="middle" x="521.5" y="-157.3" font-family="Sans" font-size="14.00">block</text>
<g id="node10" class="node"><title>block</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="548.5,-219 494.5,-219 494.5,-183 548.5,-183 548.5,-219"/>
<text text-anchor="middle" x="521.5" y="-197.3" font-family="Sans" font-size="14.00">block</text>
</g>
<!-- getdata&#45;&gt;block -->
<g id="edge6" class="edge"><title>getdata&#45;&gt;block</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-145.144C420.536,-148.92 466.011,-154.415 494.393,-157.845"/>
<g id="edge7" class="edge"><title>getdata&#45;&gt;block</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-185.144C420.536,-188.92 466.011,-194.415 494.393,-197.845"/>
</g>
<!-- merkleblock -->
<g id="node9" class="node"><title>merkleblock</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="571,-139 472,-139 472,-103 571,-103 571,-139"/>
<text text-anchor="middle" x="521.5" y="-117.3" font-family="Sans" font-size="14.00">merkleblock</text>
<g id="node11" class="node"><title>merkleblock</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="571,-179 472,-179 472,-143 571,-143 571,-179"/>
<text text-anchor="middle" x="521.5" y="-157.3" font-family="Sans" font-size="14.00">merkleblock</text>
</g>
<!-- getdata&#45;&gt;merkleblock -->
<g id="edge7" class="edge"><title>getdata&#45;&gt;merkleblock</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-136.856C413.151,-133.973 445.309,-130.087 471.816,-126.883"/>
<g id="edge8" class="edge"><title>getdata&#45;&gt;merkleblock</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-176.856C413.151,-173.973 445.309,-170.087 471.816,-166.883"/>
</g>
<!-- notfound -->
<g id="node10" class="node"><title>notfound</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="561,-99 482,-99 482,-63 561,-63 561,-99"/>
<text text-anchor="middle" x="521.5" y="-77.3" font-family="Sans" font-size="14.00">notfound</text>
<g id="node12" class="node"><title>notfound</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="561,-139 482,-139 482,-103 561,-103 561,-139"/>
<text text-anchor="middle" x="521.5" y="-117.3" font-family="Sans" font-size="14.00">notfound</text>
</g>
<!-- getdata&#45;&gt;notfound -->
<g id="edge8" class="edge"><title>getdata&#45;&gt;notfound</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-128.568C416.275,-118.785 453.873,-105.155 481.908,-94.991"/>
<g id="edge9" class="edge"><title>getdata&#45;&gt;notfound</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M389.292,-168.568C416.275,-158.785 453.873,-145.155 481.908,-134.991"/>
</g>
<!-- getheaders -->
<g id="node11" class="node"><title>getheaders</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="122,-259 28,-259 28,-223 122,-223 122,-259"/>
<text text-anchor="middle" x="75" y="-237.3" font-family="Sans" font-size="14.00">getheaders</text>
<g id="node13" class="node"><title>getheaders</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="122,-299 28,-299 28,-263 122,-263 122,-299"/>
<text text-anchor="middle" x="75" y="-277.3" font-family="Sans" font-size="14.00">getheaders</text>
</g>
<!-- headers -->
<g id="node12" class="node"><title>headers</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="557,-259 486,-259 486,-223 557,-223 557,-259"/>
<text text-anchor="middle" x="521.5" y="-237.3" font-family="Sans" font-size="14.00">headers</text>
<g id="node14" class="node"><title>headers</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="557,-299 486,-299 486,-263 557,-263 557,-299"/>
<text text-anchor="middle" x="521.5" y="-277.3" font-family="Sans" font-size="14.00">headers</text>
</g>
<!-- getheaders&#45;&gt;headers -->
<g id="edge9" class="edge"><title>getheaders&#45;&gt;headers</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M122.361,-241C212.248,-241 405.736,-241 485.746,-241"/>
<g id="edge10" class="edge"><title>getheaders&#45;&gt;headers</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M122.361,-281C212.248,-281 405.736,-281 485.746,-281"/>
</g>
<!-- label1 -->
<g id="node13" class="node"><title>label1</title>
<text text-anchor="middle" x="75" y="-285.8" font-family="Sans" font-size="14.00">Request For Help</text>
<text text-anchor="middle" x="75" y="-270.8" font-family="Sans" font-size="14.00">Getting Up To Date</text>
<g id="node15" class="node"><title>label1</title>
<text text-anchor="middle" x="75" y="-325.8" font-family="Sans" font-size="14.00">Request For Help</text>
<text text-anchor="middle" x="75" y="-310.8" font-family="Sans" font-size="14.00">Getting Up To Date</text>
</g>
<!-- label2 -->
<g id="node14" class="node"><title>label2</title>
<text text-anchor="middle" x="204" y="-285.8" font-family="Sans" font-size="14.00">Reply With</text>
<text text-anchor="middle" x="204" y="-270.8" font-family="Sans" font-size="14.00">Inventory</text>
<g id="node16" class="node"><title>label2</title>
<text text-anchor="middle" x="204" y="-325.8" font-family="Sans" font-size="14.00">Reply With</text>
<text text-anchor="middle" x="204" y="-310.8" font-family="Sans" font-size="14.00">Inventory</text>
</g>
<!-- label1&#45;&gt;label2 -->
<!-- label3 -->
<g id="node15" class="node"><title>label3</title>
<text text-anchor="middle" x="354" y="-278.3" font-family="Sans" font-size="14.00">Request For Specific Data</text>
<g id="node17" class="node"><title>label3</title>
<text text-anchor="middle" x="354" y="-318.3" font-family="Sans" font-size="14.00">Request For Specific Data</text>
</g>
<!-- label2&#45;&gt;label3 -->
<!-- label4 -->
<g id="node16" class="node"><title>label4</title>
<text text-anchor="middle" x="521.5" y="-285.8" font-family="Sans" font-size="14.00">Reply With</text>
<text text-anchor="middle" x="521.5" y="-270.8" font-family="Sans" font-size="14.00">Requested Data</text>
<g id="node18" class="node"><title>label4</title>
<text text-anchor="middle" x="521.5" y="-325.8" font-family="Sans" font-size="14.00">Reply With</text>
<text text-anchor="middle" x="521.5" y="-310.8" font-family="Sans" font-size="14.00">Requested Data</text>
</g>
<!-- label3&#45;&gt;label4 -->
</g>

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Before After
Before After