Conversation
… state diffs CDeterministicMNStateDiff decided whether pubKeyOperator changed by comparing GetHash(), which only covers the encoded bytes. A legacy->basic migration whose new key has the same bytes as the old legacy key (mainnet block 2005287, masternode af40de...9024) therefore produced a diff with nVersion but without pubKeyOperator. A list reconstructed from that diff kept the legacy-scheme key under nVersion=2, its SML entry serialized the key as zeros, and the next block (2005288) failed with bad-cbtx-mnmerkleroot. It surfaced once masternode list cache eviction started forcing reconstruction from diffs during sync. Also record the key when its scheme (implied by nVersion) changes. Nodes that already stored such a diff need -reindex (-reindex-chainstate alone keeps the block index, so the affected block stays marked invalid). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…diffs Fold the existing same-key re-encoding check into a table and add the mainnet block 2005287 case, where the new basic-scheme key has the same bytes as the old legacy key. The new case fails without the previous commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Final review complete — no blockers (commit c9552ef) · triage: low |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe operator-key state diff now records a change when states differ in whether they use Priority: ⬆️ High Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The production fix correctly records the operator key when a LegacyBLS-to-BasicBLS transition changes the scheme despite identical encoded bytes, preserving consistent reconstructed masternode lists. The regression test covers both same-key re-encoding and the mainnet same-bytes/different-key case. One in-scope test-coverage suggestion remains: add a negative same-scheme version-bump case to ensure the key field is not recorded unnecessarily; no blocking issues were found.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff adds one straightforward scheme-change condition in CDeterministicMNStateDiff and extends an existing regression test, making it small and contained despite touching operator key handling. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 99% left, weekly 96% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/test/evo_deterministicmns_tests.cpp`:
- [SUGGESTION] src/test/evo_deterministicmns_tests.cpp:3592-3593: Add a negative case for same-scheme version changes
The new condition intentionally records pubKeyOperator only when the legacy-scheme status implied by nVersion changes. The table-driven test covers both positive LegacyBLS-to-BasicBLS cases, but it does not pin the negative side. A BasicBLS-to-ExtAddr version change with unchanged key bytes should set Field_nVersion without setting Field_pubKeyOperator; adding this check would prevent a future broadening of the condition that emits redundant key fields for every version-only diff.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- CBLSLazyWrapper can serialize zeros after a scheme mismatch — CBLSLazyWrapper::Serialize re-encodes from its uninitialized inner object when a valid byte buffer is present but the requested scheme differs, which can silently replace the original bytes with zeros. This is a pre-existing destructive behavior and the current fix strengthens the invariant that prevents the normal reconstruction path from reaching it, so it is outside this PR's scope.
- Follow-up: Track a separate issue to make scheme-mismatched lazy serialization decode the buffered bytes first or fail explicitly.
| } | ||
| } |
There was a problem hiding this comment.
🟡 Suggestion: Add a negative case for same-scheme version changes
The new condition intentionally records pubKeyOperator only when the legacy-scheme status implied by nVersion changes. The table-driven test covers both positive LegacyBLS-to-BasicBLS cases, but it does not pin the negative side. A BasicBLS-to-ExtAddr version change with unchanged key bytes should set Field_nVersion without setting Field_pubKeyOperator; adding this check would prevent a future broadening of the condition that emits redundant key fields for every version-only diff.
| } | |
| } | |
| } | |
| // A same-scheme version bump must not record unchanged operator key bytes. | |
| { | |
| CDeterministicMNState a; | |
| a.nVersion = ProTxVersion::BasicBLS; | |
| a.pubKeyOperator.Set(sk.GetPublicKey(), /*specificLegacyScheme=*/false); | |
| a.netInfo = NetInfoInterface::MakeNetInfo(a.nVersion); | |
| CDeterministicMNState b{a}; | |
| b.nVersion = ProTxVersion::ExtAddr; | |
| CDeterministicMNStateDiff diff{a, b}; | |
| BOOST_CHECK(!(diff.fields & CDeterministicMNStateDiff::Field_pubKeyOperator)); | |
| } | |
| } |
source: glm-5.3-flash (phase1-reviewer: general)
… unchanged bytes in state diffs c9552ef test: cover operator key scheme change with unchanged bytes in state diffs (UdjinM6) 020ddd1 fix(evo): capture operator key scheme changes with unchanged bytes in state diffs (UdjinM6) Pull request description: ## Issue being fixed or feature implemented Syncing mainnet from scratch on recent `develop` fails at block 2005288 (`000000000000004f95a6f3b181270e2644ab76abd14bb9402cca7a1f3f3eea93`) with `bad-cbtx-mnmerkleroot`. Block 2005287 has a ProUpRegTx that moves masternode `af40de...9024` from LegacyBLS to BasicBLS. The new basic-scheme operator key has the same bytes as the old legacy key. Those bytes decode to different keys under the two schemes. `CDeterministicMNStateDiff` decided whether `pubKeyOperator` changed by comparing `GetHash()`, which only covers the encoded bytes. So the stored diff carried the new `nVersion` but not the key. A list built online is correct. A list reconstructed from the stored diff keeps the legacy-scheme key under `nVersion=2`. Its SML entry then serializes the key as zeros, and the merkle root in the next block's CbTx doesn't match. Recent masternode list cache eviction changes exposed it during mainnet sync by forcing reconstruction from diffs. ## What was done? - `CDeterministicMNStateDiff` now also records `pubKeyOperator` when the BLS scheme implied by `nVersion` changes, not only when the encoded bytes change. The diff format and field layout are unchanged; the existing field is just filled in one more case. - The existing same-key re-encoding test is now table-driven, with the mainnet block 2005287 key added as a second case. Nodes that already stored the bad diff need `-reindex` to rebuild it with the fixed code. `-reindex-chainstate` also rebuilds evodb, but it keeps the block index, so nodes that already rejected block 2005288 keep it marked invalid. ## How Has This Been Tested? Unit tests, mutation check and lint ran on macOS 27 arm64, configured with `--enable-debug --enable-werror --enable-crash-hooks` against depends, at `c9552ef5f9`. - `./src/test/test_dash --run_test=evo_dip3_activation_tests` passes. Removing the new scheme check from the fix makes only the new "same bytes, different key" case fail. The existing case still passes. - Before the fix, instrumenting a mainnet sync confirmed the diagnosis: the list rebuilt from the diff at 2005287 had the masternode with a legacy-scheme key under `nVersion=2`, and the list built online did not. - A full mainnet `-reindex` with the fixed binary synced past 2005288 with no new issues. - `test/lint/all-lint.py`: the only failure is an existing cppcheck `knownConditionTrueFalse` warning at `src/governance/object.cpp:856`, which this PR doesn't touch. ## Breaking Changes None. Diffs written by the fixed code use the existing format. Nodes that already stored the bad diff need `-reindex` (see above). ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 77d9d2e794fe3f784c0b82ae5acf3e78d6447d7cc6278b1876439a232a4ca8c3519e061964638c7075307c18ccfda6cd165d900b62c8e902d0ae079ba9048a33 (cherry picked from commit 1bc5197)
6c02b2b ci: let DEPENDS_ARCH override the machine arch for multiprocess and tsan (pasta) ce5dbf3 Merge #7888: fix(consensus): canonical ExtNetInfo encoding and strict netInfo decoding (pasta) 54cba5c Merge #7537: fix: data races and check-then-act races in the CoinJoin server (pasta) 08d8bca Merge #7909: feat(mining): build the masternode list incrementally during block assembly (pasta) 5633761 Merge #7895: test: cover retroactive provider tx refusal, fix wording (pasta) cbb9500 Merge #7846: fix: treat pending owner keys and Platform node IDs as one conflict namespace (pasta) 8efdf5e Merge #7857: fix: mine a pending ProUpServTx before a key change of its masternode (pasta) e56e6ae Merge #7842: fix(wallet): reject mnemonic passphrases that seed derivation truncates (pasta) 79480ff test: follow-up for #7821: check if wallet is locked after failed upgrade instead creating brand-new scenario (Konstantin Akimov) a56ed47 fix(net): announce sporks to new peers instead of requesting them during mnsync (pasta) cdaea5f Merge #7894: fix: due to logical conflicts feature_pruning.py had been broken while (pasta) 98d92f6 Merge #7817: backport: partial bitcoin#34156 restore cleanup ownership (pasta) 35e6d18 Merge #7858: fix: do not InstantSend-lock provider transactions (pasta) 904d73d Merge #7881: fix: refuse to sign shared registrar updates that move the funder's coins (pasta) 95982f5 Merge #7782: fix(wallet): persist pending-observation coin locks once the record becomes readable (pasta) cdf65d0 Merge #7836: backport: partial bitcoin#25812, bitcoin#29855 (pasta) cc5716f Merge #7824: fix: retain initialized DKG sessions during inventory reads (pasta) 588e458 Merge #7827: backport: partial bitcoin#35984 (pasta) 795c6f1 Merge #7839: fix: release InstantSend tracking after mempool eviction (pasta) dc1a6b2 Merge #7875: docs(rpc): clarify getchainlockbyheight availability (pasta) e4798ff Merge #7876: fix(consensus): capture operator key scheme changes with unchanged bytes in state diffs (pasta) fe68ecb Merge #7871: backport!: Merge bitcoin#27217: wallet: Replace use of purpose strings with an enum (pasta) 8348d22 Merge #7867: fix: refuse masternode list RPCs for blocks outside the active chain (pasta) 861a579 Merge #7866: fix: stop `masternode payments` at the genesis block (pasta) efcef71 Merge #7521: fix: update masternode rate limit on failed governance trigger path (pasta) 0623182 Merge #7831: fix: bound governance object signatures and reset the governance cache (pasta) b230657 Merge #7841: fix: authenticate cached InstantSend proof bytes (pasta) a1f37ea Merge #7820: fix: hold chainstate lock during CoinJoin input validation (pasta) 50a5617 Merge #7829: fix: preserve wallet permissions when changing passphrases (pasta) 2ff0103 Merge #7818: fix: return REST errors for unavailable deployment data (pasta) cb39369 Merge #7834: fix: validate Electrum import input boundaries (pasta) e7e3daa Merge #7821: fix: relock encrypted wallets after HD upgrade failures (pasta) 2fea45f Merge #7792: fix: treat missing snapshots during evodb repair as repair errors (pasta) 3c5c039 Merge #7838: fix(wallet): authenticate unlock deadline extensions (pasta) 0bf80f8 Merge #7810: fix(rpc): handle unavailable masternode payment inputs (pasta) bcefee4 Merge #7822: fix: reject malformed detached quorum share batches (pasta) 86a7737 Merge #7828: fix: omit recovery words from invalid mnemonic errors (pasta) 886d5c4 Merge #7816: fix: check credit pool amount accumulation (pasta) 00fc3b9 Merge #7851: fix(rpc): correct masternode status help for top-level service field (pasta) 0e75c22 Merge #7814: fix(qt): restore HTML escaping of send confirmation recipients (pasta) Pull request description: ## Issue being fixed or feature implemented Backports for v24.0.0-rc.4, on top of `v24.0.x` at the v24.0.0-rc.3 tag (0364ed6, #7808). ## What was done? Cherry-picked (`git cherry-pick -m1 -x`) every develop merge since rc.3 that carries `backport-candidate-24.0.x`, plus eight unlabeled fixes picked after an audit of every other develop merge since rc.3 (marked † below). They are in develop merge order: - #7814 fix(qt): restore HTML escaping of send confirmation recipients † - #7851 fix(rpc): correct masternode status help for top-level service field - #7816 fix: check credit pool amount accumulation - #7828 fix: omit recovery words from invalid mnemonic errors † - #7822 fix: reject malformed detached quorum share batches † - #7810 fix(rpc): handle unavailable masternode payment inputs † - #7838 fix(wallet): authenticate unlock deadline extensions - #7792 fix: treat missing snapshots during evodb repair as repair errors - #7821 fix: relock encrypted wallets after HD upgrade failures - #7834 fix: validate Electrum import input boundaries - #7818 fix: return REST errors for unavailable deployment data - #7829 fix: preserve wallet permissions when changing passphrases - #7820 fix: hold chainstate lock during CoinJoin input validation - #7841 fix: authenticate cached InstantSend proof bytes - #7831 fix: bound governance object signatures and reset the governance cache - #7521 fix: update masternode rate limit on failed governance trigger path - #7866 fix: stop `masternode payments` at the genesis block - #7867 fix: refuse masternode list RPCs for blocks outside the active chain † - #7871 backport!: bitcoin#27217: wallet: Replace use of purpose strings with an enum - #7876 fix(consensus): capture operator key scheme changes with unchanged bytes in state diffs - #7875 docs(rpc): clarify getchainlockbyheight availability † - #7839 fix: release InstantSend tracking after mempool eviction - #7827 backport: partial bitcoin#35984 - #7824 fix: retain initialized DKG sessions during inventory reads - #7836 backport: partial bitcoin#25812, bitcoin#29855 - #7782 fix(wallet): persist pending-observation coin locks once the record becomes readable - #7881 fix: refuse to sign shared registrar updates that move the funder's coins † - #7858 fix: do not InstantSend-lock provider transactions - #7817 backport: partial bitcoin#34156 restore cleanup ownership - #7894 test: fix feature_pruning.py restart arguments † (needed because #7792 makes the evodb repair fatal, which the old restart arguments trip) - #7893 fix(net): announce sporks to new peers instead of requesting them during mnsync - 4a19742 (from #7859) test: follow-up for #7821: check if wallet is locked after failed upgrade instead creating brand-new scenario. Test-only, picked as its commit. Without it, #7821's `test_failed_upgrade()` expects RPC error -1 for a 257-byte mnemonic passphrase, which #7842's new precheck rejects with -8 first, so `wallet_upgradetohd.py --legacy-wallet` fails. On develop, #7859 replaced that scenario before #7842 merged. The rest of #7859 is test cleanup and docs and is left out. - #7842 fix(wallet): reject mnemonic passphrases that seed derivation truncates - #7857 fix: mine a pending ProUpServTx before a key change of its masternode - #7846 fix: treat pending owner keys and Platform node IDs as one conflict namespace - #7895 test: cover retroactive provider tx refusal, fix wording - #7909 feat(mining): build the masternode list incrementally during block assembly - #7537 fix: data races and check-then-act races in the CoinJoin server - #7888 fix(consensus): canonical ExtNetInfo encoding and strict netInfo decoding 34 of the 39 picks change exactly the same lines as their develop merges. #7888 and #7782 needed test-only changes (see testing), and three others needed adaptation, described in their commit messages: - **#7893** was merged to develop twice: f99212b with an earlier revision of its commit, then 72a5997 with the final one, so develop now announces sporks twice in the VERACK handler (a develop fix is open separately). Here the PR's final commit 45acdf3 is picked once instead of either merge. In `src/node/sync_manager.cpp`, this branch still sent `GETSPORKS` from the mnsync tick on every network, because #7847, which limited it to test chains, is not included. The request is removed entirely, as on develop. Mainnet spork values are hardcoded in `CSporkManager::GetSporkValue`, so the mainnet request had no effect. - **#7857** and **#7909**: develop folded `CChainstateHelper` into `Chainstate` (d5c1bd7), which is not on this branch, so the new code goes through `ChainHelper().special_tx` / `m_chain_helper.special_tx` instead of `m_special_tx`. The neighbouring develop-only `CSpecialTxProcessor::GetDeterministicMNListHash` is left out. #7888 tightens consensus rules for ExtAddr provider transactions behind V24, so I checked it against testnet. V24 is not active there yet (the tip's CbTx is still version 3), so the chain has no ExtAddr ProTxs the new rules could reject. rc.3's own serializer always writes canonical, sorted purposes, so every ProTx it builds passes the new rules. Mixed rc.3/rc.4 networks could only split on a hand-crafted non-canonical ExtAddr ProTx mined after V24 activates. So testnet miners and masternodes should move to rc.4 before V24 is signalled. Unlabeled develop fixes since rc.3 that were audited and left out: - Worth considering before the final release: #7869 (startup block replay after an unclean shutdown asserts on a quorum commitment, so recovery needs `-reindex-chainstate`; not a v24 regression), #7833 (gate signing intake before quorum retrieval, DoS hardening), #7682 (intermittent `relic_conf.h` parallel-build failure). - Left for 24.1: #7812, #7826, #7844, #7847, #7850, #7868, plus the routine upstream backports (#7780, #7806, #7830, #7855, #7856, #7862, #7863, #7865, #7883, #7884, #7898, #7906), refactors (#7805, #7878, #7880), and CI, docs and test-only changes. One CI-only commit comes last. It takes only the `ci/test` hunks of 6f71fa5 (#7901), which make `ci/test/00_setup_env_native_{multiprocess,tsan}.sh` honor `DEPENDS_ARCH`. Pull requests into `v24.0.x` run develop's workflow files (`pull_request_target`), and since #7901 those check the depends cache on x86_64 runners and pass the aarch64 build arch in `DEPENDS_ARCH`. Without the hunks, `linux64_multiprocess / Build depends` fails on any depends cache miss (`Build runner computes HOST=aarch64-linux-gnu but check-cache used x86_64-pc-linux-gnu`). Without `DEPENDS_ARCH` the scripts still use `uname -m`, so this branch's own push CI is unchanged. No version change is needed. `configure.ac` is already 24.0.0 with `CLIENT_VERSION_IS_RELEASE` false, so the build takes its version string from the `v24.0.0-rc.4` tag. ## How Has This Been Tested? Built and tested at 6c02b2b on macOS arm64 against depends, with `--enable-debug --enable-werror --disable-hardening`. - `make check`: all unit test suites pass, including `test_dash-qt`. - Functional tests, all passing: `feature_evo_shares_activation.py`, `feature_governance_objects.py`, `feature_llmq_signing.py` (plain and `--spork21`), `feature_masternode_shares.py`, `feature_sporks.py`, `interface_rest.py`, `p2p_instantsend.py`, `p2p_quorum_data.py`, `rpc_masternode.py`, `rpc_psbt.py`, `rpc_quorum.py`, `wallet_backup.py`, `wallet_dump.py`, `wallet_encryption.py`, `wallet_labels.py` and `wallet_upgradetohd.py`, each with `--descriptors` and `--legacy-wallet` where it supports them. - Each pick's changed lines were compared with its develop merge (or, for #7893, its PR commit). They are identical except for the #7893, #7857 and #7909 adaptations above, and the #7888 test adaptation below. - A local macOS arm64 debug build (`--enable-debug --enable-werror`) compiled most of the tree and stopped on a single error in `src/test/evo_netinfo_tests.cpp`. #7888's new test used `CNetAddr::V2()`, the serialization-parameter API from bitcoin#25284, which this branch lacks. The pick now writes that entry through an `OverrideStream` with `ADDRV2_FORMAT`, the way `NetInfoEntry::Serialize` does on this branch (see its commit message). - #7782's new unit test reloads the wallet with develop's three-argument `CWallet` constructor. On this branch the constructor still takes the CoinJoin loader and an `ArgsManager`, so the test passes them the way its fixture already does (see the commit message). - With both test fixes, a full local `make` (`dashd`, `dash-qt`, `test_dash`, `test_dash-qt`) completes with no errors. - `feature_pruning.py` is an extended test that CI does not run. #7894 is included because #7792 makes its restart path fail. ## Breaking Changes Carried over from the picked PRs: - #7876: rc.1 to rc.3 nodes that connected an affected block stored a wrong masternode list diff for it. Those nodes need `-reindex`; `-reindex-chainstate` is not enough for nodes that already marked the following block invalid. - #7888: stricter ExtAddr `netInfo` decoding and validation behind V24 (see above). The RFC1918 check now applies even with `-allowprivatenet`. - #7858: provider transactions no longer get InstantSend locks. Software that waits for an islock on a ProTx should wait for a ChainLock or confirmations instead. - #7857: a `ProUpServTx` spending an output of a pending operator key change, asset lock, asset unlock or MNHF signal is rejected from the mempool until that transaction confirms. - #7831: governance object signatures over 96 bytes are rejected, and the governance cache is discarded and re-synced on first start (`doc/release-notes-7831.md`). - #7871: address purposes are limited to `send`, `receive` and `refund`. Wallets with other purpose strings load with warnings, and `listlabels` errors on an unknown purpose (`doc/release-notes-27217.md`). - #7842: creating an HD wallet with a mnemonic passphrase over 248 bytes fails unless `-allow-deprecated-long-mnemonics` is set, and over 256 bytes always fails (`doc/release-notes-7842.md`). - #7792: a node whose evodb is missing a masternode list snapshot now stops at startup and asks for `-reindex`, and `evodb repair` reports it in `repairErrors`. - #7867: `protx info <proTxHash> <blockHash>`, `protx listdiff` and `masternode payments <blockHash>` return an error for blocks outside the active chain. - #7881: `protx shared_combine` on a `ProUpSharedRegTx` is refused unless its inputs are unlocked coins of a single address of the calling wallet, change returns to that address, and the fee is within `-maxtxfee`. - #7836: PSBTs referencing nonexistent previous outputs fail to deserialize (RPC error -22). - #7834: negative Electrum-import rescan indices are rejected. - #7893: on this branch, mainnet nodes no longer send `GETSPORKS` during mnsync (no effect, mainnet spork values are hardcoded). ## Checklist: - [x] 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 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 7de9535ca51620f4ddf5a46df2c3341a5e5fdd2263606f83f7db6b576c31ff7b82e1b285bf66988ac4b2729a9060513c45710135f61d7fd5c147b670d5f405dc
d6c066f chore: add v23.1.10 to the flatpak release history (pasta) 202632c chore: release v24.0.0 (pasta) 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) cdb250c doc: note operator-relevant v23.1.x patch-release changes for v24.0.0 (pasta) fcd332b doc: state the provider-transaction InstantSend change on its own (pasta) e6f3ad4 fix(bls): stop weighted contribution batch verification on an invalid partial aggregate (pasta) e04acba fix(llmq): weight batched DKG contribution verification (UdjinM6) ed96227 fix(bls): weight batch-verified signatures so complementary errors cannot cancel (UdjinM6) b5c7985 fix(governance): don't vote on triggers while not synced (pasta) a79f432 fix(governance): don't vote NO-FUNDING on triggers before their maturity window (pasta) 8615244 fix(llmq): accept equal DKG secret key shares when aggregating a member's share (pasta) 1c356f4 test: cover DKG members dealing identical contributions (UdjinM6) f23f748 fix(llmq): drop DKG members whose verification vectors share coefficients (UdjinM6) 914c052 docs: add #8003 to the v24.0.0 release notes and man pages (pasta) e81c511 Merge #8003: fix(net): don't refuse to start over the automatic onion service unless -listenonion=1 (merge-script) 41b4578 ci: run cppcheck as test/lint/cppcheck-dash.py, as develop does since #7966 (pasta) c97f3b3 docs: regenerate man pages for v24.0.0-rc.6 (pasta) 784312c docs: add the v24.0.0-rc.6 changes to the v24.0.0 release notes (pasta) f15a53a Merge #7991: fix(qt): shared masternode wizard fixes for taken shares, unconfirmed funding and reply handling (merge-script) 1c46224 Merge #7995: fix(wallet): don't let a waiting CoinJoin promotion/demotion queue block standard mixing (merge-script) 546db2f Merge #7996: fix(wallet): fill a CoinJoin promotion with sibling coins when needed (merge-script) 349859f Merge #7957: fix(qt): validate shared-masternode shares with the consensus rules (merge-script) 9091f0b Merge #8005: backport: bitcoin#27114, bitcoin#33395 (merge-script) e915ab5 Merge #7990: fix(wallet): pay for 3 byte input and output counts so 253+ input sends work (merge-script) 4f4d188 Merge #7984: chore: Translations 2026-10 (pasta) 129a1fc Merge #7980: chore: update seeds, checkpoints, minimum chain work, assumevalid and tx stats for v24 (pasta) 5800e5d docs: state that SPORK_3/SPORK_9 were already hardened on mainnet (pasta) ddc82a8 docs: separate extended addresses from shared masternodes in v24 notes (pasta) 8660e54 docs: complete the v24.0.0 release notes against the full v24 changeset (pasta) 11ea306 Merge #7947: fix: stop quorum key warming from stalling DKG on 2-core masternodes (pasta) 25d7c85 Merge #7826: fix: skip repeated authenticated Platform bans (pasta) 18073dd Merge #7850: perf: let CHECKDATASIG use the signature cache (pasta) 3759397 Merge #7833: fix: gate signing intake before quorum retrieval (pasta) db98ee2 fix: keep flat-file positions 64-bit clean at the remaining raw seek/tell sites (Konstantin Akimov) 54c9738 Merge bitcoin#36667: net: enforce timeout interval for paused send peers (Konstantin Akimov) f1adb2c Merge bitcoin#36665: sock: align exception monitoring between poll() and select() backends (Konstantin Akimov) 8becf6a Merge bitcoin#36669: refactor: store positions as a 64 bits integer in flatfiles (Konstantin Akimov) 4c0cbd6 fix(llmq): judge every sig-share sender by its own verified shares (pasta) 649259f fix(governance): cap the orphan parent objects re-requested per tick (pasta) 418f5ee fix(llmq): verify DKG contributions individually when a batch vvec check fails (pasta) abf2eb0 fix(llmq): reject invalid decrypted DKG shares before aggregation (pasta) 39bda8f fix(consensus): reject negative transaction nVersion after DIP3 (pasta) 1ba2609 Merge #7951: fix(net): stop peers lingering after disconnect under edge-triggered epoll (pasta) 696d45f Merge #7861: feat: keep at least 4-days worth blocks after pruning (merge-script) 9cd1c72 Merge #7869: fix: let startup block replay handle quorum commitments and asset unlocks (pasta) 73e7254 Merge #7682: build: finish relic_conf.h regeneration before compiling BLS consumers (pasta) 7312925 ci: bake the macOS SDK into the CI runner image (pasta) d885ecd Merge #7916: backport: bitcoin#27800, bitcoin#28125, bitcoin#28232, bitcoin#27695 (merge-script) f55ad1d Merge bitcoin#28139: test: create wallet specific for test_locked_wallet case (DCG-Claude) 80f6cbe chore: add the v23.1.9 release entry to flatpak metainfo (pasta) 5ba801f chore: use translation source strings generated from v24.0.x (pasta) a3b9e30 Merge #7974: chore: update man pages, translation strings, SECURITY.md and flatpak for v24.0.0 (pasta) b5d26bd feat(consensus): schedule V24 and evo_shares on mainnet for November 9, 2026 (pasta) fe78211 docs: state the earliest v24 activation height and the v23.1.9 fixes (pasta) 3bbe3e2 docs: address review of v24.0.0 release notes (pasta) 28c39fc docs: add v24.0.0 release notes and remove individual release notes files (pasta) e8cbfaf docs: archive v23.1.8 and v23.1.9 release notes (pasta) 6c02b2b ci: let DEPENDS_ARCH override the machine arch for multiprocess and tsan (pasta) ce5dbf3 Merge #7888: fix(consensus): canonical ExtNetInfo encoding and strict netInfo decoding (pasta) 54cba5c Merge #7537: fix: data races and check-then-act races in the CoinJoin server (pasta) 08d8bca Merge #7909: feat(mining): build the masternode list incrementally during block assembly (pasta) 5633761 Merge #7895: test: cover retroactive provider tx refusal, fix wording (pasta) cbb9500 Merge #7846: fix: treat pending owner keys and Platform node IDs as one conflict namespace (pasta) 8efdf5e Merge #7857: fix: mine a pending ProUpServTx before a key change of its masternode (pasta) e56e6ae Merge #7842: fix(wallet): reject mnemonic passphrases that seed derivation truncates (pasta) 79480ff test: follow-up for #7821: check if wallet is locked after failed upgrade instead creating brand-new scenario (Konstantin Akimov) a56ed47 fix(net): announce sporks to new peers instead of requesting them during mnsync (pasta) cdaea5f Merge #7894: fix: due to logical conflicts feature_pruning.py had been broken while (pasta) 98d92f6 Merge #7817: backport: partial bitcoin#34156 restore cleanup ownership (pasta) 35e6d18 Merge #7858: fix: do not InstantSend-lock provider transactions (pasta) 904d73d Merge #7881: fix: refuse to sign shared registrar updates that move the funder's coins (pasta) 95982f5 Merge #7782: fix(wallet): persist pending-observation coin locks once the record becomes readable (pasta) cdf65d0 Merge #7836: backport: partial bitcoin#25812, bitcoin#29855 (pasta) cc5716f Merge #7824: fix: retain initialized DKG sessions during inventory reads (pasta) 588e458 Merge #7827: backport: partial bitcoin#35984 (pasta) 795c6f1 Merge #7839: fix: release InstantSend tracking after mempool eviction (pasta) dc1a6b2 Merge #7875: docs(rpc): clarify getchainlockbyheight availability (pasta) e4798ff Merge #7876: fix(consensus): capture operator key scheme changes with unchanged bytes in state diffs (pasta) fe68ecb Merge #7871: backport!: Merge bitcoin#27217: wallet: Replace use of purpose strings with an enum (pasta) 8348d22 Merge #7867: fix: refuse masternode list RPCs for blocks outside the active chain (pasta) 861a579 Merge #7866: fix: stop `masternode payments` at the genesis block (pasta) efcef71 Merge #7521: fix: update masternode rate limit on failed governance trigger path (pasta) 0623182 Merge #7831: fix: bound governance object signatures and reset the governance cache (pasta) b230657 Merge #7841: fix: authenticate cached InstantSend proof bytes (pasta) a1f37ea Merge #7820: fix: hold chainstate lock during CoinJoin input validation (pasta) 50a5617 Merge #7829: fix: preserve wallet permissions when changing passphrases (pasta) 2ff0103 Merge #7818: fix: return REST errors for unavailable deployment data (pasta) cb39369 Merge #7834: fix: validate Electrum import input boundaries (pasta) e7e3daa Merge #7821: fix: relock encrypted wallets after HD upgrade failures (pasta) 2fea45f Merge #7792: fix: treat missing snapshots during evodb repair as repair errors (pasta) 3c5c039 Merge #7838: fix(wallet): authenticate unlock deadline extensions (pasta) 0bf80f8 Merge #7810: fix(rpc): handle unavailable masternode payment inputs (pasta) bcefee4 Merge #7822: fix: reject malformed detached quorum share batches (pasta) 86a7737 Merge #7828: fix: omit recovery words from invalid mnemonic errors (pasta) 886d5c4 Merge #7816: fix: check credit pool amount accumulation (pasta) 00fc3b9 Merge #7851: fix(rpc): correct masternode status help for top-level service field (pasta) 0e75c22 Merge #7814: fix(qt): restore HTML escaping of send confirmation recipients (pasta) fbe6526 Merge #7807: feat(consensus): hold EvoNode shares and multiple payouts behind a new evo_shares deployment (pasta) 57fd2d9 Merge #7776: fix: keep a pending ProUpServTx across a registrar update that keeps the operator key (pasta) ca69801 Merge #7803: fix: return non-zero amount of accounts after sethdseed (pasta) 57a8f07 Merge #7796: backport: bitcoin#26720 (remaining), partial bitcoin#29523: weight-check the knapsack exact-match selection (pasta) 4eb82f6 Merge #7786: fix(net): keep a dedicated onion listener when -bind is given and correct the bind release note (pasta) 70626a0 Merge #7793: backport: partial bitcoin#28868 (wallet: reload wallet if migration exited early, keep mixed watchonly txs) (pasta) 250a3cd Merge #7790: fix: guard cached governance object flags with the object lock (pasta) 700c195 Merge #7787: fix: only sign EHF signals inside the deployment's start/timeout window (pasta) a3b0f3c Merge #7785: fix: restore the txindex requirement when governance validation is enabled (pasta) 2d1735d Merge #7794: fix(wallet): floor the denomination gap threshold so rebalancing cannot oscillate (pasta) d9f6592 Merge #7783: fix: stop fish completion from re-running the typed dash-cli command (pasta) 89d44c8 Merge #7795: backport: bitcoin#34272, partial bitcoin#31650 (pass PSBT by const reference in PSBTInputSignedAndVerified) (pasta) a1d7411 Merge #7779: fix!: report legacy evonode Platform addresses when listdiff changes its address (pasta) 73f6ea2 Merge #7789: fix(qt): report malformed lang/font settings instead of aborting at startup (pasta) 40de493 Merge #7781: fix(rpc): use a consistent tip height in quorum dkgstatus (pasta) 7d1a90d Merge #7791: fix(net): request object votes from nPeersPerHashMax peers (pasta) 51b145c Merge #7778: test: use single-member in functional tests: feature_mnehf, feature_notifications, p2p_instantsend (pasta) Pull request description: ## Issue being fixed or feature implemented Merges the v24.0.0 release back into develop, as the release process asks once `master` is fast-forwarded. `master`, `v24.0.x` and the signed `v24.0.0` tag all point to the same commit (938fba5). ## What was done? One merge commit of `master` into develop. `v24.0.x` was cut from develop, so all of its code is already here. Every commit on it that develop lacks by patch is one of these: - a `cherry-pick -x` of a develop commit; - covered by a develop PR: the index fixes by #8042, the mainnet V24 schedule by #7973, the cppcheck CI move by #7966; - release bookkeeping. Git reports conflicts in many files, because `v24.0.x` carries adapted copies of develop's changes. All of them resolve to develop's side, which keeps develop's code, translations and version (`configure.ac` stays at 24.1.0, `CLIENT_VERSION_IS_RELEASE` false). Taken from v24.0.0: - `doc/release-notes.md`: the v24.0.0 release notes. The v23.1.10 notes move to `doc/release-notes/dash/`. - The man pages regenerated for v24.0.0, replacing develop's older v24.0.0 pages. A few entries (`-prune`, `-par`, `-parbls`, `-maxconnections`) still trail develop's help text, as they did before, until the next regeneration. - `feature_addressindex.py`: the v24.0.x test that blocks orphaned while the address index is disabled are removed from it once it is re-enabled. Release notes: - Individual `doc/release-notes-*.md` files whose content is in the v24.0.0 notes are removed. This includes `release-notes-8018.md`, `release-notes-8029.md` and `release-notes-27114.md`, whose changes shipped in v24.0.0 without the files. - `release-notes-28113.md` and `release-notes-28414.md` also covered `descriptorprocesspsbt`, which only develop has. They are trimmed to that RPC instead of removed. - Notes for changes v24.0.0 doesn't include stay: #7812, #7847, #7860, #7862, bitcoin#25943, bitcoin#26485 and bitcoin#27501. ## How Has This Been Tested? macOS arm64 against depends, `--enable-debug --enable-werror --disable-hardening --without-gui`. `dashd`, `dash-cli` and `test_dash` build cleanly. - `src/` is byte-identical to develop's. The only non-doc change is the new `feature_addressindex.py` case. - Functional tests, all passing: `feature_addressindex.py` (with the new case) and `feature_spentindex.py`. - Unit suites, all passing: `txindex_tests`, `blockfilter_index_tests`, `coinstatsindex_tests`, `index_migration_tests`, `baseindex_tests`. - `lint-python.py`, `lint-whitespace.py`, `lint-includes.py` and `lint-circular-dependencies.py` pass. - An independent review checked every non-merge commit in `develop..master` against develop (by patch, by cherry-pick source, and line by line for the rest), re-merged each `v24.0.x` merge commit to look for content added in a merge, and checked each release-note file decision. I did not run the full functional suite locally; CI covers it. ## Breaking Changes None. Develop's code is unchanged; the only non-doc change is the new functional test case. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 3c2d1b7d2885f983f1457a18920f42907009c8ca77522a6116739d387b011d8d5583da6a4b6a1227bcaa21fa07a7ef635aae58fb8b19e4f31a95582ee1ce2318
…, never from process state 6a268b8 refactor(evo): give every operator-key owner an OperatorKey() accessor (pasta) 2b0fc72 test: lint where the legacy BLS scheme may be named, and document the rule (pasta) 13781a6 refactor(llmq): name the scheme wherever commitment signatures are verified (pasta) 65a1e88 refactor(bls): remove the process-wide BLS scheme flag (pasta) c67c888 refactor(evo): take the operator key's encoding from its owner's version (pasta) 0e00686 refactor(bls): sign and run live paths under the basic scheme only (pasta) a586f66 feat(llmq): do not start a DKG for a quorum base before v19 (pasta) 0b908fa refactor: derive the BLS scheme for consensus signature checks from the block (pasta) 39899bc refactor(bls): stop reading the scheme flag for plain aggregation (pasta) 1d99154 refactor(bls): replace bool scheme arguments with BLSScheme (pasta) 6f32bf3 test: pin BLS scheme behaviour ahead of the scheme refactor (pasta) Pull request description: ## Issue being fixed or feature implemented Which BLS scheme a call used, legacy or basic, was decided by process state rather than by the data or the block it was about: - `bls::bls_legacy_scheme`, a mutable global, was read by every BLS encode, decode and verify that did not name a scheme. Validation had to flip it at the v19 boundary on connect and undo, restore it when a block failed, keep a background chainstate from disturbing the active one, force it at startup and override it in one EHF helper. Every new BLS call site silently depended on all of that being right. - A lazily decoded key or signature carried its own mutable legacy/basic tag. For a masternode's operator key that tag was a second copy of what the owning payload's or state's `nVersion` already says, and the two had to be kept in step by hand. Both made states that should be impossible representable, and that has been a steady source of consensus-adjacent bugs and review burden: a stale tag on an operator key splitting unique-property slots (#7473), a state diff missing a same-bytes re-encode (#7876, #7890), a signature cache keyed on a flag-dependent encoding, and the flag leaking between chainstates and threads (#8066). Every live network is far past v19. Legacy only matters for validating historical mainnet and testnet data and for the v1 masternode states that still exist on chain. ## What was done? The scheme is now a property of the data or of the block, never of the node: - **No process-wide scheme.** `bls::bls_legacy_scheme`, `ScopedBLSLegacyScheme` and its five uses in validation, the v19 flips in special-transaction processing, `notify_bls_state` and the `ForceSignalDBUpdate` override are gone. - **A call that names no scheme is basic.** `enum class BLSScheme` replaces the `bool` arguments (which also meant `modOrder` for secret keys). Secret keys and ids cannot be given a scheme at all; passing one does not compile. - **Encoding follows the owner's version.** One helper per family (`ProTxVersion::GetBLSScheme()`, `CFinalCommitment::GetBLSScheme()`, `OperatorKeyScheme()`), and one `BLSEncoded<T>` wrapper instead of three. - **Verification follows the block.** Operator signatures and final-commitment signatures are verified under `BLSSchemeAfter(pindexPrev)`, carried as `SpecialTxRules::bls_scheme`. This was already the rule (a legacy-encoded payload mined after v19 is verified under basic); it was implicit in the flag. - **Production code cannot sign or secure-aggregate under legacy.** Tests that need a legacy signature for historical validation use `SignBLS()` in `test/util`. - **The lazy wrapper has no observable scheme.** `IsLegacy()`/`SetLegacy()` are gone. `CBLSLazySignature` is basic only. `CBLSLazyPublicKey` has no scheme-less `Serialize`, `GetHash` or `ToString`, so encoding an operator key without naming its scheme is a compile error. The unique-property map takes an `OperatorKeySlot{key, scheme}` (a `BLSEncoded<const CBLSLazyPublicKey>`) and cannot be instantiated with a bare key. - **A lint keeps it that way.** Outside `src/bls`, `test/lint/lint-bls-scheme.py` fails on a production line that names `BLSScheme::Legacy` unless it carries a `NOLINT(bls-legacy-scheme)` marker, and on a marker that no longer guards such a line. Fourteen lines carry one. Commits, each of which builds and passes the unit tests on its own: 1. `test:` pin current behaviour (decode matrix, real pre-v19 mainnet commitment and ProUpServTx, per-encoding uniqueness, state-diff rule). 2. `bool` → `BLSScheme`, three version wrappers → `BLSEncoded` (mechanical). 3. Plain aggregation stops reading the flag (it is point addition; the legacy scheme class does not override it). 4. Consensus signature checks take the scheme from the block, with temporary `Assume()`s that the explicit value equals the flag. 5. No DKG for a quorum base before v19, and a final commitment a peer relays for such a base is ignored without scoring the peer (a stale one is still scored as before). 6. Signing and all live paths are basic only. 7. Operator-key encoding comes from the owner's version; the lazy wrapper loses its tag. 8. The flag and its machinery are deleted, with the temporary `Assume()`s. 9. Commitment verification must name its scheme; `BLSSchemeAfter()` replaces four hand-written v19 ternaries. 10. Lint and developer notes. 11. Every owner of an operator key gets `OperatorKey()`, the key together with its owner's scheme; hashing, printing and uniqueness go through it. ### Consensus No consensus change on mainnet or testnet. Stored, hashed and relayed bytes are unchanged: unique-property hashes, state diffs, SML entries and merkle roots, EvoDB formats, P2P messages. Operator-key uniqueness stays per encoding before v24. The decode rules of `CBLSWrapper::Unserialize` (all-zero, opposite-scheme fallback, legacy skipping the subgroup check) are kept bit for bit. Two things deserve a reviewer's attention because they are arguments rather than mechanical equivalences: - **EHF-signal, asset-unlock and coinbase-ChainLock signatures are always basic now**, where they used to follow the flag. Coinbase ChainLocks need the v20 CbTx version, and v20 is never before v19. EHF and asset-unlock transactions have no height gate of their own, but node software before v20 rejected those transaction types, so no real pre-v20 block contains one. A crafted pre-v19 block on a regtest chain with a late v19 height would validate differently; see Breaking Changes. - **The lazy operator key's old tag always equalled "owner's version is legacy"** on every path that builds a state (ProRegTx, the state and diff serializers, `SetStateVersion`, ProUpRegTx with and without a key change, ProUpRevTx, snapshot reload, old-format diff migration), so hashing and serializing under `OperatorKeyScheme()` reproduces the old bytes. The three `bad-protx-operator-pubkey` rejects that compared the tag with the version could never fire on a deserialized payload and are removed. ### Supersedes #8066 #8066 keeps the flag and stops it leaking: a per-thread override while a background chainstate, `VerifyDB` or a `TestBlockValidity` dry run works, and a re-sync of the flag when the active chainstate changes. With no flag, none of the cases it lists can occur, so that PR is not needed if this one lands: - ChainLock, recovered-signature and InstantSend-lock verification on other threads no longer reads anything a block connection can change; those paths are basic only. - Commitment checks handed to the `CCheckQueue` workers carry their scheme (`bls_check_runs_under_the_scheme_it_was_given`, taken from #8066). - Switching the active chainstate has no scheme to bring up to date. Two of those cases are reachable on `develop` today and are fixed here: `verifychain` at level 3 or 4 with a depth that reaches below v19 puts the running node on legacy while it verifies, and a `TestBlockValidity` dry run of the block that activates v19 puts it on basic until the dry run returns. `verify_db_across_v19` runs the level 4 check across v19. ## How Has This Been Tested? **Real chains.** These runs were made on an earlier head of this branch. The current head adds two unit tests and changes a handful of lines for cppcheck (qualifiers on the lazy wrapper, two `const auto&`, one `static`, one local variable inlined); nothing that runs differently. - A debug build of commit 5 (where a failed `Assume()` aborts) validated testnet and mainnet to the tip with `-assumevalid=0`, past v19 and v20 on both, with no abort and no validation error. On every real block the explicit scheme therefore equalled what the flag held. - The final head was then started with `-checklevel=4` on the datadirs that build had written, with no reindex, on both networks, and masternode and quorum RPC output was compared at the same tip with networking off: `protx list` (current and historical heights), `protx diff` including ranges across the testnet v19 fork, `protx listdiff`, `protx info` for v1 and v2+ masternodes, `masternodelist` in all modes, `quorum list` and `quorum info`, `getblock` for blocks carrying ProUpServTx/ProUpRegTx, and `gettxoutsetinfo`. Everything matched; the only raw differences (elapsed-time fields, `verificationprogress`, `disk_size`, array order in `protx listdiff`) also differ between two runs of the old binary. - Testnet was rebuilt from block 0 with the final head (`-reindex-chainstate`, to tip 1,591,287) and compared with the datadir the old binary had built, over the same RPC set: 64 output files, all identical once `metaInfo` is removed (it lives in `mncache.dat`, which a reindex does not replay). All 401 masternodes (299 v1, 79 v2, 23 v3) have identical state, and the log has no validation error. Mainnet was not rebuilt: that datadir is pruned, so it has the `-checklevel=4` comparison above and the full `-assumevalid=0` validation only. For the same reason `protx diff` across the mainnet v19 fork could not be compared (both binaries return the same pruned-data error). **New unit tests** (all pass unchanged from the commit that adds them, except one expectation the lazy-wrapper commit changes on purpose: an undecoded key written under the other scheme used to emit zeros and is now re-encoded): - `bls_scheme_decode_matrix`: valid / invalid / throw for zero, infinity, garbage and each encoding of fixed keys and signatures under each scheme, including byte strings that are canonical under both schemes and decode to different points. - `commitment_mainnet_pre_v19_verifies_legacy_only`, `proupserv_mainnet_pre_v19_verifies_legacy_only`: a real mainnet commitment (height 1898412) and ProUpServTx (height 1898717) verify under legacy and fail under basic. - `proupserv_signature_scheme_follows_block_height`: before v19 a v1 ProUpServTx must be signed legacy; after v19 the same v1 payload must be signed basic; walking the tip back across v19 restores the first rule. - `verify_db_across_v19`: a legacy-signed ProUpRevTx is mined before v19, the chain crosses v19, and `VerifyDB` level 4 disconnects and reconnects those blocks from the tip. Until now `VerifyDB` was only run on a chain that never reaches v19. - `mined_commitment_scheme_follows_the_block`: connects and rejects real blocks on both sides of v19, including a legacy-version commitment mined after v19, which must be basic-signed. - `commitment_signatures_follow_the_given_scheme`: direct and queued commitment verification under each scheme. - `pre_v19_qfcommit_is_ignored_unless_stale`: a requested commitment for a recent pre-v19 base is ignored without scoring the peer; one for a stale pre-v19 base still costs 100. - `operator_key_uniqueness_is_per_encoding`, `operator_key_stored_encoding_follows_version`, the state-diff cases, and `legacy_diff_operator_key_keeps_its_bytes`, which writes old-format diffs into EvoDB and runs `MigrateLegacyDiffs`. **Mutation checks that were run**, each making the named test fail: - Block validation using the commitment's version instead of the block's scheme → `mined_commitment_scheme_follows_the_block`. - The queued commitment check forced to basic → `commitment_signatures_follow_the_given_scheme`. - The pre-v19 relay skip removed, or moved ahead of the stale check → `pre_v19_qfcommit_is_ignored_unless_stale`. - `MigrateLegacyDiffs` skipping the reinterpretation of version-less key bytes → `legacy_diff_operator_key_keeps_its_bytes`. **Suites.** Every commit built and passed `test_dash` before the rebase onto the CMake build system; that rebase changed only which build file lists `src/test/util/bls.cpp`. Commits 5 and 7 were changed after that and rebuilt, and commit 5 builds on its own. On the head: the unit tests (`ctest`, 187 of 187, including `test_bitcoin-qt`), `lint-circular-dependencies`, `lint-python`, `git diff --check` and the new `lint-bls-scheme`, and the functional tests `feature_protx_version.py`, `feature_llmq_evo.py`, `feature_llmq_simplepose.py`, `feature_llmq_rotation.py`, `rpc_masternode.py` and `feature_dip3_deterministicmns.py`. With the v19 check of commit 5 removed, `feature_protx_version.py` fails. The full functional suite last ran on the head before the review changes (317 passed, 16 skipped for the platform, 1 failed: `feature_masternode_shares.py` at its `sync_all` race, which fails the same way on the base; the run before that was 318 passed, 0 failed). The head differs from that one by the lint and its markers, a type alias, one line of `non-backported.txt`, the review changes (the pre-v19 skip in commit 5, commit 11) and rebases onto newer `develop`. macOS arm64. Earlier full runs of the functional suite were not all clean, and neither were runs of the base: `feature_masternode_shares.py` failed once on each (and in 1 of 5 further runs alone on this head), and on this series `feature_notifications.py` (twice), `feature_asset_locks.py` and `wallet_upgradetohd.py --legacy-wallet` (once each) failed in separate runs. I then ran the first two 40 times each, ten in parallel, on both: `feature_notifications.py` 0/40 and 0/40, `feature_asset_locks.py` 1/40 here and 0/40 on the base. That one failure is a relay-order race in the test: the masternodes received the withdrawal 2 ms before the pending withdrawal meant to block it, so they locked it. This series changes neither that test nor InstantSend. Tests whose only subject was the flag machinery (the scoped guard, the flip surviving a failed validation, the per-contribution vvec scheme) are removed. `feature_protx_version.py` keeps its pre-v19 phase and legacy registrations; its pre-v19 `mine_quorum` is replaced by a check that no DKG session starts. ## Breaking Changes None on mainnet or testnet. On a regtest or devnet chain started with a late v19 height (`-testactivationheight`): - No quorum forms for a base block before v19; blocks carry null commitments until it activates. A final commitment a peer relays for such a base is ignored, and the peer is not scored unless the commitment is stale; on a mixed-version regtest or devnet chain an older node's legacy-signed commitment would otherwise fail basic verification and get the peer banned. Commitments already mined in blocks are still validated under the block's scheme. - P2P messages use the basic encoding before v19 too. A node running this change and one running an older release do not authenticate each other through MNAUTH there. Quorum data recovery also fails for a quorum that an older release mined before v19, because its verification-vector digest was computed over legacy-encoded keys. - `protx update_service` and `protx revoke` refuse before v19 ("operator-signed provider transactions need v19 to be active"), since the node can no longer produce the legacy signature consensus would require there. - An EHF-signal or asset-unlock transaction in a pre-v19 block is verified under basic. Such a block cannot be produced by an honest node (EHF signing and the credit pool start at v20). One deprecated RPC changes on an error path: `protx update_registrar_legacy` without a new key on a masternode that is already basic used to fail with "operator key encoding does not match ProTx version"; it now builds the v1 transaction, which consensus treats as before. No release note: nothing changes for a user of a live network. ## Council review Design rounds: 2 | Member | Round 1 | Round 2 | | --- | --- | --- | | Fable 5.2 (high) | no score | AGREE, no score | | Opus 5.5 (high) | no score | AGREE, no score | | GPT 6.1 Sol (high) | no score | AGREE, 9/10 | ## 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 _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 0f3c9db7db62296e325ff827e8bcd7e1a6c19243cb59e6e634cdc280bfd65682c4fbf802d9f833cdb14d4fabc43faa4d3c1a9b013981bd9d2d8c4d7a948b5108
Issue being fixed or feature implemented
Syncing mainnet from scratch on recent
developfails at block 2005288 (000000000000004f95a6f3b181270e2644ab76abd14bb9402cca7a1f3f3eea93) withbad-cbtx-mnmerkleroot.Block 2005287 has a ProUpRegTx that moves masternode
af40de...9024from LegacyBLS to BasicBLS. The new basic-scheme operator key has the same bytes as the old legacy key. Those bytes decode to different keys under the two schemes.CDeterministicMNStateDiffdecided whetherpubKeyOperatorchanged by comparingGetHash(), which only covers the encoded bytes. So the stored diff carried the newnVersionbut not the key.A list built online is correct. A list reconstructed from the stored diff keeps the legacy-scheme key under
nVersion=2. Its SML entry then serializes the key as zeros, and the merkle root in the next block's CbTx doesn't match. Recent masternode list cache eviction changes exposed it during mainnet sync by forcing reconstruction from diffs.What was done?
CDeterministicMNStateDiffnow also recordspubKeyOperatorwhen the BLS scheme implied bynVersionchanges, not only when the encoded bytes change. The diff format and field layout are unchanged; the existing field is just filled in one more case.Nodes that already stored the bad diff need
-reindexto rebuild it with the fixed code.-reindex-chainstatealso rebuilds evodb, but it keeps the block index, so nodes that already rejected block 2005288 keep it marked invalid.How Has This Been Tested?
Unit tests, mutation check and lint ran on macOS 27 arm64, configured with
--enable-debug --enable-werror --enable-crash-hooksagainst depends, atc9552ef5f9../src/test/test_dash --run_test=evo_dip3_activation_testspasses. Removing the new scheme check from the fix makes only the new "same bytes, different key" case fail. The existing case still passes.nVersion=2, and the list built online did not.-reindexwith the fixed binary synced past 2005288 with no new issues.test/lint/all-lint.py: the only failure is an existing cppcheckknownConditionTrueFalsewarning atsrc/governance/object.cpp:856, which this PR doesn't touch.Breaking Changes
None. Diffs written by the fixed code use the existing format. Nodes that already stored the bad diff need
-reindex(see above).Checklist:
🤖 Generated with Claude Code