Skip to content

feat: remove DEBUG_LOCKORDER and DEBUG_LOCKCONTENTION from slowest CI jobs: asan, tsan, multiprocess - #8040

Merged
PastaPastaPasta merged 8 commits into
dashpay:developfrom
knst:fast-tsan-ci-no-lock-order
Nov 3, 2026
Merged

PastaPastaPasta merged 8 commits into
dashpay:developfrom
knst:fast-tsan-ci-no-lock-order

Conversation

@knst

@knst knst commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

DEBUG_LOCKORDER is adding noticeable over-head and already slow job TSAN is loosing up to 45% CPU time purely on code related to lock-order feature; same for multiprocesses - it is built with -O0 and --enable-debug and overhead is huge.

DEBUG_LOCKCONTENTION is giving less overhead, but it's bunch of logs + string formatting and with -O0 and with tsan it's visible [but smaller] overhead.

Removing this options helped to discovered 2 new issues, one by asan, other by tsan that had been hidden by slow performance and extensive logging.

Tsan issue:

WARNING: ThreadSanitizer: data race
Write of size 4 by thread T2 'd-scheduler':
  #0 CGovernanceManager::UpdatedBlockTip        src/governance/governance.cpp:1128   nCachedBlockHeight = pindex->nHeight;
  #1 CDSNotificationInterface::UpdatedBlockTip  src/dsnotificationinterface.cpp:70
  #4 CMainSignals::UpdatedBlockTip              src/validationinterface.cpp:199      (validation-interface callback, scheduler thread)

Previous read of size 4 by thread T4 (an HTTP worker, holding 5 mutexes):
  #0 CGovernanceManager::CheckAndRemove                 src/governance/governance.cpp:424    m_superblocks.Clean(nCachedBlockHeight);
  #1 CDSNotificationInterface::NotifyMasternodeListChanged  src/dsnotificationinterface.cpp:94
  #4 CMainSignals::NotifyMasternodeListChanged           src/validationinterface.cpp:329     (called synchronously from an RPC)
  #23 ExecuteCommand                                     src/rpc/server.cpp:534
  #34 HTTPWorkQueueRun                                   src/httpserver.cpp:443

Location is heap block of size 608 allocated by main thread:
  #1 std::make_unique<CGovernanceManager>  src/init.cpp:2159

bench's leak:

==59354==ERROR: LeakSanitizer: detected memory leaks

Indirect leak of 488417 byte(s) in 113 object(s) allocated from:
    #0 0x556ed06abde3 in malloc (/__w/dash/dash/build-ci/dashcore-linux64_asan/src/bench/bench_dash+0x16cfde3) (BuildId: b06bbed85096d73ca18d4ff5a611a620133f3ab7)
    #1 0x556ed2cce9c7 in sqlite3MemMalloc sqlite3.c

Indirect leak of 312000 byte(s) in 3000 object(s) allocated from:
    #0 0x556ed06ed441 in operator new(unsigned long) (/__w/dash/dash/build-ci/dashcore-linux64_asan/src/bench/bench_dash+0x1711441) (BuildId: b06bbed85096d73ca18d4ff5a611a620133f3ab7)
    #1 0x556ed22273f7 in allocate /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/new_allocator.h:151:27
    #2 0x556ed22273f7 in allocate /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/allocator.h:196:32
    #3 0x556ed22273f7 in allocate /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/alloc_traits.h:478:20
    #4 0x556ed22273f7 in _M_get_node /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_tree.h:559:16
    #5 0x556ed22273f7 in _M_create_node<const std::piecewise_construct_t &, std::tuple<const CPubKey &>, std::tuple<> > /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_tree.h:609:23
    #6 0x556ed22273f7 in _Auto_node<const std::piecewise_construct_t &, std::tuple<const CPubKey &>, std::tuple<> > /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_tree.h:1633:18
    #7 0x556ed22273f7 in std::_Rb_tree_iterator<std::pair<CPubKey const, int>> std::_Rb_tree<CPubKey, std::pair<CPubKey const, int>, std::_Select1st<std::pair<CPubKey const, int>>, std::less<CPubKey>, std::allocator<std::pair<CPubKey const, int>>>::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<CPubKey const&>, std::tuple<>>(std::_Rb_tree_const_iterator<std::pair<CPubKey const, int>>, std::piecewise_construct_t const&, std::tuple<CPubKey const&>&&, std::tuple<>&&) /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_tree.h:2458:13
    #8 0x556ed21e1458 in std::map<CPubKey, int, std::less<CPubKey>, std::allocator<std::pair<CPubKey const, int>>>::operator[](CPubKey const&) /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/stl_map.h:513:15
    #9 0x556ed21bd668 in wallet::DescriptorScriptPubKeyMan::TopUp(unsigned int) src/wallet/scriptpubkeyman.cpp:2393:13
    #10 0x556ed21c2ada in wallet::DescriptorScriptPubKeyMan::SetupDescriptorGeneration(CExtKey const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>> const&, wallet::PathDerivationType) src/wallet/scriptpubkeyman.cpp:2560:5
    #11 0x556ed22dcfdd in wallet::CWallet::SetupDescriptorScriptPubKeyMans(CExtKey const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>>) src/wallet/wallet.cpp:4455:26
    #12 0x556ed22895a2 in wallet::CWallet::SetupDescriptorScriptPubKeyMans(std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, secure_allocator<char>>) src/wallet/wallet.cpp:4497:9
    #13 0x556ed22726a0 in wallet::CreateWallet(wallet::WalletContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::optional<bool>, wallet::DatabaseOptions&, wallet::DatabaseStatus&, bilingual_str&, std::vector<bilingual_str, std::allocator<bilingual_str>>&) src/wallet/wallet.cpp:470:25
    #14 0x556ed08b479b in operator() src/bench/wallet_create.cpp:42:23
    #15 0x556ed08b479b in ankerl::nanobench::Bench& ankerl::nanobench::Bench::run<wallet::WalletCreate(ankerl::nanobench::Bench&, bool)::$_0>(wallet::WalletCreate(ankerl::nanobench::Bench&, bool)::$_0&&) src/./bench/nanobench.h:1221:13
    #16 0x556ed08b3d91 in wallet::WalletCreate(ankerl::nanobench::Bench&, bool) src/bench/wallet_create.cpp:41:11
    #17 0x556ed06fd086 in operator() /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/bits/std_function.h:591:9
    #18 0x556ed06fd086 in benchmark::BenchRunner::RunAll(benchmark::Args const&) src/bench/bench.cpp:120:13
    #19 0x556ed075f6f8 in main src/bench/bench_bitcoin.cpp:137:9
    #20 0x7f8887a221c9  (/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9) (BuildId: a4a7992a8e66555c8141ab2a08a8465ff6e0ea65)
    #21 0x7f8887a2228a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28a) (BuildId: a4a7992a8e66555c8141ab2a08a8465ff6e0ea65)
    #22 0x556ed060bfb4 in _start (/__w/dash/dash/build-ci/dashcore-linux64_asan/src/bench/bench_dash+0x162ffb4) (BuildId: b06bbed85096d73ca18d4ff5a611a620133f3ab7)

What was done?

Removed DEBUG_LOCKORDER from slowest CI jobs: asan, tsan, multiprocess, and it is added instead to linux64 job, that has qt, that has previous releases, that have wallets, no sanitizers but have optimization flags.

Extra fixes to make CI jobs succeed:

How Has This Been Tested?

CI:

CI job develop PR
tsan unit 8m1 6m30 (-19%)
tsan functional 54m16 33m23 (-40%)
tsan functional accumulated 11830s 7576s (-36%)

Tested locally on:

  • feature_llmq_chainlocks.py
  • feature_llmq_dkgerrors.py
  • feature_llmq_is_retroactive.py
  • feature_llmq_signing.py
  • rpc_verifyislock.py
CI job current flags without DEBUG_LOCKORDER without both
linux64_tsan 441 238 (-46%) 238
linux64_asan 332 229 (-31%) 329*
linux64_multiprocess (-O0) 296 196 (-34%) 189 (-36%)
linux64* 108 (+18%) -- 91
  • *ASAN no LOCKCONTENTION
  • *linux64 gained both DEBUG_LOCKORDER and LOCKCONTENTION

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

knst added 4 commits November 4, 2026 01:54
Its per-LOCK bookkeeping is ~45% of dashd CPU in the functional tests under tsan; Bitcoin Core dropped it from its tsan job in bitcoin#33099.
Same per-LOCK bookkeeping as in the tsan job (three string copies, two global mutex acquisitions and a vector reallocation per LOCK); the fuzz job keeps it.
--enable-debug defines it; undefine it again. Measured 290-301 s -> 193-198 s of dashd CPU over six LLMQ functional tests.
Measured 184-191 s -> 178-180 s of dashd CPU over six LLMQ functional tests on top of dropping DEBUG_LOCKORDER.
@knst knst added this to the 24.1 milestone Nov 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-03T19:07:24.648652Z
We couldn’t complete this review. Comment @codex review to try again.
8ba67c5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

Keeps both checks on a job that runs the full functional suite, on an unsanitized -O2 build; Bitcoin Core's previous_releases job is a Debug build with both.
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The native ASan and TSan setup scripts retain ARENA_DEBUG and remove lock-tracking definitions. The multiprocess setup undefines DEBUG_LOCKORDER and DEBUG_LOCKCONTENTION. The previous-releases setup defines both flags.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 1d134

No actionable merge-blocking risk is identified. The TSan flag reduction is consistent with the intended CI performance improvement.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title accurately summarizes removing DEBUG_LOCKORDER and DEBUG_LOCKCONTENTION from the slowest ASan, TSan, and multiprocess CI jobs.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states that DEBUG_LOCKORDER adds overhead to the TSAN, ASan, and multiprocess CI jobs, and that the flag moves to the linux64 job. It also explains that DEBUG_LOCKCONTENTION adds loggi…
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files.

Full details: Description check

Explanation

The description states that DEBUG_LOCKORDER adds overhead to the TSAN, ASan, and multiprocess CI jobs, and that the flag moves to the linux64 job. It also explains that DEBUG_LOCKCONTENTION adds logging overhead. It reports CI timing and local test results, and it lists the sanitizer findings and the backported and atomic fixes. This matches the changeset in the CI setup scripts, so the description is related to the changes.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e85ee5d-c9dc-442f-abe2-857bc5376045
Commits

Reviewing files that changed from the base of the PR and between 38cef44 and 1d134cb.

Files selected for processing: 1
  • ci/test/00_setup_env_native_tsan.sh

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@thepastaclaw

thepastaclaw commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

🔍 Review in progress — actively reviewing now (commit a1f4cdd) · triage: low
███████████████████░ 95% · about 5 min left · running for 1 h 1 min
✅ triage → ⏳ Phase 1 (0/1 lanes) → ▫️ verify 1 → ▫️ gate → ▫️ Phase 2 → ▫️ verify 2 → ▫️ publish
Estimated from recent reviews of this tier · updated 21:46 UTC · live progress

knst and others added 3 commits November 4, 2026 02:19
No measurable CPU difference under tsan once DEBUG_LOCKORDER is gone (216 s both ways over six LLMQ functional tests); it only adds two log lines per contended lock.
UpdatedBlockTip writes it on the scheduler thread while CheckAndRemove, AddTrigger and GetCachedBlockHeight read it from other threads without a lock. ThreadSanitizer reports the race once DEBUG_LOCKORDER no longer serializes every LOCK() through its global mutex.
…platforms

7c8abf3 bench: bugfix, properly release wallet before erasing directory (furszy)

Pull request description:

  Simple fix for bitcoin#29816.

  Since the wallet is appended to the global `WalletContext` during
  creation, merely calling `reset()` on the benchmark shared_pointer
  is insufficient to destruct the wallet. This no destruction of the
  wallet object results in keeping the db connection open, which
  was causes the `fs::remove_all()` failure on Windows.

ACKs for top commit:
  maflcko:
    utACK 7c8abf3
  kevkevinpal:
    utACK [7c8abf3](bitcoin@7c8abf3)
  hebasto:
    re-ACK 7c8abf3, I agree with changes since my recent [review](bitcoin#30122 (review)).

Tree-SHA512: 279df65bea8f7aa02af0a2efed62dca9bf9b29cb748eb369c602d223e08a8a907dea7b1bffbd3dab91b1656c1d91b18a9a0534bc3f153bd751414b0e6230b3a4

Co-authored-by: merge-script <[email protected]>

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK;

@PastaPastaPasta
PastaPastaPasta merged commit 041af1d into dashpay:develop Nov 3, 2026
55 checks passed
PastaPastaPasta added a commit that referenced this pull request Nov 4, 2026
2bf133c docs: cite #8042 for the index fixes in the v24.0.0 release notes (pasta)
8aa11f6 docs: add the v24.0.0-rc.7 picks and index fixes to the v24.0.0 release notes (pasta)
ad4e5d6 docs: drop the index caveat from the -reindex-chainstate man page entry (pasta)
19a90bb test: blocks orphaned while the address index is disabled are removed from it (pasta)
d2f2a1f fix(index): don't adopt an empty or rebuilt async index as migrated legacy data (pasta)
e3bafdb fix(index): reject an uncommitted tip the block index lost (pasta)
9198962 fix(index): check the blocks governance resumes from at startup (pasta)
baff347 fix(index): resume from the tip a skipped commit leaves behind (pasta)
2dbf5ca fix(index): write a rewound block's erasures in one batch with its locator (pasta)
252acbe fix(index): move the committed locator below the entries a rewind erases (Konstantin Akimov)
e9f9c8a Merge bitcoin#36150: indexes: set prune lock to genesis before first block (Konstantin Akimov)
2edeb98 partial Merge bitcoin#34897: indexes: Don't commit ahead of the flushed chainstate (Konstantin Akimov)
3eba84c Merge bitcoin#32875: index: handle case where pindex_prev equals chain tip in NextSyncBlock() (Konstantin Akimov)
399125c Merge bitcoin#32882: index: remove unnecessary locator cleaning in BaseIndex::Init() (Konstantin Akimov)
bb724c6 Merge bitcoin#33212: index: Don't commit state in BaseIndex::Rewind (Konstantin Akimov)
d5ff431 Merge bitcoin#32878: index: fix wrong assert of current_tip == m_best_block_index (Konstantin Akimov)
31c7d8f partial Merge bitcoin#32580: wallet, test: best block locator matches scan state follow-ups (Konstantin Akimov)
94f5c58 partial Merge bitcoin#30221: wallet: Ensure best block matches wallet scan state (Konstantin Akimov)
8e0b1e8 partial Merge bitcoin#32069: test: fix intermittent failure in wallet_reorgsrestore.py (Konstantin Akimov)
4d17947 Merge bitcoin#25193: indexes: Read the locator's top block during init, allow interaction with reindex-chainstate (Konstantin Akimov)
0127df8 Merge #8045: test: scale the mempool-loaded wait by timeout_factor so TSAN reindex restarts stop timing out (pasta)
62d0cef Merge #8036: fix(qt): let a shared masternode participant follow a revised invitation that keeps their share (merge-script)
775d31c Merge #8018: fix(consensus): require IPv4 masternode primaries until IPv4 is optional, pin mainnet ports (merge-script)
e1b826e Merge #8026: fix(qt): keep shared masternode contribution fields locked while coins are reserved (merge-script)
9fa3df3 Merge #8020: fix(rpc): make protx shared_sign sign only dissolutions that return every principal (merge-script)
246a465 Merge #8024: fix(qt): keep the shared masternode dissolve dialog consistent with what it will send (merge-script)
590ad0a Merge #8021: fix(qt): don't load a newer shared masternode session copy that changes your own share (merge-script)
974aaa3 Merge #8034: fix(qt): check a shared masternode's service and refund addresses before coins are reserved (merge-script)
0026e3e Merge #8027: fix(qt): fund a shared masternode's service update from this wallet by default (merge-script)
6a5d2dc Merge #8035: fix(qt): don't strand coins reserved for a shared masternode session (merge-script)
df6083a Merge #8032: fix(qt): don't offer a new operator key when reopening a shared masternode session (merge-script)
2b5bf30 Merge #8029: fix: let dashd -version, -help and first start work without an existing data directory (merge-script)
e33d9b1 Merge #8037: docs: list the config file path each Linux init system uses (merge-script)
6030ea0 docs: add the #8014 migratewallet fixes to the v24.0.0 release notes (pasta)
1b1ea95 Merge #8014: backport: bitcoin#28609, bitcoin#34215, bitcoin#34226, bitcoin#34370, partials bitcoin#31423, bitcoin#34156 (migratewallet fixes from 28.x) (merge-script)
608ff63 Merge bitcoin#28542: wallet: Check for uninitialized last processed and conflicting heights in MarkConflicted (DCG-Claude)
3af6f63 Merge bitcoin#28038: wallet: address book migration bug fixes (DCG-Claude)
2fe41fb docs: add ecosystem notes on Asset Unlock txids, coinbase payees and RPC errors (pasta)
0e3f653 docs: correct operator guidance in the v24.0.0 release notes for rc.7 (pasta)
11c8140 Merge #8019: fix(qt): stop reporting refused shared masternode broadcasts as sent (merge-script)

Pull request description:

  ## Issue being fixed or feature implemented

  Backports and release prep for v24.0.0-rc.7, on top of `v24.0.x` at 8d195f1 (v24.0.0-rc.6, #8013). This PR collects the develop merges labeled `backport-candidate-24.0.x`, the v24.0.x port of #8042 with the index fixes from #8033, and the release notes for them, so rc.7 has a single backport PR to merge.

  ## What was done?

  ### Picked

  Cherry-picked with `git cherry-pick -m1 -x`, in develop merge order, except that bitcoin#28038 goes before bitcoin#28542 as in Bitcoin Core. Each pick changes exactly the same lines as its develop merge, except as noted below for bitcoin#28542, #8014, #8020 and #8018.

  - #8019 fix(qt): stop reporting refused shared masternode broadcasts as sent
  - bitcoin#28038 (from #7863): prerequisite of #8014
  - bitcoin#28542 (from #7762): prerequisite of #8014. Its `test_conflict_txs` migrates through `self.migrate_wallet`, as on develop since bitcoin#28868.
  - #8014 backport: bitcoin#28609, bitcoin#34215, bitcoin#34226, bitcoin#34370, partials bitcoin#31423, bitcoin#34156 (migratewallet fixes from 28.x), with the Dash adaptations below
  - #8037 docs: list the config file path each Linux init system uses
  - #8029 fix: let dashd -version, -help and first start work without an existing data directory
  - #8032 fix(qt): don't offer a new operator key when reopening a shared masternode session
  - #8035 fix(qt): don't strand coins reserved for a shared masternode session
  - #8027 fix(qt): fund a shared masternode's service update from this wallet by default
  - #8034 fix(qt): check a shared masternode's service and refund addresses before coins are reserved
  - #8021 fix(qt): don't load a newer shared masternode session copy that changes your own share
  - #8024 fix(qt): keep the shared masternode dissolve dialog consistent with what it will send
  - #8020 fix(rpc): make protx shared_sign sign only dissolutions that return every principal. Its `doc/release-notes-7437.md` sentence goes into the same paragraph of `doc/release-notes.md`, since that file was folded in for v24.0.0.
  - #8026 fix(qt): keep shared masternode contribution fields locked while coins are reserved (merged on develop as cc73a04; GitHub shows the PR as closed)
  - #8018 fix(consensus): require IPv4 masternode primaries until IPv4 is optional, pin mainnet ports, with the adaptation below
  - #8036 fix(qt): let a shared masternode participant follow a revised invitation that keeps their share
  - #8045 test: scale the mempool-loaded wait by timeout_factor so TSAN reindex restarts stop timing out

  ### Index fixes: #8042 port and #8033

  The index commits are #8042 (merge 9e5e3d5), ported commit by commit to `v24.0.x`, plus the parts of #8033 that #8042 doesn't cover. #8042's v24.0.x port replaces #8033's bitcoin#33212, bitcoin#34897 and rewind-locator commits, and #8033's flushed-block announcement fix (e6a687b) is dropped: bitcoin#30221 removes the wallet's `ChainStateFlushed` locator write, and nothing else on `v24.0.x` consumes that notification. This PR replaces #8033, and #8031 comes in through it (adapted to the `v24.0.x` `CCoinsViewDB` constructor), not as a separate pick.

  - bitcoin#25193 (from #7883, via #8033): indexes: read the locator's top block during init, allow interaction with `-reindex-chainstate`
  - From #8042: partial bitcoin#32069 (only `TestNode.kill_process()`, with develop's `wait_until_stopped(**kwargs)` handling it needs), partial bitcoin#30221, partial bitcoin#32580, bitcoin#32878, bitcoin#33212, bitcoin#32882, bitcoin#32875, partial bitcoin#34897, bitcoin#36150, and #8042's own fixes: move the committed locator below the entries a rewind erases; write a rewound block's erasures in one batch with its locator; resume from the tip a skipped commit leaves behind; check the blocks an index resumes from at startup; reject an uncommitted tip the block index lost
  - From #8033: #8031 fix(index): don't adopt an empty or rebuilt async index as migrated legacy data; test: blocks orphaned while the address index is disabled are removed from it; docs: drop the index caveat from the `-reindex-chainstate` man page entry

  #### Dash adaptations for #8042

  - The governance collateral index doesn't exist on `v24.0.x`, so its hunks are dropped; from the startup resume check only the `base.{h,cpp}` part is kept.
  - `feature_pruning.py`: node 5 syncs before node 0's pruned restart, and `test_rescan_blockchain` expects the governance-disabled stderr a pruned node prints on `v24.0.x`.
  - The wallet's `blockConnected` has no birthday skip on `v24.0.x`.
  - `TestNode.wait_until_stopped()` keeps `v24.0.x`'s `None` default for a clean exit.

  Apart from these, the `v24.0.x` index, validation and index test sources differ from develop after #8042 only by differences that already existed before it.

  #### Dash adaptations for #8018

  `v24.0.x` predates bitcoin#26177, so it has no `src/kernel/chainparams.cpp` and no `GetBuriedDeployment()`. The four `IPv4OptionalHeight` values (mainnet not scheduled, testnet 0, devnet 0, regtest only through `-testactivationheight=ipv4_optional@<height>`) go into the matching classes in `src/chainparams.cpp`, and `ipv4_optional` is parsed in its `MaybeUpdateHeights()`. The `GetBuriedDeployment()` hunk is dropped; the `DeploymentName()` case is kept. Every other file, including all tests, changes exactly the same lines as the develop merge. The same notes are in the pick's commit message.

  #### Dash adaptations for #8014

  #8014 doesn't cherry-pick cleanly onto `v24.0.x`. The conflicts were resolved against `v24.0.x` APIs. No prerequisite was backported, and no hunk or test was dropped. The same notes are in the pick's commit message.

  - `src/wallet/bdb.{cpp,h}`, `dump.cpp`, `sqlite.{cpp,h}`, `transaction.{cpp,h}`, `wallet.cpp`: the changed lines are identical to the develop merge. In `wallet.cpp`, the conflict was with develop-only context (`CanGrindR`), which stays out.
  - `src/wallet/db.h`: #8014 makes `WalletDatabase::Files()` pure virtual. `v24.0.x` still defines `DummyDatabase` in `db.h`, so it gets the `Files()` override there.
  - `src/wallet/test/wallet_tests.cpp`: the test database mock on `v24.0.x` is `FailDatabase`, so it gets the same `Files()` override. `src/wallet/salvage.cpp` and `src/wallet/test/util.h` keep the `v24.0.x` side, since develop's `DummyDatabase`/`MockableDatabase` placement doesn't exist here.
  - `test/functional/tool_wallet.py`, `wallet_backup.py`, `wallet_migration.py`: the test framework on `v24.0.x` has no `TestNode.wallets_path`/`datadir_path` (bitcoin#27884), so the new tests build these paths with `os.path.join` and pass RPC paths as strings. `wallet_migration.py` takes only #8014's new tests, not the develop-only tests around them.
  - `test/functional/wallet_migration.py`: `unsynced_wallet_on_pruned_node_fails` stops its pruned node with `EXPECTED_STDERR_NO_GOV_PRUNE`, because on `v24.0.x` a pruned node still prints the governance-disabled warning. The rc.6 picks handled the same warning the same way.

  ### Separate v24.0.x PRs, merged separately

  - #8016 backport: v23.1.10 fixes for v24.0.x
  - #8022 backport: bind CoinJoin signatures to the approved transaction (#7815) for v24.0.x, which depends on #7815 merging on develop

  #8016 and #8022 each merge cleanly with this branch in either order, and all three merge to the same tree in any order.

  ### Not picked

  - #8025: closed; superseded by #8014 (picked above)
  - #8031 is not picked separately; it comes through #8033's commits above.
  - #8039, #8040, #8041, #8043, #8044 (CI and tooling), #7905, follow-ups to #8042, and the PRs in the 24.1 milestone.
  - Explicitly deferred: #7870, #7679, #7675, #7220, #7217, #7109, #6988, #4974, #8028.

  ### Release notes

  `doc/release-notes.md` corrections, checked against the code on this branch:

  - **Version 2 Asset Unlocks:** version 1 Asset Unlocks stay valid after `v24` activation. Platform withdrawals keep using version 1 until a future Dash Platform release issues version 2, so the stable txid, InstantSend locking and instance-hash relay don't apply to them yet.
  - **Masternode requirements:** the startup refusals (#7754) and the DKG bad votes for missing transaction relay or compact filters (#7755) apply from the first start of v24.0.0, not from activation. Operators should remove conflicting settings and upgrade before the `v24` start date (November 9, 2026), so their masternodes are running when the activation signal is signed. `-peerblockfilters=0` is the new refusal; `-blockfilterindex=0` already failed on v23.
  - **How to Upgrade:** a pruned node with `-addressindex` or `-spentindex` now refuses to start; v23 accepted that combination.
  - **Downgrading:** there is no supported downgrade after `v24` activation: older versions can't follow the network, and they misread the masternode list data v24.0.0 writes. Before activation, downgrading to v23.1.x works with the listed caveats. Dash-Qt's dust-protection setting is migrated to the shared settings, so it reads as disabled after a downgrade.
  - **Dash Platform:** Platform/dashmate v5.0.0 and later handle the hidden `service` and `softforks` RPC fields. Older Platform versions need both `-deprecatedrpc` options.
  - **Compatibility:** users on macOS 13 or older must upgrade macOS, or move their node, before activation.
  - **Legacy wallets:** in v24, `createwallet` with `descriptors=false` also needs `load_on_startup`; before v24 this applied only to `descriptors=true`. The notes now give a working example.
  - **Wallet migration (#8014):** failure handling in `migratewallet`, `restorewallet` and `dash-wallet createfromdump` is fixed, and the new backup and watch-only/solvables wallet names are listed.
  - **Ecosystem notes:** the txid of a version 2 Asset Unlock zeroes `requestedHeight`, `quorumHash` and `quorumSig` before hashing (the full-bytes hash is `instanceHash`); pools should emit one coinbase output per `masternode[]` and `superblock[]` template entry, since merged or deduplicated payees are invalid after activation; client libraries that send numbers or booleans as strings fail (#7099); and some wallet RPC error messages changed with upstream backports.
  - **rc.7 picks:** `doc/release-notes-8018.md` and `doc/release-notes-8029.md` are folded in and removed. #8018's IPv4-primary and mainnet standard-port rules are under Extended addresses, with a pointer from the masternode upgrade notes; #8029's `dash.conf` change is under Updated settings. The other rc.7 picks fix code that is new in v24 and need no release note.
  - **Index fixes (#8042, #8031):** nodes that ran a release candidate with the address, spent or timestamp index should rebuild them once (with `-reindex`, or by starting once with them disabled, deleting their `indexes/` directories and starting with them enabled). The notes also cover `-reindex-chainstate` with indexes enabled, older versions refusing a migrated index until `-reindex`, the new "the block the index was last synced to is not found. Please rebuild the index." startup error, and the known limitation shared with earlier versions in the remaining cases.
  - All rc.7 TODO comments are resolved.

  `configure.ac` is already 24.0.0 with `CLIENT_VERSION_IS_RELEASE` false, so the version string comes from the `v24.0.0-rc.7` tag. The man pages carry #8033's `-reindex-chainstate` change; no other pick changes non-debug help text (#8018's `-testactivationheight` change is debug-only).

  ## How Has This Been Tested?

  On this head (2bf133c):
  - Every develop pick compared with its develop merge (`git patch-id --stable` and the set of changed lines). #8019, #8037, #8032, #8035, #8027, #8034, #8021, #8024, #8026, #8036 and #8045: identical. #8029: the same changed lines; only context differs in `feature_config_args.py`. #8020: the same changed lines, in `doc/release-notes.md` instead of `doc/release-notes-7437.md`. #8018: identical except the adaptation above, checked file by file against 900f085 and reviewed separately for consensus equivalence on mainnet, testnet, devnet and regtest. #8014 and its prerequisites: as in the earlier rounds (adaptations above).
  - #8042 port: `v24.0.x`'s divergence from develop, before #8042 (058b060) versus after it (9e5e3d5), is unchanged in `src/index/*`, `src/validation.{h,cpp}`, the index unit tests and `feature_coinstatsindex.py`, apart from the adaptations listed above. The #8031, test and man page commits have the same patch-id and message as on #8033.
  - Built with `--enable-debug --enable-werror` and Qt: no warnings.
  - Unit suites pass: `baseindex_tests`, `index_migration_tests`, `txindex_tests`, `blockfilter_index_tests`, `coinstatsindex_tests`, `validation_flush_tests`, `wallet_tests`, `interfaces_tests`, `evo_netinfo_tests` and `evo_snapshot_tests`. With the develop picks (7275005), every `evo_*` suite and `test_dash-qt` (15 classes, 152 passed, 0 failed) passed too.
  - Functional tests pass: `rpc_netinfo.py`, `feature_masternode_shares.py`, `wallet_migration.py`, `feature_coinstatsindex.py` (including the unclean restart after a reorg), `feature_addressindex.py`, `feature_config_args.py` and `feature_index_prune.py`. On the same C++ tree, these pass as well: `feature_spentindex.py`, `feature_timestampindex.py`, `feature_pruning.py`, `feature_txindex.py`, `feature_reindex.py`, `feature_init.py`, `feature_abortnode.py` and `wallet_reorgsrestore.py`.
  - Regtest upgrade gates, run on a build of this exact head: all pass. They cover v23.1.10 index migration, index contents vs v23 and `-reindex`, a kill mid-migration, 9 wallets, a pre-activation downgrade and round trip, and v22.1.3/v23.0.2 upgrades. The crash-after-reorg probe and the deleted-index probe are both required to be not reproduced: 0/10 stale (rc.6: about 4/10), and the plain-delete rebuild matches.
  - Man pages: `help2man` output of the built `dashd`, `dash-cli`, `dash-tx`, `dash-wallet` and `dash-util` matched `doc/man` on the develop picks (apart from the debug-build-only `lock` log category). No later commit changes non-debug help text, so nothing is regenerated beyond #8033's `-reindex-chainstate` change.
  - `git merge-tree` against #8016 (cdb250c) and #8022 (62609bf), heads fetched 05:23 UTC: clean in both orders, and all three merge to the same tree in every order.

  From the earlier rounds: the wallet suites and functional tests listed for #8014, bitcoin#28038 and bitcoin#28542 passed, and the `createwallet` example was checked against the official v24.0.0-rc.6 binary.

  ## Breaking Changes

  - From #8014: migration backups are now named `<name>_<time>.legacy.bak`, the unnamed wallet's watch-only and solvables wallets are named `default_wallet_watchonly` and `default_wallet_solvables`, and `restorewallet` accepts an existing empty directory.
  - From #8018: on mainnet, a version 3 ProRegTx or ProUpServTx must list an IPv4 address on the standard port as the first entry of each address list; testnet and devnets are unaffected.
  - From #8029: `dashd` no longer creates an empty `dash.conf`.
  - From #8031: older versions refuse an index migrated by v24.0.0 until they run `-reindex`; nodes that ran a release candidate should rebuild these indexes once.
  - From #8042: an index whose last synced block was lost in an unclean shutdown makes startup fail with a rebuild instruction.

  The release notes describe these.

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

  🤖 Generated with [Claude Code](https://claude.com/claude-code)

Top commit has no ACKs.

Tree-SHA512: 3c405ef570fc1c5b46d1ba8bb2e344213cf65018abe5ef4b94b7cf2b9aa7160ba2675f71a0a365c72bc8249a2f9a5defe774af2a4e33537245aeb420c5f66711
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants