Dash Core

Dash Core Developer Documentation

Welcome to the Dash Core developer documentation. You'll find guides and documentation to help you start working with Dash Core as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

Masternode Sync

Dash Core performs full masternodemasternode - A computer that provides second-tier Dash functionality (InstantSend, PrivateSend, decentralized governance). Masternodes are incentivized by receiving part of the block reward, but must hold 1000 Dash as collateral to prevent sybil attacks. synchronization as required. There are several conditions that initiate a start/restart the sync process:

  • Initial startup of Dash Core
  • More than 60 minutes have passed since the last activation
  • A failure occurred during the last sync attempt (after a 1 minute cooldown before sync restarts)
  • Issuing a mnsync reset RPC command

Initial Masternode Sync

The deterministic masternode lists introduced by DIP3 eliminated several steps of the sync process related to the masternode list and masternode payments. Since that information is now available on-chain, P2P messages related to those steps were deprecated.

This diagram shows the order in which P2P messages are sent to perform masternode synchronization initially after startup.

Masternode Sync (Initial)Masternode Sync (Initial)

The following table details the data flow of P2P messages exchanged during initial masternode synchronization after the activation of DIP3 and SporkSpork - A spork is a mechanism unique to Dash used to safely deploy new features to the network through network-level variables to avoid the risk of unintended network forking during upgrades. 15.

Syncing Node MessageDirectionMasternode ResponseDescription
1. Sporks
getsporks messageSyncing node requests sporks
spork message(s)
2. Mempool
mempool messageSyncing node requests mempool entries
inv message(s)inv message(s) containing TXIDs of mempool transactions
3. GovernanceSee Governance sync

Masternode Sync Status

There are several status values used to track masternode synchronization. They are used in both ssc messages and the mnsync RPC.

ValueStatusDescription
-1MASTERNODE_SYNC_FAILED Removed in Dash Core 0.16.0
Synchronization failed
0MASTERNODE_SYNC_INITIAL Deprecated (merged with MASTERNODE_SYNC_WAITING in Dash Core 0.16.0)
Synchronization just started, was reset recently, or is still in IBD
1MASTERNODE_SYNC_BLOCKCHAIN (previously MASTERNODE_SYNC_WAITING)Renamed in Dash Core 0.16.0
Synchronization pending - waiting after initial to check for more headers/blocks.
4MASTERNODE_SYNC_GOVERNANCESynchronizing governance objects
999MASTERNODE_SYNC_FINISHEDSynchronization finished

Ongoing Masternode Sync

Once a masternode completes an initial full sync, continuing synchronization is maintained by the exchange of P2P messages with other nodesnodes - A computer that connects to the Dash network.. This diagram shows an overview of the messages exchanged to keep governance objects synchronized between masternodes.

Masternode Sync (Ongoing)Masternode Sync (Ongoing)

Governance

After the initial governance synchronization, governance information is kept current by the govobj messages and govobjvote messages relayed on the networknetwork - The Dash P2P network which broadcasts transactions and blocks.. Unsynchronized peerspeers - A computer that connects to the Dash network. may send govsync messages to request governance sync.

Masternode Sync Schedule

The following tables detail the timing of various functions used to keep the masternodes in sync with each other. This information is derived from the scheduler section of AppInitMain in src/init.cpp.

Period (seconds)ActionDescription
6MN SyncSynchronizes sporks and governance objects (masternode-sync.cpp)

The following actions only run when the masternode sync is past MASTERNODE_SYNC_WAITING status.

Period (seconds)ActionDescription
60Process MN ConnectionsDisconnects some masternodes (masternodeman.cpp)
60InstantSend Check/RemoveRemove expired/orphaned/invalid InstantSend candidates and votes (instantx.cpp)
300MaintenanceCheck/remove/reprocess governance objects (governance.cpp)

Updated 7 months ago


What's Next

Governance

Masternode Sync


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.