Governance updates

- More clarification on govsync (guide and reference)
This commit is contained in:
thephez 2017-10-18 13:38:53 -04:00
parent 96919848df
commit e1b3e3a2c2
2 changed files with 28 additions and 9 deletions

View file

@ -637,8 +637,26 @@ last stage of the Masternode sync process (following the sync of sporks, the
Masternode list, and Masternode payments).
The `govsync` message initiates a sync of the governance system. Masternodes
ignore this request if they are not fully synced. Otherwise, they respond to
the `govsync` message with several items:
ignore this request if they are not fully synced.
There are two distinct stages of governance sync:
1. Initial request (object sync) - requests the governance objects only via a
`govsync` message sent with a hash of all zeros.
2. Follow up request(s) (vote sync) - request governance object votes for a
specific object via a `govsync` message containing the hash of the object. One
message is required for each object. Dash Core periodically (~ every 6 seconds)
sends messages to connected nodes until all the governance objects have been
synchronized.
{% highlight text %}
Dash Core limits how frequently the first type of sync (object sync) can be
requested. Frequent requests will result in the node being banned.
{% endhighlight %}
Masternodes respond to the `govsync` message with several items:
* First, the Masternode sends one `ssc` message (Sync Status Count) for `govobj`
objects and one for `govobjvote` objects. These messages indicate how many
@ -648,10 +666,8 @@ inventory items will be sent.
objects.
Once the syncing node receives the counts and inventories, it may request any
`govobj` and `govobjvote` objects from the Masternode via a `getdata` message.
`govobj` and `govobjvote` objects from the masternode via a `getdata` message.
Dash Core periodically (~ every 6 seconds) sends `govsync` messages to connected
nodes until all the governance objects have been synchronized.
*Governance Sync Data Flow*

View file

@ -2407,13 +2407,13 @@ request if they are not fully synced.
This message responds in one of two ways depending on the request:
1. When a masternode receives a `govsync` message with a hash of all zeros, it
1. Object Sync - When a masternode receives a `govsync` message with a hash of all zeros, it
responds with one `ssc` message for `govobj` objects and one for `govobjvote`
objects. The masternode also sends an `inv` message (MSG_GOVERNANCE_OBJECT - 0x17)
for all valid `govobj` governance objects.
*Governance object votes are excluded in this type of response.*
2. When a masternode receives a `govsync` message with a specific hash, it
2. Vote Sync - When a masternode receives a `govsync` message with a specific hash, it
responds with one `ssc` message for `govobj` objects and one for `govobjvote`
objects. The masternode also sends both a `govobj` inventory message
(MSG_GOVERNANCE_OBJECT - 0x17) and `govobjvote` inventory messages
@ -2422,9 +2422,12 @@ objects. The masternode also sends both a `govobj` inventory message
| Bytes | Name | Data type | Required | Description |
| ---------- | ----------- | --------- | -------- | -------- |
| 32 | nHash | uint256 | Required | Hash of governance object to request<br>Set to all zeros to request all objects (excludes votes)
| # | filter | CBloomFiter | Required | Only supported since [protocol version 70206][section protocol versions]
| # | filter | CBloomFiter | Required | Can be set to all zeros.<br>Only supported since [protocol version 70206][section protocol versions]
Note: Both the hash and bloom filter fields can be set to all zeros.
{% highlight text %}
Dash Core limits how frequently the first type of sync (object sync) can be
requested. Frequent requests will result in the node being banned.
{% endhighlight %}
The following annotated hexdump shows a `govsync` message. (The
message header has been omitted.)