Skip to content

Commit 8173232

Browse files
Merge #7079: chore: enforce ban for re-propagation of stale QFCOMMITs
8e44990 chore!: enforce ban for re-propagation of stale `QFCOMMIT`s (Kittywhiskers Van Gogh) Pull request description: ## Additional Information Spun off from [dash#7066](#7066) due to breaking change, enforces policy introduced in [dash#5145](#5145). ## Breaking changes Broadcasting stale `QFCOMMIT`s will result in the offending node getting banned. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 8e44990; since this is protocol version guarded; not a breaking change. UdjinM6: utACK 8e44990 Tree-SHA512: 659e43fba896ac3046dfc7aa197ab0a2207e1648488fdcd545902a90d4efa4f25d74f4a92b99eb2e68cf96b30a78a99114d9487c1abf0b8954dc7a585131d88b
2 parents e9321d2 + 8e44990 commit 8173232

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/llmq/blockprocessor.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ MessageProcessingResult CQuorumBlockProcessor::ProcessMessage(const CNode& peer,
131131
if (pQuorumBaseBlockIndex->nHeight < (m_chainstate.m_chain.Height() - llmq_params_opt->dkgInterval)) {
132132
LogPrint(BCLog::LLMQ, "CQuorumBlockProcessor::%s -- block %s is too old, peer=%d\n", __func__,
133133
qc.quorumHash.ToString(), peer.GetId());
134-
// TODO: enable punishment in some future version when all/most nodes are running with this fix
135-
// ret.m_error = MisbehavingError{100};
134+
if (peer.GetCommonVersion() >= QFCOMMIT_STALE_REPROP_BAN_VERSION) {
135+
ret.m_error = MisbehavingError{100};
136+
}
136137
return ret;
137138
}
138139
if (HasMinedCommitment(type, qc.quorumHash)) {

src/version.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
* network protocol versioning
1111
*/
1212

13-
14-
static const int PROTOCOL_VERSION = 70238;
13+
static const int PROTOCOL_VERSION = 70239;
1514

1615
//! initial proto version, to be increased after version/verack negotiation
1716
static const int INIT_PROTO_VERSION = 209;
@@ -52,13 +51,15 @@ static const int INCREASE_MAX_HEADERS2_VERSION = 70235;
5251
//! Behavior of QRINFO is changed in this protocol version
5352
static const int EFFICIENT_QRINFO_VERSION = 70236;
5453

55-
5654
//! cycleHash in isdlock message switched to using quorum's base block in this version
5755
static const int ISDLOCK_CYCLEHASH_UPDATE_VERSION = 70237;
5856

5957
//! Introduced new p2p message platform pose BAN
6058
static const int PLATFORM_BAN_VERSION = 70238;
6159

60+
//! Ban of re-propagation of old QFCOMMIT enforcement
61+
static const int QFCOMMIT_STALE_REPROP_BAN_VERSION = 70239;
62+
6263
// Make sure that none of the values above collide with `ADDRV2_FORMAT`.
6364

6465
#endif // BITCOIN_VERSION_H

0 commit comments

Comments
 (0)