diff --git a/configure.ac b/configure.ac index d5d2b0651c14..3fb384760dd0 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.69]) dnl Don't forget to push a corresponding tag when updating any of _CLIENT_VERSION_* numbers define(_CLIENT_VERSION_MAJOR, 24) define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_BUILD, 1) +define(_CLIENT_VERSION_BUILD, 2) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2026) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/contrib/flatpak/org.dash.dash-core.metainfo.xml b/contrib/flatpak/org.dash.dash-core.metainfo.xml index 4ac5f311efbf..d329859ad191 100644 --- a/contrib/flatpak/org.dash.dash-core.metainfo.xml +++ b/contrib/flatpak/org.dash.dash-core.metainfo.xml @@ -21,6 +21,7 @@ + diff --git a/doc/man/dash-cli.1 b/doc/man/dash-cli.1 index d7149d0f0286..ff0fd123ccdf 100644 --- a/doc/man/dash-cli.1 +++ b/doc/man/dash-cli.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASH-CLI "1" "November 2026" "dash-cli v24.0.1" "User Commands" +.TH DASH-CLI "1" "November 2026" "dash-cli v24.0.2" "User Commands" .SH NAME -dash-cli \- manual page for dash-cli v24.0.1 +dash-cli \- manual page for dash-cli v24.0.2 .SH SYNOPSIS .B dash-cli [\fI\,options\/\fR] \fI\, \/\fR[\fI\,params\/\fR] \fI\,Send command to Dash Core\/\fR @@ -15,7 +15,7 @@ dash-cli \- manual page for dash-cli v24.0.1 .B dash-cli [\fI\,options\/\fR] \fI\,help Get help for a command\/\fR .SH DESCRIPTION -Dash Core RPC client version v24.0.1 +Dash Core RPC client version v24.0.2 .SH OPTIONS .HP \-? diff --git a/doc/man/dash-qt.1 b/doc/man/dash-qt.1 index bb5400952946..5a75964ed1a6 100644 --- a/doc/man/dash-qt.1 +++ b/doc/man/dash-qt.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASH-QT "1" "November 2026" "dash-qt v24.0.1" "User Commands" +.TH DASH-QT "1" "November 2026" "dash-qt v24.0.2" "User Commands" .SH NAME -dash-qt \- manual page for dash-qt v24.0.1 +dash-qt \- manual page for dash-qt v24.0.2 .SH SYNOPSIS .B dash-qt [\fI\,command-line options\/\fR] [\fI\,URI\/\fR] .SH DESCRIPTION -Dash Core version v24.0.1 +Dash Core version v24.0.2 .PP Optional URI is a Dash address in BIP21 URI format. .SH OPTIONS diff --git a/doc/man/dash-tx.1 b/doc/man/dash-tx.1 index 128aac1217d0..13cdd5f1e5e1 100644 --- a/doc/man/dash-tx.1 +++ b/doc/man/dash-tx.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASH-TX "1" "November 2026" "dash-tx v24.0.1" "User Commands" +.TH DASH-TX "1" "November 2026" "dash-tx v24.0.2" "User Commands" .SH NAME -dash-tx \- manual page for dash-tx v24.0.1 +dash-tx \- manual page for dash-tx v24.0.2 .SH SYNOPSIS .B dash-tx [\fI\,options\/\fR] \fI\, \/\fR[\fI\,commands\/\fR] \fI\,Update hex-encoded dash transaction\/\fR @@ -9,7 +9,7 @@ dash-tx \- manual page for dash-tx v24.0.1 .B dash-tx [\fI\,options\/\fR] \fI\,-create \/\fR[\fI\,commands\/\fR] \fI\,Create hex-encoded dash transaction\/\fR .SH DESCRIPTION -Dash Core dash\-tx utility version v24.0.1 +Dash Core dash\-tx utility version v24.0.2 .SH OPTIONS .HP \-? diff --git a/doc/man/dash-util.1 b/doc/man/dash-util.1 index 35e3f5290f68..41d95b0b1cd4 100644 --- a/doc/man/dash-util.1 +++ b/doc/man/dash-util.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASH-UTIL "1" "November 2026" "dash-util v24.0.1" "User Commands" +.TH DASH-UTIL "1" "November 2026" "dash-util v24.0.2" "User Commands" .SH NAME -dash-util \- manual page for dash-util v24.0.1 +dash-util \- manual page for dash-util v24.0.2 .SH SYNOPSIS .B dash-util [\fI\,options\/\fR] [\fI\,commands\/\fR] \fI\,Do stuff\/\fR .SH DESCRIPTION -Dash Core dash\-util utility version v24.0.1 +Dash Core dash\-util utility version v24.0.2 .SH OPTIONS .HP \-? diff --git a/doc/man/dash-wallet.1 b/doc/man/dash-wallet.1 index 6034d6b58b37..66a16959469d 100644 --- a/doc/man/dash-wallet.1 +++ b/doc/man/dash-wallet.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASH-WALLET "1" "November 2026" "dash-wallet v24.0.1" "User Commands" +.TH DASH-WALLET "1" "November 2026" "dash-wallet v24.0.2" "User Commands" .SH NAME -dash-wallet \- manual page for dash-wallet v24.0.1 +dash-wallet \- manual page for dash-wallet v24.0.2 .SH DESCRIPTION -Dash Core dash\-wallet version v24.0.1 +Dash Core dash\-wallet version v24.0.2 .PP dash\-wallet is an offline tool for creating and interacting with Dash Core wallet files. By default dash\-wallet will act on wallets in the default mainnet wallet directory in the datadir. diff --git a/doc/man/dashd.1 b/doc/man/dashd.1 index 8095630417fd..b6f06dd76c32 100644 --- a/doc/man/dashd.1 +++ b/doc/man/dashd.1 @@ -1,12 +1,12 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH DASHD "1" "November 2026" "dashd v24.0.1" "User Commands" +.TH DASHD "1" "November 2026" "dashd v24.0.2" "User Commands" .SH NAME -dashd \- manual page for dashd v24.0.1 +dashd \- manual page for dashd v24.0.2 .SH SYNOPSIS .B dashd [\fI\,options\/\fR] \fI\,Start Dash Core\/\fR .SH DESCRIPTION -Dash Core version v24.0.1 +Dash Core version v24.0.2 .SH OPTIONS .HP \-? diff --git a/doc/release-notes.md b/doc/release-notes.md index 0797c39d0da6..8122ff97eee9 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -1,19 +1,17 @@ -# Dash Core version v24.0.1 - -This is a new patch version release. It fixes a problem that has delayed the -`v24` network upgrade on mainnet: `LLMQ_400_85` quorums were failing to form -because slower masternodes could not finish the last step of the DKG in time, -and the `v24` EHF signal is only attempted again once a different quorum is -selected for it. It also changes how masternodes vote on superblock triggers -so that a superblock cannot be left unpaid by a change in the approved -proposals, and fixes several other bugs. - -Like v24.0.0, this release carries the `v24` network upgrade (hard fork) and is -**mandatory** for all nodes. Masternodes should upgrade to v24.0.1 as soon as -possible. All other nodes must run v24.0.0 or later before the hard fork -activates, and upgrading to v24.0.1 is strongly recommended. The upgrade itself -and everything else introduced in v24 are described in the -[v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md). +# Dash Core version v24.0.2 + +This is a new patch version release. It fixes a memory leak introduced in +v24.0.0 that makes a node's memory use grow until the node is restarted, a +crash of the macOS GUI during shutdown, and several other bugs. + +Like v24.0.0 and v24.0.1, this release carries the `v24` network upgrade (hard +fork), which is **mandatory** for all nodes: every node must run v24.0.0 or +later before the hard fork activates. Masternodes should upgrade to v24.0.2 as +soon as possible, and upgrading is strongly recommended for all other nodes. +The upgrade itself and everything else introduced in v24 are described in the +[v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md), +and the fixes for `v24` activation in the +[v24.0.1 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.1.md). Please report bugs using the issue tracker at GitHub: @@ -28,17 +26,17 @@ shut down (which might take a few minutes for older versions), then run the installer (on Windows) or just copy over /Applications/Dash-Qt (on Mac) or dashd/dash-qt (on Linux). -Upgrading from v24.0.0 needs no further steps. If you are upgrading from -v23.1.x or older, read "How to Upgrade" in the +Upgrading from v24.0.0 or v24.0.1 needs no further steps. If you are upgrading +from v23.1.x or older, read "How to Upgrade" in the [v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md) first: the first start migrates the address, spent and timestamp indexes, and some settings changed. ## Downgrade warning -### Downgrade to v24.0.0 +### Downgrade to v24.0.0 or v24.0.1 -Downgrading to v24.0.0 is possible and needs no special steps. +Downgrading to v24.0.0 or v24.0.1 is possible and needs no special steps. ### Downgrade to a version < v24.0.0 @@ -48,88 +46,64 @@ activation has caveats. See "Downgrade warning" in the # Release Notes -## v24 activation - -Activation of `v24` starts with masternodes signing an EHF signal with the -`LLMQ_400_85` quorum, which needs 340 of a quorum's 400 members. On mainnet -that signal has not been signed yet. When the signal window opened, too few -members of the selected quorum had upgraded, and a masternode signs the signal -only once per quorum. The signal is attempted again when a different quorum is -selected for it, but no `LLMQ_400_85` round on mainnet has formed a quorum -since then, so the selected quorum has not changed. - -- **DKG members no longer reload every verification vector at the commit - step.** To build its commitment, and to verify each commitment it received, - a member read every other member's verification vector back from disk. For a - 400-member quorum that took even the fastest masternodes 20 to 30 seconds - and slower ones minutes, while the commit phase lasts only four blocks. When - those blocks came quickly, too few members finished in time and the quorum - did not form. The vectors are now kept in memory for the duration of the DKG - session, and a masternode handles its own DKG messages before queued - messages from peers. - A masternode benefits as soon as it is upgraded, including in quorums whose - other members still run v24.0.0. (#8135, #8130) -- A quorum commitment is no longer dropped from a node's pool when the block - that carried it is rejected for an unrelated reason. Previously the - commitment was lost on every node that had validated that block and the - quorum was not mined in that DKG cycle. (#8104) - -An `LLMQ_400_85` DKG runs once a day. Each time a different quorum is selected -for the signal, its members sign it, including members that run v24.0.0, and -the signal is completed if 340 of the quorum's 400 members run v24.0.0 or -later and are online. The selected quorum changes at the latest once four new -quorums have formed. - -The parameters of the `v24` deployment are unchanged from v24.0.0. Miner -signaling still starts at the first 4032-block window boundary after the EHF -signal is mined, so the earliest possible activation date given in the v24.0.0 -release notes moves back by about a week for every window boundary that passes -before the signal is mined. - -## Governance - -- A masternode now waits until a superblock trigger for its own candidate - exists before it votes NO-FUNDING on other triggers, and casts those NO - votes at the latest three blocks before the superblock. Previously it voted - NO on every trigger that did not match its candidate at that block and never - revisited the vote. If the set of approved proposals changed while triggers - were being created, masternodes could end up having voted NO on the trigger - that matched their final candidate, and the superblock could pay no - proposals. (#8131) -- After a cycle that ended without a funded trigger, a masternode that had - voted YES in that cycle no longer votes NO on the next cycle's trigger. - (#8131) -- On test networks, a node restarted inside the maturity window no longer - drops its stored triggers and then rejects the superblock. Mainnet was not - affected. (#8097) - -Masternodes running older versions keep the old voting behaviour, so this -protection becomes effective as masternodes upgrade. Masternode operators -should upgrade before a superblock's maturity window opens, which is 1662 -blocks before the superblock. For the superblock at block 2575480 the window -opens at block 2573818 (around November 17). - -## Other fixes - -- Fixed an assertion failure in governance that could stop a node after a - reorg that changed the block in which a masternode registration was mined. - The failure repeated on every start until `governance.dat` was deleted. - (#8100) -- The network thread no longer spins at full CPU while a peer's send buffer is - full. (#8094) -- `GET /rest/block/.json` no longer terminates the node when the block - contains a provider transaction whose payload can't be decoded. (#8099) -- GUI: a shared masternode contribution can be reserved again after it was - released. (#8052) - -## Build and tests - -- The depends build fetches the miniupnpc sources from a location that still - serves them. (#8088) -- `test_dash-qt` no longer hangs or crashes when built against a distribution - Qt that uses the GLib event loop. (#8080) - -# v24.0.1 Change log +## Memory leak + +- Fixed a memory leak introduced in v24.0.0. A node's memory use grew + steadily with normal network activity and the memory was not returned until + the node was restarted. Masternodes were affected the most, but every node + was affected. (#8115) + +## GUI + +- macOS: fixed a crash when a wallet item of the File menu was used while the + application was shutting down. The menu bar stays available on macOS after + the main window closes; the menus are now removed when shutdown starts. + (#8073) + +## Network + +- A node now answers a governance sync request only to the peer that sent it. + Previously it announced every governance object, or every vote of the + requested object, to all of its peers each time one peer asked. (#8112) +- A governance vote that arrived before its governance object can be served to + peers once the object arrives. Previously the node announced such a vote but + could not send it when a peer requested it. (#8112) + +## Shutdown and masternodes + +- The ChainLocks thread is now stopped before the rest of the node shuts + down. Previously it could still be running during shutdown, which could + crash or stall the shutdown. (#8117) +- Masternodes: a batch of signature shares is no longer processed partially + when the quorum of one of its shares can't be found. (#8117) + +## Wallet + +- CoinJoin: with more than one wallet loaded, automatic mixing used one + schedule shared by all wallets, so a wallet could miss many of its turns. + Each wallet now has its own schedule. (#8113) +- CoinJoin: fixed undefined behaviour in a mixing session when the number of + rounds was lowered while inputs were being selected. (#8113) + +## Statistics + +These apply to nodes started with `-statshost`. + +- The `transactions.inputValue` metric reported the output value minus the + fee. It now reports the value of the inputs spent. (#8119) +- Fixed a possible crash when statistics were collected before the node had a + chain tip, for example at startup or during a reindex, and a data race on + the counters of sent messages. (#8119) + +Nodes that don't use `-statshost` no longer compute these statistics for every +transaction and block. (#8119) + +## Command-line tools + +- `dash-cli` and `dash-tx` accept `-printcrashinfo`, which their own crash + message asks the user to run. Previously they rejected the option. (#8120) + +# v24.0.2 Change log See detailed [set of changes][set-of-changes]. @@ -140,13 +114,13 @@ Thanks to everyone who directly contributed to this release: - Konstantin Akimov - PastaPastaPasta -As well as everyone that submitted issues, reviewed pull requests and helped -debug the release candidates. +As well as everyone that submitted issues and reviewed pull requests. # Older releases These releases are considered obsolete. Old release notes can be found here: +- [v24.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.1.md) released Nov/13/2026 - [v24.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md) released Nov/5/2026 - [v23.1.10](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.10.md) released Nov/2/2026 - [v23.1.9](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.9.md) released Oct/29/2026 @@ -216,4 +190,4 @@ These releases are considered obsolete. Old release notes can be found here: - [v0.10.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.10.0.md) released Sep/25/2014 - [v0.9.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.9.0.md) released Mar/13/2014 -[set-of-changes]: https://github.com/dashpay/dash/compare/v24.0.0...dashpay:v24.0.1 +[set-of-changes]: https://github.com/dashpay/dash/compare/v24.0.1...dashpay:v24.0.2 diff --git a/doc/release-notes/dash/release-notes-24.0.1.md b/doc/release-notes/dash/release-notes-24.0.1.md new file mode 100644 index 000000000000..0797c39d0da6 --- /dev/null +++ b/doc/release-notes/dash/release-notes-24.0.1.md @@ -0,0 +1,219 @@ +# Dash Core version v24.0.1 + +This is a new patch version release. It fixes a problem that has delayed the +`v24` network upgrade on mainnet: `LLMQ_400_85` quorums were failing to form +because slower masternodes could not finish the last step of the DKG in time, +and the `v24` EHF signal is only attempted again once a different quorum is +selected for it. It also changes how masternodes vote on superblock triggers +so that a superblock cannot be left unpaid by a change in the approved +proposals, and fixes several other bugs. + +Like v24.0.0, this release carries the `v24` network upgrade (hard fork) and is +**mandatory** for all nodes. Masternodes should upgrade to v24.0.1 as soon as +possible. All other nodes must run v24.0.0 or later before the hard fork +activates, and upgrading to v24.0.1 is strongly recommended. The upgrade itself +and everything else introduced in v24 are described in the +[v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md). + +Please report bugs using the issue tracker at GitHub: + + + +# Upgrading and downgrading + +## How to Upgrade + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes for older versions), then run the +installer (on Windows) or just copy over /Applications/Dash-Qt (on Mac) or +dashd/dash-qt (on Linux). + +Upgrading from v24.0.0 needs no further steps. If you are upgrading from +v23.1.x or older, read "How to Upgrade" in the +[v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md) +first: the first start migrates the address, spent and timestamp indexes, and +some settings changed. + +## Downgrade warning + +### Downgrade to v24.0.0 + +Downgrading to v24.0.0 is possible and needs no special steps. + +### Downgrade to a version < v24.0.0 + +There is no supported downgrade after `v24` activation, and downgrading before +activation has caveats. See "Downgrade warning" in the +[v24.0.0 release notes](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md). + +# Release Notes + +## v24 activation + +Activation of `v24` starts with masternodes signing an EHF signal with the +`LLMQ_400_85` quorum, which needs 340 of a quorum's 400 members. On mainnet +that signal has not been signed yet. When the signal window opened, too few +members of the selected quorum had upgraded, and a masternode signs the signal +only once per quorum. The signal is attempted again when a different quorum is +selected for it, but no `LLMQ_400_85` round on mainnet has formed a quorum +since then, so the selected quorum has not changed. + +- **DKG members no longer reload every verification vector at the commit + step.** To build its commitment, and to verify each commitment it received, + a member read every other member's verification vector back from disk. For a + 400-member quorum that took even the fastest masternodes 20 to 30 seconds + and slower ones minutes, while the commit phase lasts only four blocks. When + those blocks came quickly, too few members finished in time and the quorum + did not form. The vectors are now kept in memory for the duration of the DKG + session, and a masternode handles its own DKG messages before queued + messages from peers. + A masternode benefits as soon as it is upgraded, including in quorums whose + other members still run v24.0.0. (#8135, #8130) +- A quorum commitment is no longer dropped from a node's pool when the block + that carried it is rejected for an unrelated reason. Previously the + commitment was lost on every node that had validated that block and the + quorum was not mined in that DKG cycle. (#8104) + +An `LLMQ_400_85` DKG runs once a day. Each time a different quorum is selected +for the signal, its members sign it, including members that run v24.0.0, and +the signal is completed if 340 of the quorum's 400 members run v24.0.0 or +later and are online. The selected quorum changes at the latest once four new +quorums have formed. + +The parameters of the `v24` deployment are unchanged from v24.0.0. Miner +signaling still starts at the first 4032-block window boundary after the EHF +signal is mined, so the earliest possible activation date given in the v24.0.0 +release notes moves back by about a week for every window boundary that passes +before the signal is mined. + +## Governance + +- A masternode now waits until a superblock trigger for its own candidate + exists before it votes NO-FUNDING on other triggers, and casts those NO + votes at the latest three blocks before the superblock. Previously it voted + NO on every trigger that did not match its candidate at that block and never + revisited the vote. If the set of approved proposals changed while triggers + were being created, masternodes could end up having voted NO on the trigger + that matched their final candidate, and the superblock could pay no + proposals. (#8131) +- After a cycle that ended without a funded trigger, a masternode that had + voted YES in that cycle no longer votes NO on the next cycle's trigger. + (#8131) +- On test networks, a node restarted inside the maturity window no longer + drops its stored triggers and then rejects the superblock. Mainnet was not + affected. (#8097) + +Masternodes running older versions keep the old voting behaviour, so this +protection becomes effective as masternodes upgrade. Masternode operators +should upgrade before a superblock's maturity window opens, which is 1662 +blocks before the superblock. For the superblock at block 2575480 the window +opens at block 2573818 (around November 17). + +## Other fixes + +- Fixed an assertion failure in governance that could stop a node after a + reorg that changed the block in which a masternode registration was mined. + The failure repeated on every start until `governance.dat` was deleted. + (#8100) +- The network thread no longer spins at full CPU while a peer's send buffer is + full. (#8094) +- `GET /rest/block/.json` no longer terminates the node when the block + contains a provider transaction whose payload can't be decoded. (#8099) +- GUI: a shared masternode contribution can be reserved again after it was + released. (#8052) + +## Build and tests + +- The depends build fetches the miniupnpc sources from a location that still + serves them. (#8088) +- `test_dash-qt` no longer hangs or crashes when built against a distribution + Qt that uses the GLib event loop. (#8080) + +# v24.0.1 Change log + +See detailed [set of changes][set-of-changes]. + +# Credits + +Thanks to everyone who directly contributed to this release: + +- Konstantin Akimov +- PastaPastaPasta + +As well as everyone that submitted issues, reviewed pull requests and helped +debug the release candidates. + +# Older releases + +These releases are considered obsolete. Old release notes can be found here: + +- [v24.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-24.0.0.md) released Nov/5/2026 +- [v23.1.10](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.10.md) released Nov/2/2026 +- [v23.1.9](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.9.md) released Oct/29/2026 +- [v23.1.8](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.8.md) released Jul/29/2026 +- [v23.1.7](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.7.md) released Jun/30/2026 +- [v23.1.5](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.5.md) released Jun/19/2026 +- [v23.1.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.4.md) released Jun/18/2026 +- [v23.1.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.3.md) released May/28/2026 +- [v23.1.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.2.md) released Mar/12/2026 +- [v23.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.1.0.md) released Feb/15/2026 +- [v23.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.0.2.md) released Dec/4/2025 +- [v23.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-23.0.0.md) released Nov/10/2025 +- [v22.1.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-22.1.3.md) released Jul/15/2025 +- [v22.1.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-22.1.2.md) released Apr/15/2025 +- [v22.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-22.1.1.md) released Feb/17/2025 +- [v22.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-22.1.0.md) released Feb/10/2025 +- [v22.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-22.0.0.md) released Dec/12/2024 +- [v21.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.1.1.md) released Oct/22/2024 +- [v21.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.1.0.md) released Aug/8/2024 +- [v21.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.2.md) released Aug/1/2024 +- [v21.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-21.0.0.md) released Jul/25/2024 +- [v20.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.1.1.md) released April/3/2024 +- [v20.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.1.0.md) released March/5/2024 +- [v20.0.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.4.md) released Jan/13/2024 +- [v20.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.3.md) released December/26/2023 +- [v20.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.2.md) released December/06/2023 +- [v20.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.1.md) released November/18/2023 +- [v20.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-20.0.0.md) released November/15/2023 +- [v19.3.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.3.0.md) released July/31/2023 +- [v19.2.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.2.0.md) released June/19/2023 +- [v19.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.1.0.md) released May/22/2023 +- [v19.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-19.0.0.md) released Apr/14/2023 +- [v18.2.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.2.md) released Mar/21/2023 +- [v18.2.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.1.md) released Jan/17/2023 +- [v18.2.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.2.0.md) released Jan/01/2023 +- [v18.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.1.1.md) released January/08/2023 +- [v18.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.1.0.md) released October/09/2022 +- [v18.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.0.2.md) released October/09/2022 +- [v18.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-18.0.1.md) released August/17/2022 +- [v0.17.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.17.0.3.md) released June/07/2021 +- [v0.17.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.17.0.2.md) released May/19/2021 +- [v0.16.1.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.1.1.md) released November/17/2020 +- [v0.16.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.1.0.md) released November/14/2020 +- [v0.16.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.16.0.1.md) released September/30/2020 +- [v0.15.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.15.0.md) released February/18/2020 +- [v0.14.0.5](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.5.md) released December/08/2019 +- [v0.14.0.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.4.md) released November/22/2019 +- [v0.14.0.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.3.md) released August/15/2019 +- [v0.14.0.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.2.md) released July/4/2019 +- [v0.14.0.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.1.md) released May/31/2019 +- [v0.14.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.14.0.md) released May/22/2019 +- [v0.13.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.3.md) released Apr/04/2019 +- [v0.13.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.2.md) released Mar/15/2019 +- [v0.13.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.md) released Feb/9/2019 +- [v0.13.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.md) released Jan/14/2019 +- [v0.12.3.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.4.md) released Dec/14/2018 +- [v0.12.3.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.3.md) released Sep/19/2018 +- [v0.12.3.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.2.md) released Jul/09/2018 +- [v0.12.3.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.1.md) released Jul/03/2018 +- [v0.12.2.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.3.md) released Jan/12/2018 +- [v0.12.2.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.2.md) released Dec/17/2017 +- [v0.12.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.2.md) released Nov/08/2017 +- [v0.12.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.0.md) released Aug/15/2015 +- [v0.11.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.2.md) released Mar/04/2015 +- [v0.11.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.1.md) released Feb/10/2015 +- [v0.11.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.11.0.md) released Jan/15/2015 +- [v0.10.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.10.0.md) released Sep/25/2014 +- [v0.9.x](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.9.0.md) released Mar/13/2014 + +[set-of-changes]: https://github.com/dashpay/dash/compare/v24.0.0...dashpay:v24.0.1 diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 24a7f446ece6..be4b86816f3c 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -102,6 +102,7 @@ static void SetupCliArgs(ArgsManager& argsman) argsman.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password. When combined with -stdinwalletpassphrase, -stdinrpcpass consumes the first line, and -stdinwalletpassphrase consumes the second.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-stdinwalletpassphrase", "Read wallet passphrase from standard input as a single line. When combined with -stdin, the first line from standard input is used for the wallet passphrase.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddHiddenArgs({"-printcrashinfo"}); SetupChainParamsBaseOptions(argsman); } @@ -144,7 +145,7 @@ static int AppInitRPC(int argc, char* argv[]) if (gArgs.IsArgSet("-printcrashinfo")) { std::cout << GetCrashInfoStrFromSerializedStr(gArgs.GetArg("-printcrashinfo", "")) << std::endl; - return true; + return EXIT_SUCCESS; } if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) { diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index e61539db3383..f8f530e10b24 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -47,6 +47,7 @@ static void SetupBitcoinTxArgs(ArgsManager &argsman) argsman.AddArg("-create", "Create new, empty TX.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-json", "Select JSON output", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); argsman.AddArg("-txid", "Output only the hex-encoded transaction id of the resultant transaction.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); + argsman.AddHiddenArgs({"-printcrashinfo"}); SetupChainParamsBaseOptions(argsman); argsman.AddArg("delin=N", "Delete input N from TX", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); @@ -87,7 +88,7 @@ static int AppInitRawTx(int argc, char* argv[]) if (gArgs.IsArgSet("-printcrashinfo")) { std::cout << GetCrashInfoStrFromSerializedStr(gArgs.GetArg("-printcrashinfo", "")) << std::endl; - return true; + return EXIT_SUCCESS; } // Check for chain settings (Params() calls are only valid after this clause) diff --git a/src/bls/bls.cpp b/src/bls/bls.cpp index 96a188e2ae93..d1f222109995 100644 --- a/src/bls/bls.cpp +++ b/src/bls/bls.cpp @@ -440,7 +440,7 @@ static void secure_free(void* p) uint8_t* ptr = reinterpret_cast(p) - sizeof(size_t); size_t n = *reinterpret_cast(ptr); - return get_secure_allocator().deallocate(ptr, n); + return get_secure_allocator().deallocate(ptr, n + sizeof(size_t)); } #endif diff --git a/src/chainlock/handler.cpp b/src/chainlock/handler.cpp index 7dacdd7b0fa5..9422b67a32cc 100644 --- a/src/chainlock/handler.cpp +++ b/src/chainlock/handler.cpp @@ -56,8 +56,7 @@ ChainlockHandler::ChainlockHandler(chainlock::Chainlocks& chainlocks, Chainstate ChainlockHandler::~ChainlockHandler() { - scheduler->stop(); - scheduler_thread->join(); + Stop(); } void ChainlockHandler::Start() @@ -71,7 +70,13 @@ void ChainlockHandler::Start() std::chrono::seconds{5}); } -void ChainlockHandler::Stop() { scheduler->stop(); } +void ChainlockHandler::Stop() +{ + scheduler->stop(); + if (scheduler_thread->joinable()) { + scheduler_thread->join(); + } +} bool ChainlockHandler::AlreadyHave(const CInv& inv) const { diff --git a/src/coinjoin/client.cpp b/src/coinjoin/client.cpp index 8f4cf4b4e558..e260f837ab65 100644 --- a/src/coinjoin/client.cpp +++ b/src/coinjoin/client.cpp @@ -1793,10 +1793,12 @@ bool CCoinJoinClientSession::SubmitDenominate(CConnman& connman) WalletCJLogPrint(m_wallet, "vecInputsByRounds: rounds: %d, inputs: %d\n", pair.first, pair.second); } - int nRounds = vecInputsByRounds.begin()->first; - if (PrepareDenominate(nRounds, nRounds, strError, vecTxDSIn, vecPSInOutPairsTmp)) { - WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::SubmitDenominate -- Running CoinJoin denominate for %d rounds, success\n", nRounds); - return SendDenominate(vecPSInOutPairsTmp, connman); + if (!vecInputsByRounds.empty()) { + int nRounds = vecInputsByRounds.begin()->first; + if (PrepareDenominate(nRounds, nRounds, strError, vecTxDSIn, vecPSInOutPairsTmp)) { + WalletCJLogPrint(m_wallet, "CCoinJoinClientSession::SubmitDenominate -- Running CoinJoin denominate for %d rounds, success\n", nRounds); + return SendDenominate(vecPSInOutPairsTmp, connman); + } } // We failed? That's strange but let's just make final attempt and try to mix everything @@ -2442,15 +2444,12 @@ void CCoinJoinClientManager::DoMaintenance(ChainstateManager& chainman, CConnman if (!m_mn_sync.IsBlockchainSynced() || ShutdownRequested()) return; - static int nTick = 0; - static int nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN; - - nTick++; + m_tick++; CheckTimeout(); ProcessPendingDsaRequest(connman); - if (nDoAutoNextRun == nTick) { + if (m_do_auto_next_run == m_tick) { DoAutomaticDenominating(chainman, connman, mempool); - nDoAutoNextRun = nTick + COINJOIN_AUTO_TIMEOUT_MIN + GetRand(/*nMax=*/COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN); + m_do_auto_next_run = m_tick + COINJOIN_AUTO_TIMEOUT_MIN + GetRand(/*nMax=*/COINJOIN_AUTO_TIMEOUT_MAX - COINJOIN_AUTO_TIMEOUT_MIN); } } diff --git a/src/coinjoin/client.h b/src/coinjoin/client.h index 124dbc8aa93b..7eebf4433e34 100644 --- a/src/coinjoin/client.h +++ b/src/coinjoin/client.h @@ -227,6 +227,9 @@ class CCoinJoinClientManager : public interfaces::CoinJoin::Client // Keep track of current block height int nCachedBlockHeight{0}; + int m_tick{0}; + int m_do_auto_next_run{COINJOIN_AUTO_TIMEOUT_MIN}; + bool fCreateAutoBackups{true}; // builtin support for automatic backups bool WaitForAnotherBlock() const; diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index 3ec521886f34..675d2ee8d5b2 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -277,12 +277,12 @@ bool CGovernanceManager::ProcessObject(const std::string& peer_str, const uint25 return true; } -void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj) +void CGovernanceManager::CheckOrphanVotes(const std::shared_ptr& govobj) { AssertLockHeld(cs_store); AssertLockNotHeld(cs_relay); - uint256 nHash = govobj.GetHash(); + uint256 nHash = Assert(govobj)->GetHash(); std::vector orphan_votes; cmmapOrphanVotes.GetAll(nHash, orphan_votes); @@ -296,8 +296,10 @@ void CGovernanceManager::CheckOrphanVotes(CGovernanceObject& govobj) CGovernanceException e; if (orphan_vote.expiration < now) { fRemove = true; - } else if (govobj.ProcessVote(m_mn_metaman, fRateChecksEnabled, tip_mn_list, vote, e)) { - RelayVote(vote); + } else if (govobj->ProcessVote(m_mn_metaman, fRateChecksEnabled, tip_mn_list, vote, e)) { + if (cmapVoteToObject.Insert(vote.GetHash(), govobj)) { + RelayVote(vote); + } fRemove = true; } if (fRemove) { @@ -371,7 +373,7 @@ void CGovernanceManager::AddGovernanceObjectInternal(CGovernanceObject& insert_o // WE MIGHT HAVE PENDING/ORPHAN VOTES FOR THIS OBJECT - CheckOrphanVotes(*govobj); + CheckOrphanVotes(govobj); // SEND NOTIFICATION TO SCRIPT/ZMQ GetMainSignals().NotifyGovernanceObject(std::make_shared(govobj->Object()), nHash.ToString()); diff --git a/src/governance/governance.h b/src/governance/governance.h index 481fc8875ebb..e4ba2e421be3 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -419,7 +419,7 @@ class CGovernanceManager : public GovernanceStore void InitOnLoad() EXCLUSIVE_LOCKS_REQUIRED(!cs_store); - void CheckOrphanVotes(CGovernanceObject& govobj) + void CheckOrphanVotes(const std::shared_ptr& govobj) EXCLUSIVE_LOCKS_REQUIRED(cs_store, !cs_relay); void RebuildIndexes() diff --git a/src/governance/net_governance.cpp b/src/governance/net_governance.cpp index 56d193d9ad62..1bd152512a0d 100644 --- a/src/governance/net_governance.cpp +++ b/src/governance/net_governance.cpp @@ -151,7 +151,7 @@ void NetGovernance::ProcessMessage(CNode& peer, const std::string& msg_type, CDa m_connman.PushMessage(&peer, msgMaker.Make(NetMsgType::SYNCSTATUSCOUNT, MASTERNODE_SYNC_GOVOBJ, static_cast(invs.size()))); for (const auto& inv : invs) { - m_peer_manager->PeerRelayInv(inv); + m_peer_manager->PeerPushInventory(peer.GetId(), inv); } } else { // Sync votes for a specific governance object @@ -163,7 +163,7 @@ void NetGovernance::ProcessMessage(CNode& peer, const std::string& msg_type, CDa m_connman.PushMessage(&peer, msgMaker.Make(NetMsgType::SYNCSTATUSCOUNT, MASTERNODE_SYNC_GOVOBJ_VOTE, static_cast(invs.size()))); for (const auto& inv : invs) { - m_peer_manager->PeerRelayInv(inv); + m_peer_manager->PeerPushInventory(peer.GetId(), inv); } } } diff --git a/src/init.cpp b/src/init.cpp index cb6620cbcf7c..0aae2c198c64 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -928,50 +928,53 @@ static void PeriodicStats(NodeContext& node) ChainstateManager& chainman = *Assert(node.chainman); const CTxMemPool& mempool = *Assert(node.mempool); const llmq::CInstantSendManager& isman = *Assert(node.isman); - chainman.ActiveChainstate().ForceFlushStateToDisk(); - const auto maybe_stats = WITH_LOCK(::cs_main, return GetUTXOStats(&chainman.ActiveChainstate().CoinsDB(), chainman.m_blockman, /*hash_type=*/CoinStatsHashType::NONE, node.rpc_interruption_point, chainman.ActiveChain().Tip(), /*index_requested=*/true)); - if (maybe_stats.has_value()) { - ::g_stats_client->gauge("utxoset.tx", maybe_stats->nTransactions, 1.0f); - ::g_stats_client->gauge("utxoset.txOutputs", maybe_stats->nTransactionOutputs, 1.0f); - ::g_stats_client->gauge("utxoset.dbSizeBytes", maybe_stats->nDiskSize, 1.0f); - ::g_stats_client->gauge("utxoset.blockHeight", maybe_stats->nHeight, 1.0f); - if (maybe_stats->total_amount.has_value()) { - ::g_stats_client->gauge("utxoset.totalAmount", (double)maybe_stats->total_amount.value() / (double)COIN, 1.0f); + { + LOCK(::cs_main); + const CBlockIndex* tip = chainman.ActiveChain().Tip(); + if (!tip) return; + chainman.ActiveChainstate().ForceFlushStateToDisk(); + const auto maybe_stats = GetUTXOStats(&chainman.ActiveChainstate().CoinsDB(), chainman.m_blockman, /*hash_type=*/CoinStatsHashType::NONE, node.rpc_interruption_point, chainman.ActiveChain().Tip(), /*index_requested=*/true); + if (maybe_stats.has_value()) { + ::g_stats_client->gauge("utxoset.tx", maybe_stats->nTransactions, 1.0f); + ::g_stats_client->gauge("utxoset.txOutputs", maybe_stats->nTransactionOutputs, 1.0f); + ::g_stats_client->gauge("utxoset.dbSizeBytes", maybe_stats->nDiskSize, 1.0f); + ::g_stats_client->gauge("utxoset.blockHeight", maybe_stats->nHeight, 1.0f); + if (maybe_stats->total_amount.has_value()) { + ::g_stats_client->gauge("utxoset.totalAmount", (double)maybe_stats->total_amount.value() / (double)COIN, 1.0f); + } + } else { + // something went wrong + LogPrintf("%s: GetUTXOStats failed\n", __func__); + } + + double nNetworkHashPS = [&]() { + // Short version of GetNetworkHashPS(120, -1); + const CBlockIndex* pindex = tip; + int64_t minTime = pindex->GetBlockTime(); + int64_t maxTime = minTime; + for (int i = 0; i < 120 && pindex->pprev != nullptr; i++) { + pindex = pindex->pprev; + int64_t time = pindex->GetBlockTime(); + minTime = std::min(time, minTime); + maxTime = std::max(time, maxTime); + } + if (minTime == maxTime) return 0.0; + arith_uint256 workDiff = tip->nChainWork - pindex->nChainWork; + int64_t timeDiff = maxTime - minTime; + return workDiff.getdouble() / timeDiff; + }(); + + if (nNetworkHashPS > 0.0) { + ::g_stats_client->gaugeDouble("network.hashesPerSecond", nNetworkHashPS); + ::g_stats_client->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12); + ::g_stats_client->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15); + ::g_stats_client->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18); } - } else { - // something went wrong - LogPrintf("%s: GetUTXOStats failed\n", __func__); - } - - CBlockIndex *tip = WITH_LOCK(::cs_main, return chainman.ActiveChain().Tip()); - double nNetworkHashPS = [&]() { - // Short version of GetNetworkHashPS(120, -1); - CBlockIndex *pindex = tip; - int64_t minTime = pindex->GetBlockTime(); - int64_t maxTime = minTime; - for (int i = 0; i < 120 && pindex->pprev != nullptr; i++) { - pindex = pindex->pprev; - int64_t time = pindex->GetBlockTime(); - minTime = std::min(time, minTime); - maxTime = std::max(time, maxTime); - } - if (minTime == maxTime) return 0.0; - arith_uint256 workDiff = tip->nChainWork - pindex->nChainWork; - int64_t timeDiff = maxTime - minTime; - return workDiff.getdouble() / timeDiff; - }(); - - if (nNetworkHashPS > 0.0) { - ::g_stats_client->gaugeDouble("network.hashesPerSecond", nNetworkHashPS); - ::g_stats_client->gaugeDouble("network.terahashesPerSecond", nNetworkHashPS / 1e12); - ::g_stats_client->gaugeDouble("network.petahashesPerSecond", nNetworkHashPS / 1e15); - ::g_stats_client->gaugeDouble("network.exahashesPerSecond", nNetworkHashPS / 1e18); - } - // No need for cs_main, we never use null tip here - ::g_stats_client->gaugeDouble("network.difficulty", (double)GetDifficulty(tip)); - - ::g_stats_client->gauge("transactions.txCacheSize", WITH_LOCK(cs_main, return chainman.ActiveChainstate().CoinsTip().GetCacheSize()), 1.0f); - ::g_stats_client->gauge("transactions.totalTransactions", tip->nChainTx, 1.0f); + ::g_stats_client->gaugeDouble("network.difficulty", (double)GetDifficulty(tip)); + + ::g_stats_client->gauge("transactions.txCacheSize", chainman.ActiveChainstate().CoinsTip().GetCacheSize(), 1.0f); + ::g_stats_client->gauge("transactions.totalTransactions", tip->nChainTx, 1.0f); + } { LOCK(mempool.cs); diff --git a/src/llmq/signing_shares.cpp b/src/llmq/signing_shares.cpp index cf9f62e02d1b..31f6c67c025c 100644 --- a/src/llmq/signing_shares.cpp +++ b/src/llmq/signing_shares.cpp @@ -596,6 +596,8 @@ bool CSigSharesManager::CollectPendingSigSharesToVerify( if (!quorum) { LogPrintf("%s: ERROR! Unexpected missing quorum with llmqType=%d, quorumHash=%s\n", __func__, std23::to_underlying(llmqType), sigShare.getQuorumHash().ToString()); + retSigShares.clear(); + retQuorums.clear(); return false; } retQuorums.try_emplace(k, quorum); diff --git a/src/llmq/utils.cpp b/src/llmq/utils.cpp index 195a050375a1..fee5541cc397 100644 --- a/src/llmq/utils.cpp +++ b/src/llmq/utils.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -834,14 +833,7 @@ std::unordered_set CalcDeterministicWatchConnections(Consensus::LLMQType gsl::not_null pQuorumBaseBlockIndex, size_t memberCount, size_t connectionCount) { - static uint256 qwatchConnectionSeed; - static std::atomic qwatchConnectionSeedGenerated{false}; - static RecursiveMutex qwatchConnectionSeedCs; - if (!qwatchConnectionSeedGenerated) { - LOCK(qwatchConnectionSeedCs); - qwatchConnectionSeed = GetRandHash(); - qwatchConnectionSeedGenerated = true; - } + static const uint256 qwatchConnectionSeed = GetRandHash(); std::unordered_set result; uint256 rnd = qwatchConnectionSeed; diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 0ad815bd8bcf..85148671647b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -941,7 +941,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH } } } else { - if(trayIconMenu) + // Shutdown requested, disable menus + if (trayIconMenu) { // Disable context menu on tray icon trayIconMenu->clear(); @@ -963,6 +964,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel, interfaces::BlockAndH dockIconMenu->clear(); } #endif + // Disable top bar menu actions + appMenuBar->clear(); } updateCoinJoinVisibility(); diff --git a/src/stats/rawsender.cpp b/src/stats/rawsender.cpp index b0e7fc3c7df7..e69e9d3ca1eb 100644 --- a/src/stats/rawsender.cpp +++ b/src/stats/rawsender.cpp @@ -65,7 +65,7 @@ RawSender::~RawSender() QueueFlush(); LogPrintf("Stopped RawSender instance sending messages to %s:%d. %d successes, %d failures.\n", - m_host, m_port, m_successes, m_failures); + m_host, m_port, m_successes.load(), m_failures.load()); } std::optional RawSender::Send(const RawMessage& msg) diff --git a/src/stats/rawsender.h b/src/stats/rawsender.h index be332ff14efb..1f13eb6bd9ae 100644 --- a/src/stats/rawsender.h +++ b/src/stats/rawsender.h @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -111,9 +112,9 @@ class RawSender const uint64_t m_interval_ms; /* Number of messages sent */ - uint64_t m_successes{0}; + std::atomic m_successes{0}; /* Number of messages not sent */ - uint64_t m_failures{0}; + std::atomic m_failures{0}; }; #endif // BITCOIN_STATS_RAWSENDER_H diff --git a/src/support/allocators/mt_pooled_secure.h b/src/support/allocators/mt_pooled_secure.h index 813d40f1ed40..65978eb6a0dd 100644 --- a/src/support/allocators/mt_pooled_secure.h +++ b/src/support/allocators/mt_pooled_secure.h @@ -58,7 +58,7 @@ struct mt_pooled_secure_allocator : public std::allocator { uint8_t* ptr = (uint8_t*)p - sizeof(size_t); size_t bucket = *(size_t*)ptr; std::lock_guard lock(pools[bucket]->mutex); - pools[bucket]->deallocate(ptr, n * sizeof(T)); + pools[bucket]->deallocate(ptr, n * sizeof(T) + sizeof(size_t)); } private: diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp index 53978764e1f0..e903741d0e96 100644 --- a/src/test/allocator_tests.cpp +++ b/src/test/allocator_tests.cpp @@ -250,4 +250,26 @@ BOOST_AUTO_TEST_CASE(mt_pooled_secure_allocator_zero_pool_count) allocator.deallocate(p, 1); } +BOOST_AUTO_TEST_CASE(mt_pooled_secure_allocator_reuses_all_chunks) +{ + mt_pooled_secure_allocator allocator{/*nrequested_size=*/32, + /*nnext_size=*/1, + /*nmax_size=*/0, + /*pools_count=*/1}; + auto& pool = LockedPoolManager::Instance(); + + auto* p = allocator.allocate(33); + BOOST_REQUIRE(p != nullptr); + allocator.deallocate(p, 33); + const auto used = pool.stats().used; + + for (int i = 0; i < 1000; ++i) { + p = allocator.allocate(33); + BOOST_REQUIRE(p != nullptr); + allocator.deallocate(p, 33); + } + + BOOST_CHECK_EQUAL(pool.stats().used, used); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/governance_vote_processing_tests.cpp b/src/test/governance_vote_processing_tests.cpp index 1b87452778ff..d1ac437e7e76 100644 --- a/src/test/governance_vote_processing_tests.cpp +++ b/src/test/governance_vote_processing_tests.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -339,10 +340,16 @@ BOOST_AUTO_TEST_CASE(orphan_vote_is_cached_and_applied_when_parent_arrives) BOOST_CHECK_EQUAL(stored->GetAbsoluteYesCount(tip_mn_list(), VOTE_SIGNAL_FUNDING), 1); BOOST_CHECK_EQUAL(govman.GetCurrentVotes(parent_hash, mn_collateral).size(), 1U); BOOST_CHECK(govman.GetOrphanVoteObjectHashes().empty()); - // Known gap, pinned here so a fix has to update this test: CheckOrphanVotes() applies the - // vote to the object but never indexes it in cmapVoteToObject, so the vote inv it relays - // during the replay cannot be served to a peer that requests it. - BOOST_CHECK(!govman.HaveVoteForHash(vote.GetHash())); + BOOST_CHECK(govman.HaveVoteForHash(vote.GetHash())); + CDataStream serialized_vote{SER_NETWORK, PROTOCOL_VERSION}; + BOOST_CHECK(govman.SerializeVoteForHash(vote.GetHash(), serialized_vote)); + if (!serialized_vote.empty()) { + CGovernanceVote served_vote; + serialized_vote >> served_vote; + BOOST_CHECK_EQUAL(served_vote.GetHash(), vote.GetHash()); + BOOST_CHECK(served_vote.IsValid(tip_mn_list(), /*useVotingKey=*/true)); + BOOST_CHECK(serialized_vote.empty()); + } // A peer re-sending the same vote must not be punished for it. CGovernanceException replay_exception; diff --git a/src/validation.cpp b/src/validation.cpp index 7813be6921b9..45894e6b68cd 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1261,14 +1261,14 @@ bool MemPoolAccept::Finalize(const ATMPArgs& args, Workspace& ws) // Store transaction in memory m_pool.addUnchecked(*entry, ws.m_ancestors, validForFeeEstimation); - CAmount nValueOut = tx.GetValueOut(); - unsigned int nSigOps = GetTransactionSigOpCount(tx, m_view, STANDARD_SCRIPT_VERIFY_FLAGS); - - ::g_stats_client->count("transactions.sizeBytes", entry->GetTxSize(), 1.0f); - ::g_stats_client->count("transactions.fees", ws.m_modified_fees, 1.0f); - ::g_stats_client->count("transactions.inputValue", nValueOut - ws.m_modified_fees, 1.0f); - ::g_stats_client->count("transactions.outputValue", nValueOut, 1.0f); - ::g_stats_client->count("transactions.sigOps", nSigOps, 1.0f); + if (::g_stats_client->active()) { + const CAmount nValueOut = tx.GetValueOut(); + ::g_stats_client->count("transactions.sizeBytes", entry->GetTxSize(), 1.0f); + ::g_stats_client->count("transactions.fees", ws.m_modified_fees, 1.0f); + ::g_stats_client->count("transactions.inputValue", nValueOut + ws.m_base_fees, 1.0f); + ::g_stats_client->count("transactions.outputValue", nValueOut, 1.0f); + ::g_stats_client->count("transactions.sigOps", entry->GetSigOpCount(), 1.0f); + } // Add memory address index m_pool.addAddressIndex(*entry, m_view); @@ -3501,16 +3501,18 @@ bool Chainstate::ConnectTip(BlockValidationState& state, CBlockIndex* pindexNew, Ticks(time_total), Ticks(time_total) / num_blocks_total); - unsigned int nSigOps = 0; - for (const auto& tx : blockConnecting.vtx) { - nSigOps += GetLegacySigOpCount(*tx); + if (::g_stats_client->active()) { + unsigned int nSigOps = 0; + for (const auto& tx : blockConnecting.vtx) { + nSigOps += GetLegacySigOpCount(*tx); + } + ::g_stats_client->timing("ConnectTip_ms", Ticks(time_6 - time_1), 1.0f); + ::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(blockConnecting, PROTOCOL_VERSION), 1.0f); + ::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); + ::g_stats_client->gauge("blocks.tip.Version", blockConnecting.nVersion, 1.0f); + ::g_stats_client->gauge("blocks.tip.NumTransactions", blockConnecting.vtx.size(), 1.0f); + ::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); } - ::g_stats_client->timing("ConnectTip_ms", Ticks(time_6 - time_1), 1.0f); - ::g_stats_client->gauge("blocks.tip.SizeBytes", ::GetSerializeSize(blockConnecting, PROTOCOL_VERSION), 1.0f); - ::g_stats_client->gauge("blocks.tip.Height", m_chain.Height(), 1.0f); - ::g_stats_client->gauge("blocks.tip.Version", blockConnecting.nVersion, 1.0f); - ::g_stats_client->gauge("blocks.tip.NumTransactions", blockConnecting.vtx.size(), 1.0f); - ::g_stats_client->gauge("blocks.tip.SigOps", nSigOps, 1.0f); // If we are the background validation chainstate, check to see if we are done // validating the snapshot (i.e. our tip has reached the snapshot's base block). diff --git a/src/wallet/test/coinjoin_tests.cpp b/src/wallet/test/coinjoin_tests.cpp index 01963c3f8e93..fcfc8f28b472 100644 --- a/src/wallet/test/coinjoin_tests.cpp +++ b/src/wallet/test/coinjoin_tests.cpp @@ -236,6 +236,39 @@ class CTransactionBuilderTestSetup : public TestChain100Setup } }; +BOOST_FIXTURE_TEST_CASE(coinjoin_maintenance_runs_for_every_wallet, CTransactionBuilderTestSetup) +{ + struct RestoreOptions { + const bool enabled{CCoinJoinClientOptions::IsEnabled()}; + const int backups{nWalletBackups}; + ~RestoreOptions() + { + CCoinJoinClientOptions::SetEnabled(enabled); + nWalletBackups = backups; + } + } restore_options; + CCoinJoinClientOptions::SetEnabled(true); + nWalletBackups = 0; + m_node.mn_sync->SwitchToNextAsset(); + BOOST_REQUIRE(m_node.mn_sync->IsBlockchainSynced()); + + auto other_wallet{std::make_shared(m_node.chain.get(), m_node.coinjoin_loader.get(), "other", m_args, CreateMockWalletDatabase())}; + other_wallet->SetupLegacyScriptPubKeyMan(); + CCoinJoinClientManager first(wallet, *m_node.dmnman, *m_node.mn_metaman, *m_node.mn_sync, *m_node.isman, nullptr); + CCoinJoinClientManager second(other_wallet, *m_node.dmnman, *m_node.mn_metaman, *m_node.mn_sync, *m_node.isman, nullptr); + BOOST_REQUIRE(first.startMixing()); + BOOST_REQUIRE(second.startMixing()); + for (int tick{0}; tick < COINJOIN_AUTO_TIMEOUT_MIN; ++tick) { + BOOST_CHECK(first.isMixing()); + BOOST_CHECK(second.isMixing()); + first.DoMaintenance(*m_node.chainman, *m_node.connman, *m_node.mempool); + second.DoMaintenance(*m_node.chainman, *m_node.connman, *m_node.mempool); + } + // Each wallet's first automatic attempt stops mixing when automatic backups are disabled. + BOOST_CHECK(!first.isMixing()); + BOOST_CHECK(!second.isMixing()); +} + BOOST_FIXTURE_TEST_CASE(coinjoin_pending_observation_tests, CTransactionBuilderTestSetup) { // 0.100001 DASH, a valid CoinJoin denomination diff --git a/test/functional/feature_governance.py b/test/functional/feature_governance.py index 6a6ff64beade..1bcde1f46f1d 100755 --- a/test/functional/feature_governance.py +++ b/test/functional/feature_governance.py @@ -5,8 +5,17 @@ """Tests around dash governance.""" import json - -from test_framework.messages import uint256_to_string +import struct + +from test_framework.messages import ( + MSG_GOVERNANCE_OBJECT, + MSG_GOVERNANCE_OBJECT_VOTE, + msg_generic, + ser_string, + ser_uint256, + uint256_to_string, +) +from test_framework.p2p import P2PInterface, p2p_lock from test_framework.test_framework import ( DashTestFramework, MasternodeInfo, @@ -16,6 +25,18 @@ GOVERNANCE_UPDATE_MIN = 60 * 60 # src/governance/object.h + +class GovernanceSyncPeer(P2PInterface): + def __init__(self): + super().__init__() + self.governance_invs = set() + + def on_inv(self, message): + for inv in message.inv: + if inv.type in (MSG_GOVERNANCE_OBJECT, MSG_GOVERNANCE_OBJECT_VOTE): + self.governance_invs.add((inv.type, inv.hash)) + + class DashGovernanceTest (DashTestFramework): def add_options(self, parser): self.add_wallet_options(parser) @@ -58,6 +79,28 @@ def check_superblock(self): assert_equal(payments_found, 2) + def check_govsync_is_peer_local(self): + node = self.nodes[0] + self.log.info("Governance sync inventories go only to the requesting peer") + # Flush ordinary announcements before connecting peers that have never seen these inventories. + self.bump_mocktime(1) + for object_hash, inv_type, expected_hashes in ( + (0, MSG_GOVERNANCE_OBJECT, {int(h, 16) for h in node.gobject("list")}), + (int(self.p0_hash, 16), MSG_GOVERNANCE_OBJECT_VOTE, + {int(h, 16) for h in node.gobject("getcurrentvotes", self.p0_hash)}), + ): + assert expected_hashes + requester = node.add_p2p_connection(GovernanceSyncPeer()) + bystander = node.add_p2p_connection(GovernanceSyncPeer()) + # A one-byte, all-zero bloom filter requests every vote and is distinct from an object fetch. + bloom_filter = ser_string(b"\x00") + struct.pack("