Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/core/guide/p2p-network-connecting-to-peers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Connecting to a [peer](../resources/glossary.md#peer) is done by sending a [`ver

Once connected, the client can send to the remote node `getaddr` and [`addr` messages](../reference/p2p-network-control-messages.md#addr) to gather additional peers.

In order to maintain a connection with a peer, nodes by default will send a message to peers before 30 minutes of inactivity. If 90 minutes pass without a message being received by a peer, the client will assume that connection has closed.
In order to maintain a connection with a peer, nodes by default will send a [`ping` message](../reference/p2p-network-control-messages.md#ping) to peers every 2 minutes. If no data is sent to a peer for 20 minutes, no data is received from it for 20 minutes, or a `ping` message goes unanswered for 20 minutes, the client will assume that connection has closed. A peer is also disconnected if its send buffer stays full (sending paused) for 20 minutes.
Comment thread
thephez marked this conversation as resolved.
Resolved
43 changes: 37 additions & 6 deletions docs/core/guide/p2p-network-misbehaving-nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,71 @@ Furthermore, a few additional changes are introduced to how discouraged addresse
| Net | Inventory List | 20 | More than `MAX_INV_SZ` (50000) inventories received (`inv` message)
| Net | Get Data Size | 20 | More than `MAX_INV_SZ` (50000) inventories requested (`getdata` message)
| Net | Orphan Transaction | **Varies** | Peer relayed an invalid orphan transaction. Ban score varies from 0-100 based on the specific reason (values set by `AcceptToMemoryPoolWorker()`)
| Net | Bad Transaction | **Varies** | Transaction rejected from the mempool
| Net | Bad Transaction | **Varies** | Transaction rejected from the mempool. Consensus failures score 100, including transactions that fail the DERSIG, NULLDUMMY, CHECKLOCKTIMEVERIFY, or CHECKSEQUENCEVERIFY script checks
| Net | Invalid Header | **Varies** | Invalid block header received from peer (`cmpctblock` message)
| Net | Invalid CompactBlock | **100** | Invalid compact block /non-matching block transactions received from peer (`cmpctblock` message)
| Net | Repeated Block Transactions | **100** | Peer sent block transactions for a compact block whose previous reconstruction attempt failed ([`blocktxn` message](../reference/p2p-network-data-messages.md#blocktxn))
| Net | Mutated Block | **100** | Peer relayed a mutated block (merkle root mismatch or 64-byte transaction malleation) ([`block` message](../reference/p2p-network-data-messages.md#block))
| Net | Header List Size | 20 | More than `MAX_HEADERS_RESULTS` (2000) headers received (`headers` message)
| Net | Header List Sequence | 20 | Non-continous headers sequence received (`headers` message)
| Net | Invalid Block | **Varies** | Invalid block header received from peer
| Net | Bloom Filter Size | **100** | Maximum script element size (520) exceeded (`filterload` message or [`filteradd` message](../reference/p2p-network-control-messages.md#filteradd))
| Net | MN List Diff | 1 | Failed to get masternode list diff (`getmnlistd` message)
| Net | Bloom Filter Size | **100** | Malformed or oversized bloom filter: more than 36,000 bytes or 50 hash functions ([`filterload` message](../reference/p2p-network-control-messages.md#filterload)), or a data element exceeding the maximum script element size (520) ([`filteradd` message](../reference/p2p-network-control-messages.md#filteradd))
| Net | Not Found List Size | 20 | More than `MAX_INV_SZ` (50000) entries received ([`notfound` message](../reference/p2p-network-data-messages.md#notfound))
| Net | MN List Diff | 1 | Failed to get masternode list diff (`getmnlistd` message). Not applied when the failure is caused by block data this node does not have (pruned or below an unvalidated snapshot base)
| Net | Unrequested MN List Diff | **100** | Peer provided an unrequested masternode list diff (`mnlistdiff` message)
| Net | Quorum Rotation Info | 1 | Failed to get quorum rotation info ([`getqrinfo` message](../reference/p2p-network-data-messages.md#getqrinfo)). Not applied when the failure is caused by block data this node does not have (pruned or below an unvalidated snapshot base)
| Net | Malformed Quorum Rotation Info Request | **100** | Peer relayed a malformed request, including one with more than 4096 base block hashes (`getqrinfo` message)
| Net | Unrequested Quorum Rotation Info | **100** | Peer provided unrequested quorum rotation info ([`qrinfo` message](../reference/p2p-network-data-messages.md#qrinfo))
| InstantSend | Invalid Lock Message | **100** | Invalid TXID or inputs in lock message (`isdlock` message)
| InstantSend | Verify Error | 20 | Peer relayed a message that failed to verify
| LLMQ ChainLock | Invalid | 10 | Invalid ChainLock message (`clsig` message)
| LLMQ ChainLock | Unrequested | 10 | Peer sent a ChainLock that was not requested from it ([`clsig` message](../reference/p2p-network-instantsend-messages.md#clsig))
| LLMQ Commitment | Unrequested | 10 | Peer sent a final commitment that was not requested from it ([`qfcommit` message](../reference/p2p-network-quorum-messages.md#qfcommit))
| LLMQ Commitment | Stale Commitment | **100** | Peer with protocol version 70239 or higher relayed a commitment for a quorum more than one DKG interval old (`qfcommit` message)
| LLMQ Commitment | Null QcTx | **100** | Peer relayed a block with a null commitment
| LLMQ Commitment | Invalid LLMQ Type | **100** | Peer relayed a block containing an invalid LLMQ Type
| LLMQ Commitment | Invalid Height | **100** | Peer relayed a block that is not the first block in the DKG interval
| LLMQ Commitment | Invalid Commitment | **100** | Peer relayed a block with an invalid quorum commitment
| LLMQ DKG | Empty Message | **100** | Peer relayed a message with no payload
| LLMQ DKG | Unrequested | 10 | Peer sent a DKG message that was not requested from it (e.g. [`qcontrib` message](../reference/p2p-network-quorum-messages.md#qcontrib))
| LLMQ DKG | Unverified Peer | 10 | Peer that is not a verified masternode relayed a DKG message
| LLMQ DKG | Empty Message | **100** | Peer relayed a message too short to contain the LLMQ type and quorum hash
| LLMQ DKG | Invalid LLMQ Type | **100** | Peer relayed a message for an incorrect LLMQ Type
| LLMQ DKG | Invalid Message | **100** | Peer relayed a message that could not be deserialized
| LLMQ DKG | Invalid Quorum Hash | **100** | Peer relayed a message whose quorum hash is a block with no parent block or is not a valid quorum base block
| LLMQ DKG | Invalid Message | **100** | Peer relayed a message that was oversized, malformed, or could not be deserialized
| LLMQ DKG | Preverify Failed | **100** | Peer relayed a message that could not be pre-verified
| LLMQ DKG | Signature | **100** | Peer relayed a message with an invalid signature
| LLMQ DKG | Full Verify Failed | **100** | Peer relayed a message that failed full verification
| LLMQ Signing | Too Many Messages | **100** | Maximum message count exceed in [`qsigsesann` message](../reference/p2p-network-quorum-messages.md#qsigsesann), [`qsigsinv` message](../reference/p2p-network-quorum-messages.md#qsigsinv), [`qgetsigs` message](../reference/p2p-network-quorum-messages.md#qgetsigs), or [`qbsigs` message](../reference/p2p-network-quorum-messages.md#qbsigs)
| LLMQ Signing | Signature | **100** | Peer relayed a message with an invalid recovered signature or signature share
| LLMQ Quorum Data | Unauthorized Request | 10 | Request received by a node that is not a masternode, or from a peer that is neither a verified masternode nor a `qwatch` connection ([`qgetdata` message](../reference/p2p-network-quorum-messages.md#qgetdata))
| LLMQ Quorum Data | Oversized Request | **100** | Request payload larger than a valid request (`qgetdata` message)
| LLMQ Quorum Data | Invalid LLMQ Type | **100** | Request for an unknown LLMQ type (`qgetdata` message)
| LLMQ Quorum Data | Too Many Requests | 25 | More than 64 requests from one masternode within about 5 minutes, or a repeated request for the same quorum within 5 minutes unless a requested quorum verification vector is missing (`qgetdata` message)
Comment thread
thephez marked this conversation as resolved.
Resolved
| LLMQ Quorum Data | Unauthorized Response | 10 | Response from a peer that is not a verified masternode, or received by a node that is neither a masternode nor watching quorums ([`qdata` message](../reference/p2p-network-quorum-messages.md#qdata))
| LLMQ Quorum Data | Unrequested Response | 10 | Response that was not requested, was already received, or does not match the request (`qdata` message)
| LLMQ Quorum Data | Invalid Data Size | **100** | Verification vector or encrypted contributions with the wrong number of entries (`qdata` message)
| LLMQ Quorum Data | Invalid Data | 10 | Invalid verification vector, contribution share, or resulting secret key share (`qdata` message)
| Masternode Authentication | Duplicate Message | **100** | Only 1 message allowed (`mnauth` message)
| Masternode Authentication | Invalid Services | **100** | Peer not advertising `NODE_NETWORK` or `NODE_BLOOM` services (`mnauth` message)
| Masternode Authentication | Empty Hash | **100** | Peer relayed a message with a null ProRegTx hash (`mnauth` message)
| Masternode Authentication | Signature | **100** | Peer relayed a message with an invalid signature (`mnauth` message)
| Masternode Authentication | Invalid MN | 10 | Peer not in the valid masternode list (`mnauth` message)
| Masternode Authentication | Invalid Signature | 10 | Signature verification failed (`mnauth` message)
| Governance | Sync | 20 | Requesting a governance sync too frequently (`govsync` message with empty hash)
| Governance | Sync | 20 | Requesting a governance sync too frequently (`govsync` message with empty hash), or repeatedly requesting votes for the same governance object that this node can sync (`govsync` message with an object hash and non-empty bloom filter)
| Governance | Invalid Sync Filter | **100** | Malformed or oversized bloom filter ([`govsync` message](../reference/p2p-network-governance-messages.md#govsync))
| Governance | Malformed Vote | **100** | Malformed vote, including a signature that is not 65 or 96 bytes ([`govobjvote` message](../reference/p2p-network-governance-messages.md#govobjvote))
| Governance | Invalid Object | 20 | Peer relayed an invalid governance object (`govobj` message)
| Governance | Invalid Vote | 20 | Peer relayed an invalid/invalid old vote(`govobjvote` message)
| Governance | Unsupported Vote Signal | 20 | Vote signal outside the accepted range (see [`govobjvote` message](../reference/p2p-network-governance-messages.md#govobjvote))
| CoinJoin | Signature | 10 | Peer relayed a message with an invalid signature (`dsq` message)
| CoinJoin | Invalid DSTX | 10 | Peer relayed a CoinJoin broadcast transaction with an invalid structure or signature ([`dstx` message](../reference/p2p-network-privatesend-messages.md#dstx))
| CoinJoin | Unverifiable DSTX | 1 | Peer relayed a CoinJoin broadcast transaction from an unknown masternode, or one that is only valid under rules activating at the next block (`dstx` message)
| Spork | Invalid Time | **100** | Peer relayed a spork with a timestamp too far in the future (`spork` message)
| Spork | Signature | **100** | Peer relayed a spork with an invalid signature (`spork` message)
| Spork | Malformed | **100** | Peer relayed a spork that could not be deserialized ([`spork` message](../reference/p2p-network-control-messages.md#spork))
| Platform | Unknown Masternode | 1 | Ban message references a ProTx hash not in the masternode list ([`platformban` message](../reference/p2p-network-masternode-messages.md#platformban))
| Platform | Invalid Node Type | **100** | Ban message references a masternode that is not an evonode (`platformban` message)
| Platform | Invalid Height | 1 | Requested height is up to 5 blocks outside the accepted range (576 blocks below the chain tip through the tip) (`platformban` message)
| Platform | Invalid Height | 10 | Requested height is more than 5 blocks outside the accepted range (`platformban` message)
| Platform | Unknown Quorum | **100** | Ban message references an unknown Platform quorum (`platformban` message)
| Platform | Signature | **100** | Ban message has an invalid quorum signature (`platformban` message)
4 changes: 2 additions & 2 deletions docs/core/guide/p2p-network-peer-discovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Once a program has connected to the [network](../resources/glossary.md#network),

However, peers often leave the network or change IP addresses, so programs may need to make several different connection attempts at startup before a successful connection is made. This can add a significant delay to the amount of time it takes to connect to the network, forcing a user to wait before sending a transaction or checking the status of payment.

Dash Core tries to strike a balance between minimizing delays and avoiding unnecessary DNS seed use: if Dash Core has entries in its peer database, it spends up to 11 seconds attempting to connect to at least one of them before falling back to seeds; if a connection is made within that time, it does not query any seeds.
Dash Core tries to strike a balance between minimizing delays and avoiding unnecessary DNS seed use: if Dash Core has entries in its peer database, it spends up to 11 seconds (or up to 5 minutes if the database has 1000 or more entries) attempting to connect to them before falling back to seeds; if it has at least two full-relay outbound connections at any point during that time, it does not query any seeds.

## Hardcoded Masternode IPs

Dash Core also includes a hardcoded list of IP addresses and port numbers to several dozen nodes which were active around the time that particular version of the software was first released. Starting with Dash Core 0.12.3, [masternodes](../resources/glossary.md#masternode) are used for the seed list since they must remain online to receive their portion of the block reward (good availability) and must be compliant with [consensus rules](../resources/glossary.md#consensus-rules) (reliable). Dash Core will start attempting to connect to these nodes if none of the DNS seed servers have responded to a query within 60 seconds, providing an automatic fallback option.
Dash Core also includes a hardcoded list of IP addresses and port numbers to a few hundred nodes which were active around the time that particular version of the software was first released. Starting with Dash Core 0.12.3, [masternodes](../resources/glossary.md#masternode) are used for the seed list since they must remain online to receive their portion of the block reward (good availability) and must be compliant with [consensus rules](../resources/glossary.md#consensus-rules) (reliable). Dash Core will start attempting to connect to these nodes if none of the DNS seed servers have responded to a query within 60 seconds, providing an automatic fallback option.

As a manual fallback option, Dash Core also provides several command-line connection options, including the ability to get a list of peers from a specific node by IP address, or to make a persistent connection to a specific node by IP address. See the `-help` text for details.

Expand Down
4 changes: 4 additions & 0 deletions docs/core/guide/p2p-network-transaction-broadcasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

In order to send a [transaction](../resources/glossary.md#transaction) to a [peer](../resources/glossary.md#peer), an [`inv` message](../reference/p2p-network-data-messages.md#inv) is sent. If a [`getdata` message](../reference/p2p-network-data-messages.md#getdata) is received in reply, the transaction is sent using a [`tx` message](../reference/p2p-network-data-messages.md#tx). If it is a valid transaction, the peer receiving the transaction also forwards the transaction to its peers.

:::{note}
As of Dash Core 24.0.0, version 2 asset unlock transactions (valid once the v24 hard fork activates) are announced to peers with protocol version 70242 or higher using the `MSG_ASSET_UNLOCK` [inventory](../reference/p2p-network-data-messages.md#inv) type, which identifies the transaction by its instance hash instead of its TXID. This allows a re-signed asset unlock to propagate even if a transaction with the same TXID is already in the mempool.
:::

:::{note}
Dash Core 18.1.0 backported changes from Bitcoin to support block-only relay connections (specific connections that do not relay transaction information). This change was made to improve network topology and reduce information leaked by transaction relay. See the [Bitcoin pull request](https://github.com/bitcoin/bitcoin/pull/15759) for additional details.
:::
Expand Down
Loading