Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
git log --oneline ${COMMIT_RANGE} || echo "Could not show commit range"

./ci/dash/lint.sh
test/lint/cppcheck-dash.py
du -sh "${CACHE_DIR}/cppcheck"
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion doc/man/dash-cli.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-CLI "1" "October 2026" "dash-cli v24.0.0" "User Commands"
.TH DASH-CLI "1" "November 2026" "dash-cli v24.0.0" "User Commands"
.SH NAME
dash-cli \- manual page for dash-cli v24.0.0
.SH SYNOPSIS
Expand Down
31 changes: 16 additions & 15 deletions doc/man/dash-qt.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-QT "1" "October 2026" "dash-qt v24.0.0" "User Commands"
.TH DASH-QT "1" "November 2026" "dash-qt v24.0.0" "User Commands"
.SH NAME
dash-qt \- manual page for dash-qt v24.0.0
.SH SYNOPSIS
Expand Down Expand Up @@ -30,9 +30,9 @@ datadir as a warning, not an error.
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
00000000000000119fe42827219e0686d3f7b494ae65f823194c740c5dbab492,
000000000000000346a1804da4832b0b69dd9a7f96b14c7cb54585a9ac6ae98f,
testnet:
000000541a23f9db7411cddbe50f9f1ebd4aa7108ebdcad62214753f648c0239,
000000116cd3c11d44c88cbc0a26804bd277a5d790f684ec3a8aaa820690318c,
devnet:
0000000000000000000000000000000000000000000000000000000000000000)
.HP
Expand Down Expand Up @@ -60,10 +60,10 @@ Specify directory to hold blocks subdirectory for *.dat files (default:
.HP
\fB\-blocksonly\fR
.IP
Whether to reject transactions from network peers. Automatic broadcast
and rebroadcast of any transactions from inbound peers is
disabled, unless the peer has the 'forcerelay' permission. RPC
transactions are not affected. (default: 0)
Whether to reject transactions from network peers. Disables automatic
broadcast and rebroadcast of transactions, unless the source peer
has the 'forcerelay' permission. RPC transactions are not
affected. (default: 0)
.HP
\fB\-chainlocknotify=\fR<cmd>
.IP
Expand Down Expand Up @@ -426,10 +426,11 @@ download,noban,mempool,relay). Can be specified multiple times.
.HP
\fB\-whitelist=\fR<[permissions@]IP address or network>
.IP
Add permission flags to the peers connecting from the given IP address
(e.g. 1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses
the same permissions as \fB\-whitebind\fR. Can be specified multiple
times.
Add permission flags to the peers using the given IP address (e.g.
1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses the same
permissions as \fB\-whitebind\fR. Additional flags "in" and "out"
control whether permissions apply to incoming connections and/or
manual (default: incoming only). Can be specified multiple times.
.PP
Indexing options:
.HP
Expand Down Expand Up @@ -1059,15 +1060,15 @@ Relay non\-P2SH multisig (default: 1)
.HP
\fB\-whitelistforcerelay\fR
.IP
Add 'forcerelay' permission to whitelisted inbound peers with default
Add 'forcerelay' permission to whitelisted peers with default
permissions. This will relay transactions even if the
transactions were already in the mempool. (default: 0)
.HP
\fB\-whitelistrelay\fR
.IP
Add 'relay' permission to whitelisted inbound peers with default
permissions. This will accept relayed transactions even when not
relaying transactions (default: 1)
Add 'relay' permission to whitelisted peers with default permissions.
This will accept relayed transactions even when not relaying
transactions (default: 1)
.PP
Block creation options:
.HP
Expand Down
2 changes: 1 addition & 1 deletion doc/man/dash-tx.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-TX "1" "October 2026" "dash-tx v24.0.0" "User Commands"
.TH DASH-TX "1" "November 2026" "dash-tx v24.0.0" "User Commands"
.SH NAME
dash-tx \- manual page for dash-tx v24.0.0
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/man/dash-util.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-UTIL "1" "October 2026" "dash-util v24.0.0" "User Commands"
.TH DASH-UTIL "1" "November 2026" "dash-util v24.0.0" "User Commands"
.SH NAME
dash-util \- manual page for dash-util v24.0.0
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/man/dash-wallet.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASH-WALLET "1" "October 2026" "dash-wallet v24.0.0" "User Commands"
.TH DASH-WALLET "1" "November 2026" "dash-wallet v24.0.0" "User Commands"
.SH NAME
dash-wallet \- manual page for dash-wallet v24.0.0
.SH DESCRIPTION
Expand Down
31 changes: 16 additions & 15 deletions doc/man/dashd.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH DASHD "1" "October 2026" "dashd v24.0.0" "User Commands"
.TH DASHD "1" "November 2026" "dashd v24.0.0" "User Commands"
.SH NAME
dashd \- manual page for dashd v24.0.0
.SH SYNOPSIS
Expand Down Expand Up @@ -28,9 +28,9 @@ datadir as a warning, not an error.
If this block is in the chain assume that it and its ancestors are valid
and potentially skip their script verification (0 to verify all,
default:
00000000000000119fe42827219e0686d3f7b494ae65f823194c740c5dbab492,
000000000000000346a1804da4832b0b69dd9a7f96b14c7cb54585a9ac6ae98f,
testnet:
000000541a23f9db7411cddbe50f9f1ebd4aa7108ebdcad62214753f648c0239,
000000116cd3c11d44c88cbc0a26804bd277a5d790f684ec3a8aaa820690318c,
devnet:
0000000000000000000000000000000000000000000000000000000000000000)
.HP
Expand Down Expand Up @@ -58,10 +58,10 @@ Specify directory to hold blocks subdirectory for *.dat files (default:
.HP
\fB\-blocksonly\fR
.IP
Whether to reject transactions from network peers. Automatic broadcast
and rebroadcast of any transactions from inbound peers is
disabled, unless the peer has the 'forcerelay' permission. RPC
transactions are not affected. (default: 0)
Whether to reject transactions from network peers. Disables automatic
broadcast and rebroadcast of transactions, unless the source peer
has the 'forcerelay' permission. RPC transactions are not
affected. (default: 0)
.HP
\fB\-chainlocknotify=\fR<cmd>
.IP
Expand Down Expand Up @@ -424,10 +424,11 @@ download,noban,mempool,relay). Can be specified multiple times.
.HP
\fB\-whitelist=\fR<[permissions@]IP address or network>
.IP
Add permission flags to the peers connecting from the given IP address
(e.g. 1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses
the same permissions as \fB\-whitebind\fR. Can be specified multiple
times.
Add permission flags to the peers using the given IP address (e.g.
1.2.3.4) or CIDR\-notated network (e.g. 1.2.3.0/24). Uses the same
permissions as \fB\-whitebind\fR. Additional flags "in" and "out"
control whether permissions apply to incoming connections and/or
manual (default: incoming only). Can be specified multiple times.
.PP
Indexing options:
.HP
Expand Down Expand Up @@ -1057,15 +1058,15 @@ Relay non\-P2SH multisig (default: 1)
.HP
\fB\-whitelistforcerelay\fR
.IP
Add 'forcerelay' permission to whitelisted inbound peers with default
Add 'forcerelay' permission to whitelisted peers with default
permissions. This will relay transactions even if the
transactions were already in the mempool. (default: 0)
.HP
\fB\-whitelistrelay\fR
.IP
Add 'relay' permission to whitelisted inbound peers with default
permissions. This will accept relayed transactions even when not
relaying transactions (default: 1)
Add 'relay' permission to whitelisted peers with default permissions.
This will accept relayed transactions even when not relaying
transactions (default: 1)
.PP
Block creation options:
.HP
Expand Down
16 changes: 16 additions & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@ does not accept that option. (#7294, #7285, #7577)
participant's coins. Because admission relies on the declared directions, a
participant whose entry deviates from what it declared has its collateral
consumed. (#7052)
- A wallet that still has coins to mix keeps standard mixing. It joins
promotion and demotion queues that other wallets opened, but only opens its
own when it has no standard mixing session to join or start, so a conversion
waiting for a counterpart never holds up mixing. (#7995)
- A promotion prefers fully-mixed coins from different mixing transactions. If
there are not enough of those, it also spends coins that came out of the same
mixing transaction, which links them as one owner's coins, as an ordinary send
of the same coins would. (#7996)

See [P2P and network changes](#p2p-and-network-changes) for the related
protocol changes.
Expand Down Expand Up @@ -688,6 +696,11 @@ and RPC parameters.
starts without sporks (for example after the `sporks.dat` reset) receives
them. Repeated `getsporks` requests are ignored while the active spork set is
unchanged. (#7893, #7343)
- Address-based `-whitelist` permissions no longer apply to peers that connect
through the node's onion service. Tor forwards those peers from its own
address, usually `127.0.0.1`, so an entry such as `-whitelist=noban@127.0.0.1`
used to grant its permissions to every Tor peer. `-whitebind` is not
affected. (#8005)

## Mining and mempool policy

Expand Down Expand Up @@ -921,6 +934,9 @@ and RPC parameters.

- `-sporkaddr` now configures a single spork address. Previously it could be
specified multiple times to configure a set of valid spork signers. (#7505)
- Additional flags "in" and "out" have been added to `-whitelist` to control
whether permissions apply to incoming connections and/or manual (default:
incoming only). (#8005)

### Removed options

Expand Down
83 changes: 33 additions & 50 deletions src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,8 +993,11 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman
const bool fV24Active = CoinJoin::IsPromotionDemotionActive(chainman);

CAmount nBalanceNeedsAnonymized;
wallet::CoinJoinDenomCounts denomCounts;
bool fRebalanceOpportunity{false};
struct Rebalance {
int nDenom; //!< session denomination: the smaller of the two, which both conversions run at
bool fPromotion;
};
std::vector<Rebalance> vecRebalances; // post-V24 promotion/demotion opportunities

{
LOCK(m_wallet->cs_wallet);
Expand Down Expand Up @@ -1034,14 +1037,28 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman
if (fV24Active) {
// Single wallet scan covering all denominations, reused across every
// adjacent-pair check instead of re-scanning per pair.
denomCounts = m_wallet->GetDenominationCounts();
for (size_t i = 0; i + 1 < CoinJoin::vecStandardDenominations.size() && !fRebalanceOpportunity; ++i) {
const auto denomCounts = m_wallet->GetDenominationCounts();
// Denominations: 10, 1, 0.1, 0.01, 0.001 (indices 0-4, smaller index = larger denom)
for (size_t i = 0; i + 1 < CoinJoin::vecStandardDenominations.size(); ++i) {
const int nLargerDenom = 1 << i;
const int nSmallerDenom = 1 << (i + 1);
fRebalanceOpportunity = m_clientman.ShouldPromote(nSmallerDenom, nLargerDenom, denomCounts) ||
m_clientman.ShouldDemote(nLargerDenom, nSmallerDenom, denomCounts);
if (m_clientman.ShouldPromote(nSmallerDenom, nLargerDenom, denomCounts)) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- Promotion opportunity: %d x %s -> 1 x %s\n",
CoinJoin::PROMOTION_RATIO,
CoinJoin::DenominationToString(nSmallerDenom),
CoinJoin::DenominationToString(nLargerDenom));
vecRebalances.push_back({nSmallerDenom, /*fPromotion=*/true});
}
if (m_clientman.ShouldDemote(nLargerDenom, nSmallerDenom, denomCounts)) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- Demotion opportunity: 1 x %s -> %d x %s\n",
CoinJoin::DenominationToString(nLargerDenom),
CoinJoin::PROMOTION_RATIO,
CoinJoin::DenominationToString(nSmallerDenom));
vecRebalances.push_back({nSmallerDenom, /*fPromotion=*/false});
}
}
}
const bool fRebalanceOpportunity{!vecRebalances.empty()};

if (nBalanceNeedsAnonymized < 0 && !fRebalanceOpportunity) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- Nothing to do\n");
Expand Down Expand Up @@ -1166,50 +1183,12 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman
}
} // LOCK(m_wallet->cs_wallet);

// Post-V24: Check if we should promote or demote denominations
// This helps maintain optimal denomination distribution as coins are spent
if (fRebalanceOpportunity) {
// Check all adjacent denomination pairs for promotion/demotion opportunities
// Denominations: 10, 1, 0.1, 0.01, 0.001 (indices 0-4, smaller index = larger denom)
for (size_t i = 0; i + 1 < CoinJoin::vecStandardDenominations.size(); ++i) {
const int nLargerDenom = 1 << i; // Larger denomination (e.g., 10 DASH)
const int nSmallerDenom = 1 << (i + 1); // Smaller denomination (e.g., 1 DASH)

// Check if we should promote smaller -> larger; ShouldPromote() requires
// PROMOTION_RATIO fully-mixed coins, the queue functions re-verify on selection
if (m_clientman.ShouldPromote(nSmallerDenom, nLargerDenom, denomCounts)) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- Promotion opportunity: %d x %s -> 1 x %s\n",
CoinJoin::PROMOTION_RATIO,
CoinJoin::DenominationToString(nSmallerDenom),
CoinJoin::DenominationToString(nLargerDenom));

// Try to join an existing queue for promotion
if (JoinExistingQueue(nBalanceNeedsAnonymized, connman, nSmallerDenom, /*fPromotion=*/true)) {
return true;
}
// No existing queue found - try to start a new one for promotion
if (StartNewQueue(nBalanceNeedsAnonymized, connman, nSmallerDenom, /*fPromotion=*/true, /*fDemotion=*/false)) {
return true;
}
}

// Check if we should demote larger -> smaller
if (m_clientman.ShouldDemote(nLargerDenom, nSmallerDenom, denomCounts)) {
WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::DoAutomaticDenominating -- Demotion opportunity: 1 x %s -> %d x %s\n",
CoinJoin::DenominationToString(nLargerDenom),
CoinJoin::PROMOTION_RATIO,
CoinJoin::DenominationToString(nSmallerDenom));

// Try to join an existing queue for demotion
if (JoinExistingQueue(nBalanceNeedsAnonymized, connman, nSmallerDenom, /*fPromotion=*/false, /*fDemotion=*/true)) {
return true;
}
// No existing queue found - try to start a new one for demotion
if (StartNewQueue(nBalanceNeedsAnonymized, connman, nSmallerDenom, /*fPromotion=*/false, /*fDemotion=*/true)) {
return true;
}
}
}
// Post-V24: joining an existing queue at a conversion's denomination is cheap, but a new
// promotion/demotion queue has to wait for participants that may never come (pre-rebalance
// clients can't join it). Only start one when there is no standard mixing to do, or a lasting
// rebalance opportunity would keep the wallet from ever mixing again.
for (const auto& [nDenom, fPromotion] : vecRebalances) {
if (JoinExistingQueue(nBalanceNeedsAnonymized, connman, nDenom, fPromotion, !fPromotion)) return true;
}

// Standard mixing only makes sense while there is still balance to anonymize; a
Expand All @@ -1224,6 +1203,10 @@ bool CCoinJoinClientSession::DoAutomaticDenominating(ChainstateManager& chainman
if (StartNewQueue(nBalanceNeedsAnonymized, connman)) return true;
}

for (const auto& [nDenom, fPromotion] : vecRebalances) {
if (StartNewQueue(nBalanceNeedsAnonymized, connman, nDenom, fPromotion, !fPromotion)) return true;
}

strAutoDenomResult = _("No compatible Masternode found.");
return false;
}
Expand Down
Loading
Loading