-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: bitcoin#26120, #26192, #26378, #26643, #26752, #26758, #26771, #26810, #26824, #26867 #7090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…nter fa579f3 refactor: Pass reference to last header, not pointer (MacroFake) Pull request description: It is never a nullptr, otherwise an assertion would fire in UpdatePeerStateForReceivedHeaders. Passing a reference makes the code easier to read and less brittle. ACKs for top commit: john-moffett: ACK fa579f3 aureleoules: ACK fa579f3 Tree-SHA512: 9725195663a31df57ae46bb7b11211cc4963a8f3d100f60332bfd4a3f3327a73ac978b3172e3007793cfc508dfc7c3a81aab57a275a6963a5ab662ce85743fd0
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
…ndly fafcc94 Make bitcoin-util grind_task tsan friendly (MacroFake) Pull request description: While there is no issue with the current code, `libtsan-12.2.1` on my machine does not seem to like it. This is understandable, because the nonce isn't protected by a mutex that the sanitizer can see (only by an atomic, which achieves the same). Fix this by guarding the nonce by the existing atomic bool, which tsan seems to understand. ACKs for top commit: ajtowns: ACK fafcc94 hebasto: ACK fafcc94, I have reviewed the code and it looks OK, I agree it can be merged. Confirming that initial bug has been fixed. Tree-SHA512: 4e67fab5833ec7d91678b85a300368892ee9f7cd89a52cc5e15a7df65b2da813b24eaffd8362d0d8a3c8951e024041d69ebddf25101b11d0a1a62c1208ddc9a5
0460928 rpc: Improve error when wallet is already loaded (Aurèle Oulès) Pull request description: Currently, trying to load a descriptor (sqlite) wallet that is already loaded throws the following error: > error code: -4 > error message: > Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another instance of Bitcoin Core? I don't think it is very clear what it means for a user. While a legacy wallet would throw: > error code: -35 > error message: > Wallet file verification failed. Refusing to load database. Data file '/home/user/.bitcoin/signet/wallets/test_wallet/wallet.dat' is already loaded. This PR changes the error message for both types of wallet to: > error code: -35 > error message: > Wallet file verification failed. Wallet "test_wallet" is already loaded. ACKs for top commit: achow101: ACK 0460928 hernanmarino: ACK 0460928 theStack: Tested ACK 0460928 Tree-SHA512: a8f3d5133bfaef7417a6c05d160910ea08f32ac62bfdf7f5ec305ff5b62e9113b55f385abab4d5a4ad711aabcb1eb7ef746eb41f841b196e8fb5393ab3ccc01e
WalkthroughThis PR makes multiple coordinated changes across build config, docs, static analysis, networking, wallet, and various source files. Notable edits: include build_bitcoin_util in the configure.ac gating; add clang-tidy check Sequence Diagram(s)(skip) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
doc/build-windows.md (1)
9-9: Microsoft Learn URLs verified as accessibleAll three Microsoft Learn URLs are accessible and correctly point to the intended documentation:
- Line 9: WSL about page ✓
- Line 21: WSL install page ✓
- Line 37: WSL/Windows interoperability archive ✓
The secondary note about "here" as link text at line 21 remains a minor documentation style issue that can be addressed separately if desired.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
configure.accontrib/debian/copyrightdoc/build-windows.mddoc/fuzzing.mddoc/managing-wallets.mdsrc/.clang-tidysrc/addrman.cppsrc/bitcoin-cli.cppsrc/bitcoin-util.cppsrc/interfaces/chain.hsrc/net_processing.cppsrc/node/interfaces.cppsrc/primitives/transaction.hsrc/rpc/util.cppsrc/test/fuzz/tx_pool.cppsrc/test/fuzz/txorphan.cppsrc/test/util/setup_common.cppsrc/validation.cppsrc/wallet/rpc/util.cppsrc/wallet/rpc/wallet.cppsrc/wallet/spend.cppsrc/wallet/test/coinselector_tests.cppsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cppsrc/wallet/wallet.htest/functional/wallet_multiwallet.py
💤 Files with no reviewable changes (1)
- contrib/debian/copyright
🧰 Additional context used
📓 Path-based instructions (6)
src/**/*.{cpp,h,hpp,cc}
📄 CodeRabbit inference engine (CLAUDE.md)
Dash Core implementation must be written in C++20, requiring at least Clang 16 or GCC 11.1
Files:
src/primitives/transaction.hsrc/test/util/setup_common.cppsrc/bitcoin-cli.cppsrc/wallet/test/coinselector_tests.cppsrc/rpc/util.cppsrc/interfaces/chain.hsrc/wallet/wallet.hsrc/wallet/rpc/wallet.cppsrc/wallet/test/wallet_tests.cppsrc/addrman.cppsrc/wallet/wallet.cppsrc/net_processing.cppsrc/wallet/spend.cppsrc/wallet/rpc/util.cppsrc/bitcoin-util.cppsrc/validation.cppsrc/test/fuzz/tx_pool.cppsrc/test/fuzz/txorphan.cppsrc/node/interfaces.cpp
{guix-build*,releases,**/guix-build*,releases/**,.github/**,depends/**,ci/**,contrib/**,doc/**}
📄 CodeRabbit inference engine (CLAUDE.md)
Do not make changes to build system files (guix-build*), release artifacts, or avoid changes to .github, depends, ci, contrib, and doc directories unless specifically prompted
Files:
doc/fuzzing.mddoc/managing-wallets.mddoc/build-windows.md
src/{test,wallet/test}/**/*.{cpp,h}
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests in src/test/ and src/wallet/test/ must use Boost::Test framework
Files:
src/test/util/setup_common.cppsrc/wallet/test/coinselector_tests.cppsrc/wallet/test/wallet_tests.cppsrc/test/fuzz/tx_pool.cppsrc/test/fuzz/txorphan.cpp
src/wallet/**/*.{cpp,h}
📄 CodeRabbit inference engine (CLAUDE.md)
Wallet implementation must use Berkeley DB and SQLite
Files:
src/wallet/test/coinselector_tests.cppsrc/wallet/wallet.hsrc/wallet/rpc/wallet.cppsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cppsrc/wallet/spend.cppsrc/wallet/rpc/util.cpp
test/functional/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Functional tests in test/functional/ must be written in Python (minimum version specified in .python-version) and depend on dashd and dash-node
Files:
test/functional/wallet_multiwallet.py
src/node/**/*.{cpp,h}
📄 CodeRabbit inference engine (CLAUDE.md)
NodeContext must be extended with Dash-specific managers for each subsystem during initialization
Files:
src/node/interfaces.cpp
🧠 Learnings (17)
📓 Common learnings
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Learnt from: knst
Repo: dashpay/dash PR: 6916
File: src/univalue/include/univalue.h:81-88
Timestamp: 2025-10-25T07:08:51.918Z
Learning: For backport PRs from bitcoin/bitcoin, bitcoin-core/gui, etc., backported changes should match the original upstream PRs even if they appear strange, modify vendored code, or seem to violate coding guidelines. Still flag genuine issues like bugs, undefined behavior, crashes, compilation errors, or linter failures.
Learnt from: knst
Repo: dashpay/dash PR: 6871
File: contrib/guix/libexec/build.sh:358-360
Timestamp: 2025-10-05T20:38:28.457Z
Learning: In the Dash repository, when backporting code from Bitcoin Core, typos and minor issues in comments should be kept as-is to reduce merge conflicts in future backports, even if they remain unfixed in Bitcoin Core's master branch.
Learnt from: knst
Repo: dashpay/dash PR: 6883
File: src/rpc/rawtransaction.cpp:1088-1125
Timestamp: 2025-10-13T12:37:12.357Z
Learning: In backport pull requests (especially from Bitcoin Core), treat "moved" or refactored code as out-of-scope for content-level review. Focus validation on verifying that code is moved correctly: no fields added, no fields removed, no fields reordered, and no unexpected changes beyond whitespace adjustments. Pre-existing issues in the upstream code should be preserved to maintain fidelity to the original implementation.
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6804
File: src/qt/proposalwizard.cpp:40-42
Timestamp: 2025-08-11T17:16:36.654Z
Learning: In the Dash repository, when a PR adds new files that are not from Bitcoin backports, these files must be added to the list in test/util/data/non-backported.txt. This applies to newly created files like qt/proposalwizard.{h,cpp} and forms/proposalwizard.ui. Limited exemptions may exist for subtrees and similar cases.
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.
Learnt from: UdjinM6
Repo: dashpay/dash PR: 6786
File: ci/test/04_install.sh:99-101
Timestamp: 2025-08-01T07:46:37.840Z
Learning: In backport PRs like #6786, UdjinM6 prefers to defer non-critical fixes (such as shell command expansion issues) to separate commits/PRs to maintain focus on the primary backport objectives, consistent with the project's pattern of avoiding scope creep.
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/{validation,txmempool}/**/*.{cpp,h} : Block validation and mempool handling must use extensions to Bitcoin Core mechanisms for special transaction validation and enhanced transaction relay
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/{validation,consensus,net_processing}/**/*.{cpp,h} : ValidationInterface callbacks must be used for event-driven architecture to coordinate subsystems during block/transaction processing
📚 Learning: 2025-11-14T23:17:08.495Z
Learnt from: PastaPastaPasta
Repo: dashpay/dash PR: 6976
File: src/stacktraces.cpp:475-482
Timestamp: 2025-11-14T23:17:08.495Z
Learning: In C++ code reviews, always check for opportunities to use standard algorithms (std::any_of, std::all_of, std::none_of, std::find_if, std::transform, std::for_each, etc.) instead of manual for-loops, especially when the loop body performs simple checks, transformations, or accumulations.
Applied to files:
src/primitives/transaction.hsrc/.clang-tidy
📚 Learning: 2025-12-22T15:42:48.595Z
Learnt from: kwvg
Repo: dashpay/dash PR: 7068
File: src/qt/guiutil_font.h:68-77
Timestamp: 2025-12-22T15:42:48.595Z
Learning: In C++/Qt codebases, use fail-fast asserts in setters to enforce invariants (e.g., ensuring internal maps contain necessary keys). Prefer assert() for programmer errors that should be caught in development and debugging, rather than defensive runtime checks with fallbacks. This helps catch invariant violations early during development. Apply to header and source files where invariant-driven state mutations occur, especially in setters like SetWeightBold/SetWeightNormal that assume established relationships or preconditions.
Applied to files:
src/primitives/transaction.hsrc/interfaces/chain.hsrc/wallet/wallet.h
📚 Learning: 2025-08-08T07:01:47.332Z
Learnt from: knst
Repo: dashpay/dash PR: 6805
File: src/wallet/rpc/wallet.cpp:357-357
Timestamp: 2025-08-08T07:01:47.332Z
Learning: In src/wallet/rpc/wallet.cpp, the upgradetohd RPC now returns a UniValue string message (RPCResult::Type::STR) instead of a boolean, including guidance about mnemonic backup and null-character passphrase handling; functional tests have been updated to assert returned strings in several cases.
Applied to files:
src/bitcoin-cli.cppsrc/rpc/util.cppsrc/wallet/wallet.hdoc/managing-wallets.mdtest/functional/wallet_multiwallet.pysrc/wallet/rpc/wallet.cppsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cppsrc/wallet/rpc/util.cppsrc/validation.cpp
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/coinjoin/**/*.{cpp,h} : CoinJoin implementation must use masternode-coordinated mixing sessions with uniform denomination outputs
Applied to files:
src/wallet/test/coinselector_tests.cpp
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/{validation,txmempool}/**/*.{cpp,h} : Block validation and mempool handling must use extensions to Bitcoin Core mechanisms for special transaction validation and enhanced transaction relay
Applied to files:
src/interfaces/chain.hsrc/wallet/wallet.hsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cppsrc/net_processing.cppsrc/wallet/spend.cppsrc/validation.cppsrc/test/fuzz/tx_pool.cppsrc/node/interfaces.cpp
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/{validation,consensus,net_processing}/**/*.{cpp,h} : ValidationInterface callbacks must be used for event-driven architecture to coordinate subsystems during block/transaction processing
Applied to files:
src/interfaces/chain.hsrc/net_processing.cppsrc/wallet/spend.cppsrc/validation.cppsrc/node/interfaces.cpp
📚 Learning: 2025-02-14T15:19:17.218Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6529
File: src/wallet/rpcwallet.cpp:3002-3003
Timestamp: 2025-02-14T15:19:17.218Z
Learning: The `GetWallet()` function calls in `src/wallet/rpcwallet.cpp` are properly validated with null checks that throw appropriate RPC errors, making additional validation unnecessary.
Applied to files:
src/wallet/wallet.htest/functional/wallet_multiwallet.pysrc/wallet/rpc/wallet.cppsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cppsrc/wallet/rpc/util.cpp
📚 Learning: 2025-01-14T08:37:16.955Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6530
File: src/validation.cpp:360-362
Timestamp: 2025-01-14T08:37:16.955Z
Learning: The UpdateTransactionsFromBlock() method in txmempool.cpp takes parameters in the order: vHashUpdate, ancestor_size_limit, ancestor_count_limit. The size limit comes before the count limit.
Applied to files:
src/wallet/wallet.hsrc/wallet/test/wallet_tests.cppsrc/wallet/wallet.cpp
📚 Learning: 2025-12-17T13:58:26.891Z
Learnt from: kwvg
Repo: dashpay/dash PR: 7072
File: src/qt/walletcontroller.cpp:520-528
Timestamp: 2025-12-17T13:58:26.891Z
Learning: In Dash Qt wallet code, when leveraging upstream Bitcoin Core wallet capabilities (especially for operations like rescanning), prefer using the inherited signal-based mechanisms (e.g., ShowProgress signals) over adding explicit Qt progress dialogs to minimize upstream deviation and simplify future backports.
Applied to files:
src/wallet/wallet.hdoc/managing-wallets.mdsrc/wallet/wallet.cpp
📚 Learning: 2025-06-09T16:43:20.996Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6718
File: test/functional/test_framework/test_framework.py:2102-2102
Timestamp: 2025-06-09T16:43:20.996Z
Learning: In the test framework consolidation PR (#6718), user kwvg prefers to limit functional changes to those directly related to MasternodeInfo, avoiding scope creep even for minor improvements like error handling consistency.
Applied to files:
test/functional/wallet_multiwallet.pysrc/wallet/test/wallet_tests.cpp
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/{test,wallet/test}/**/*.{cpp,h} : Unit tests in src/test/ and src/wallet/test/ must use Boost::Test framework
Applied to files:
src/wallet/test/wallet_tests.cppconfigure.ac
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/wallet/**/*.{cpp,h} : Wallet implementation must use Berkeley DB and SQLite
Applied to files:
src/wallet/test/wallet_tests.cppsrc/wallet/wallet.cpp
📚 Learning: 2025-02-06T14:34:30.466Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6543
File: src/wallet/receive.cpp:240-251
Timestamp: 2025-02-06T14:34:30.466Z
Learning: Pull request #6543 is focused on move-only changes and refactoring, specifically backporting from Bitcoin. Behavior changes should be proposed in separate PRs.
Applied to files:
src/wallet/wallet.cpp
📚 Learning: 2025-07-14T10:11:05.011Z
Learnt from: kwvg
Repo: dashpay/dash PR: 6754
File: contrib/containers/guix/docker-compose.yml:18-19
Timestamp: 2025-07-14T10:11:05.011Z
Learning: In the Guix build process for Dash Core, the `guix.sigs` directory requires write access as signatures are written to it during the build process, and `dash-detached-sigs` may be updated with `git pull` operations, so both directories need rw permissions in the Docker volume mounts.
Applied to files:
doc/build-windows.md
📚 Learning: 2025-08-19T14:57:31.801Z
Learnt from: knst
Repo: dashpay/dash PR: 6692
File: src/llmq/blockprocessor.cpp:217-224
Timestamp: 2025-08-19T14:57:31.801Z
Learning: In PR #6692, knst acknowledged a null pointer dereference issue in ProcessBlock() method where LookupBlockIndex may return nullptr but is passed to gsl::not_null, and created follow-up PR #6789 to address it, consistent with avoiding scope creep in performance-focused PRs.
Applied to files:
src/net_processing.cpp
📚 Learning: 2025-11-24T16:41:22.457Z
Learnt from: CR
Repo: dashpay/dash PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:41:22.457Z
Learning: Applies to src/evo/**/*.{cpp,h} : Special transactions use payload serialization routines defined in src/evo/specialtx.h and must include appropriate special transaction types (ProRegTx, ProUpServTx, ProUpRegTx, ProUpRevTx)
Applied to files:
src/wallet/spend.cpp
🧬 Code graph analysis (7)
src/bitcoin-cli.cpp (2)
src/qt/rpcconsole.cpp (1)
reply(456-456)src/rpc/request.cpp (1)
reply(40-40)
src/wallet/test/coinselector_tests.cpp (1)
src/wallet/spend.cpp (2)
SelectCoins(515-694)SelectCoins(515-515)
src/rpc/util.cpp (9)
src/rpc/quorums.cpp (2)
ret(78-78)ret(144-144)src/rpc/blockchain.cpp (8)
ret(342-342)ret(388-388)ret(434-434)ret(1191-1191)ret(1335-1335)ret(1940-1940)ret(2242-2242)ret(2665-2665)src/wallet/rpc/coins.cpp (1)
ret(420-420)src/wallet/rpc/transactions.cpp (2)
ret(145-145)ret(684-684)src/rest.cpp (1)
ret(583-583)src/rpc/node.cpp (2)
ret(181-181)ret(187-187)src/qt/rpcconsole.cpp (2)
request(421-475)request(421-421)src/rpc/request.cpp (1)
request(31-31)src/rpc/server.cpp (1)
request(552-552)
src/wallet/wallet.h (1)
src/wallet/wallet.cpp (4)
transactionAddedToMempool(1332-1341)transactionAddedToMempool(1332-1332)transactionRemovedFromMempool(1343-1382)transactionRemovedFromMempool(1343-1343)
test/functional/wallet_multiwallet.py (2)
test/functional/test_framework/util.py (1)
assert_raises_rpc_error(132-148)src/wallet/rpc/wallet.cpp (2)
loadwallet(504-556)loadwallet(504-504)
src/wallet/spend.cpp (1)
src/primitives/transaction.h (1)
CalculateOutputValue(210-213)
src/bitcoin-util.cpp (1)
src/chain.h (1)
nBits(190-190)
🪛 markdownlint-cli2 (0.18.1)
doc/build-windows.md
21-21: Link text should be descriptive
(MD059, descriptive-link-text)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: linux64_tsan-build / Build source
- GitHub Check: arm-linux-build / Build source
- GitHub Check: linux64_fuzz-build / Build source
- GitHub Check: linux64_sqlite-build / Build source
- GitHub Check: linux64_ubsan-build / Build source
- GitHub Check: linux64-build / Build source
- GitHub Check: win64-build / Build source
- GitHub Check: mac-build / Build source
- GitHub Check: linux64_nowallet-build / Build source
- GitHub Check: Lint / Run linters
🔇 Additional comments (36)
src/bitcoin-util.cpp (3)
80-103: LGTM: Thread-safe refactoring eliminates data races.The changes correctly address TSAN concerns by passing
headerby value (giving each thread its own copy) and usingfound.exchange(true)to ensure only one thread writes toproposed_nonce. The atomic exchange operation guarantees that only the first thread to find a valid nonce will store its result, preventing concurrent writes.
120-125: LGTM: Correct thread creation with new signature.The
proposed_noncevariable is properly initialized and passed by reference to worker threads. The thread creation correctly passesheaderby value (each thread gets its own copy) and usesstd::reffor the sharedfoundandproposed_noncevariables, matching the updatedgrind_tasksignature.
130-135: LGTM: Safe read after thread synchronization.The code correctly waits for all threads to complete via
join()before readingproposed_nonce. This establishes a happens-before relationship that ensures the main thread sees the write performed by the winning worker thread, with no data race.src/test/fuzz/tx_pool.cpp (1)
204-204: LGTM! Const removal enables move optimization.Removing
constfrom the local variable allows the compiler to apply move semantics when returningtx. The variable is used read-only after construction, so behavior is unchanged.src/.clang-tidy (1)
10-10: LGTM! Static analysis addition for move semantics.Adding the
performance-no-automatic-movecheck enforces better move semantics optimization across the codebase. This check complements the const-removal changes seen in other files of this PR.Also applies to: 23-23
src/test/util/setup_common.cpp (1)
499-499: LGTM! Explicit type annotation for clarity.Making the type explicit as
CBlockinstead of usingautoensures proper copy elision and aligns with the move semantics improvements in this PR.src/addrman.cpp (3)
1194-1201: LGTM! Const removal enables move semantics.Removing
constfrom the local return value holder allows the compiler to apply move semantics when returning. This is a performance optimization with no behavior change.
1203-1210: LGTM! Const removal enables move semantics.Removing
constfrom the local return value holder allows the compiler to apply move semantics when returning. This is a performance optimization with no behavior change.
1212-1219: LGTM! Const removal enables move semantics.Removing
constfrom the local return value holder allows the compiler to apply move semantics when returning. This is a performance optimization with no behavior change.doc/fuzzing.md (1)
282-283: Microsoft documentation URL and Ubuntu capitalization verified as correct.The URL has been properly updated to
learn.microsoft.comand "Ubuntu" is correctly capitalized. The Microsoft Learn URL is valid and points to the correct .NET Core installation documentation for Linux.src/test/fuzz/txorphan.cpp (1)
76-76: LGTM: Cosmetic const removalThe removal of
constfromnew_txis a cosmetic change with no functional impact, as the variable is not reassigned after initialization. This change is part of the upstream backport and aligns with broader const-correctness adjustments in the PR.src/bitcoin-cli.cpp (1)
855-855: LGTM: Consistent const removalRemoving
constfrom thereplyvariable is consistent with similar changes throughout the PR. The variable is not modified after assignment, so this is purely a cosmetic change with no functional impact.configure.ac (1)
1589-1589: LGTM: Correct addition of dash-util targetAdding
build_bitcoin_utilto the gating condition is correct and necessary. This ensures that when dash-util is built, Boost dependencies are properly enabled. The change aligns with the PR's inclusion of bitcoin#26824, which fixes configure.ac for bitcoin-util builds.src/rpc/util.cpp (1)
536-536: LGTM: Consistent const removal in RPC handlerThe removal of
constfrom theretvariable is consistent with the broader pattern in this PR. The variable is not modified after assignment fromm_fun, making this a cosmetic change with no functional impact. This aligns with the upstream backport.src/wallet/test/coinselector_tests.cpp (1)
956-956: LGTM: Minor const-correctness adjustment.The removal of
constfrom the local variable is consistent with the broader const-correctness refactoring in this PR. The variable is not modified after initialization, so this change has no functional impact.src/wallet/rpc/util.cpp (1)
78-78: LGTM: Const-correctness alignment with return type.Removing
constfrom the local variable aligns with the function's return type and is consistent with the broader const-correctness refactoring in this PR. No functional impact.src/primitives/transaction.h (2)
20-20: LGTM: Required include for std::accumulate.The
<numeric>header is correctly included to support the newCalculateOutputValuefunction template.
209-213: LGTM: Clean utility function using standard algorithms.The
CalculateOutputValuetemplate function is well-implemented:
- Uses
std::accumulatefor a clean, idiomatic sum calculation- Template design allows use with both
CTransactionandCMutableTransaction- Inline placement in the header is appropriate for this small utility
- Initial value of
CAmount{0}is correctsrc/wallet/test/wallet_tests.cpp (2)
1559-1559: LGTM: Test updated for new transactionAddedToMempool signature.The call correctly reflects the removal of the
mempool_sequenceparameter from thetransactionAddedToMempoolmethod signature, as described in the PR's broader API changes.
1580-1580: LGTM: Test updated for new transactionAddedToMempool signature.The call correctly reflects the removal of the
mempool_sequenceparameter from thetransactionAddedToMempoolmethod signature, consistent with the API changes throughout the PR.src/wallet/rpc/wallet.cpp (1)
537-544: LoadWallet has internal protection via g_loading_wallet_set that prevents concurrent loading of the same wallet.The pre-check prevents loading an already-loaded wallet, but a TOCTOU window exists between releasing the
wallets_mutexlock (line 543) and callingLoadWallet(line 545). However,LoadWalletincludes its own protection mechanism at lines 287-291:auto result = WITH_LOCK(g_loading_wallet_mutex, return g_loading_wallet_set.insert(name)); if (!result.second) { error = Untranslated("Wallet already loading."); status = DatabaseStatus::FAILED_LOAD; return nullptr; }This prevents the primary race condition: concurrent loading attempts of the same wallet name will fail on the second attempt. The pre-check appears to serve as an early-validation optimization to provide a cleaner error message before attempting to load, rather than being the primary protection mechanism.
The secondary
AddWalletcheck (line 121 in wallet.cpp) prevents duplicate wallet objects by identity, providing an additional layer of safety.test/functional/wallet_multiwallet.py (1)
303-308: LGTM! Unified duplicate wallet error handling correctly implemented.The test assertions now correctly expect the uniform error code -35 (
RPC_WALLET_ALREADY_LOADED) with the messageWallet "w1" is already loaded.for both duplicate wallet loading scenarios. This aligns with the pre-load validation check added insrc/wallet/rpc/wallet.cppthat detects already-loaded wallets before attempting to load them, providing consistent error reporting regardless of how the duplicate load is attempted (by wallet name or by file path).doc/managing-wallets.md (1)
93-125: LGTM! Documentation improvements enhance clarity and accuracy.The documentation updates correctly:
- Standardize ellipsis characters (… instead of ...) for GUI menu items
- Add the GUI restore option (
Restore Wallet…) to complement the existing RPC guidance, providing users with more accessible wallet restoration methods- Improve capitalization consistency for menu paths (
Open WalletvsOpen wallet)These changes align with the upstream Bitcoin Core documentation improvements and make the wallet management guide more comprehensive and consistent.
src/validation.cpp (2)
1401-1419: Non-constresultbinding inAcceptToMemoryPoolis fineChanging
resultto a non-constMempoolAcceptResultdoes not alter behavior (it’s only read and then returned) and aligns with typical patterns for returning local results by value. No issues here.
1430-1443: DroppingconstfromresultinProcessNewPackageis safeBinding the lambda return to
auto resultinstead ofconst autois behaviorally equivalent here and keeps the value flexible for potential future moves or modifications. The surrounding control flow and uncache logic remain unchanged.src/wallet/wallet.cpp (2)
262-262: Relaxedstd::shared_ptr<CWallet>constness looks fineUsing non-const
std::shared_ptr<CWallet>locals forwallet/walletInstancehere is harmless and aligns with upstream, while the pointed-toCWalletremains mutable as before. No behavioral or lifetime regressions spotted.Also applies to: 346-346, 2930-2931
1332-1341: Mempool notification refactor is consistent and lock-safeThe updated
transactionAddedToMempool/transactionRemovedFromMempoolsignatures and implementations (nomempool_sequence) correctly:
- Lock
cs_walletbefore touchingmapWalletand callingSyncTransaction.- Use
RefreshMempoolStatusfor non-CONFLICT removals andSyncTransaction(TxStateInactive{})for CONFLICT removals.- Call
transactionRemovedFromMempool(..., MemPoolRemovalReason::BLOCK)fromblockConnected, which is safe withRecursiveMutex cs_wallet.This matches the intended upstream behavior for these callbacks.
Also applies to: 1343-1382, 1389-1395
src/wallet/wallet.h (1)
646-647: Wallet mempool notification overrides correctly matchinterfaces::Chain::NotificationsThe updated
transactionAddedToMempoolandtransactionRemovedFromMempooloverrides dropmempool_sequenceand now match the revisedinterfaces::Chain::Notificationssignatures, keeping the inheritance contract consistent.Also applies to: 668-668
src/interfaces/chain.h (1)
264-265: Chain notifications API update is complete and consistentThe
interfaces::Chain::Notificationsinterface has been properly updated:
transactionAddedToMempool(const CTransactionRef& tx, int64_t nAcceptTime)transactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason)All implementors match these new signatures:
CWalletdirectly implements both methods withoutmempool_sequenceNotificationsProxyinnode/interfaces.cppcorrectly adapts the underlyingCValidationInterface(which retainsmempool_sequence) to the newNotificationsinterface, properly stripping the parameter in the delegation callsThe implementation is consistent across the codebase.
src/wallet/spend.cpp (1)
11-11: Review comment is analyzing code that does not exist in this repositoryThe specific bugs and code patterns described do not match the current state of
src/wallet/spend.cpp. Key mismatches:
- Line 11 contains
#include <script/signingprovider.h>, not#include <primitives/transaction.h>- No
Assume()statements exist in the function (search returned no results)- No
current_feevariable exists anywhere in the wallet code (search across entiresrc/wallet/returned no results)- The claimed problematic lines (e.g., line 984 with
Assume(recipients_sum + change_amount == output_value), line 1056 with the invariant check) do not exist at those locations- Line 1000 claim is off by 8 lines;
change_amountis actually declared at line 992The actual implementation around these line ranges uses simpler logic with
change_and_fee,fee_needed, andchange_amountvariables, with no Assume statements or fee invariant checks like those described. The code structure in this file differs from the code being analyzed in the review comment.This suggests the reviewer was analyzing a different version of the code or upstream Bitcoin Core implementation rather than the current committed state of this PR.
Likely an incorrect or invalid review comment.
src/node/interfaces.cpp (3)
910-913: LGTM! Parameter removal correctly implemented.The adapter pattern is properly maintained:
mempool_sequenceis received fromCValidationInterfacebut intentionally discarded when forwarding toChain::Notifications, removing an unused parameter from the wallet interface.
914-917: LGTM! Consistent parameter removal.Correctly mirrors the pattern in
TransactionAddedToMempool, maintaining consistency across both notification methods.
1301-1308: LGTM! Call site correctly updated.The removal of the hardcoded
mempool_sequence = 0parameter confirms it was unused, and the update correctly aligns with the simplified interface.src/net_processing.cpp (3)
773-779: Helper declarations now use non-nullconst CBlockIndex¶metersSwitching
HeadersDirectFetchBlocksandUpdatePeerStateForReceivedHeadersfromconst CBlockIndex*toconst CBlockIndex&is consistent with their implementations and call sites, and encodes the existing non-null expectation in the type system without changing behavior.
Based on learnings, this matches the upstream Bitcoin Core backport and keeps divergence minimal.
3138-3201: Pointer-to-reference refactor inHeadersDirectFetchBlocksis mechanically correctAll uses of
pindexLastwere correctly converted tolast_header/&last_header(validity checks,nChainWork,GetBlockHash(),nHeight, andpprevaccess), with locking and control flow unchanged. This preserves the previous semantics while avoiding nullable parameters.
3203-3261:UpdatePeerStateForReceivedHeadersand its callers remain consistent after refactorThe function now takes
const CBlockIndex& last_headerand correctly useslast_header.GetBlockHash()andlast_header.nChainWorkwherepindexLastwas previously dereferenced.ProcessHeadersMessagepasses*pindexLastinto bothUpdatePeerStateForReceivedHeadersandHeadersDirectFetchBlocks, matching the former non-null pointer assumptions and upstream behavior.Also applies to: 3321-3325
…t.py after bitcoin#26192 Done to make it unify with Bitcoin Core, re-ordered line, removed duplicates and out-dated lines Without these changes wallet_multiwallet.py fails with error: AssertionError: Expected substring not found in error message: substring: 'Wallet "w1" is already loaded.' error message: 'Wallet file verification failed. Refusing to load database. Data file 'wallet_multiwallet_213/node0/regtest/wallets/wallet.dat' is already loaded.'.
f84e445 doc: Correct linked Microsoft URLs (Suriyaa Sundararuban) Pull request description: Update Microsoft-related links. Top commit has no ACKs. Tree-SHA512: 40c7b25a96772259fb04da1946d52f6aac9562262aef472ae75807bfbd246de47d72118140a12f7553037b94b89f95d69dea6ce30e611ac3d71a32d102355150
… methods 55696a0 wallet: remove `mempool_sequence` from `transactionRemovedFromMempool` (w0xlt) bf19069 wallet: remove `mempool_sequence` from `transactionAddedToMempool` (w0xlt) Pull request description: This PR removes `mempool_sequence` from `transactionRemovedFromMempool` and `transactionAddedToMempool`. `mempool_sequence` is not used in these methods, only in ZMQ notifications. ACKs for top commit: instagibbs: ACK bitcoin@55696a0 Tree-SHA512: 621e89230bcb6edfed83e2758601a2b093822fc2dc4e9bfb00487e340f2bc4c5ac3bf6df3ca00b7fe55bb3df15858820f2bf698f403d2e48b915dd9eb47b63e0
…ang-tidy check 9567bfe clang-tidy: Add `performance-no-automatic-move` check (Hennadii Stepanov) Pull request description: Split from bitcoin#26642 as [requested](bitcoin#26642 (comment)). For the problem description see https://clang.llvm.org/extra/clang-tidy/checks/performance/no-automatic-move.html. The following types are affected: - `std::pair<CAddress, NodeSeconds>` - `std::vector<CAddress>` - `UniValue`, also see bitcoin#25429 - `QColor` - `CBlock` - `MempoolAcceptResult` - `std::shared_ptr<CWallet>` - `std::optional<SelectionResult>` - `CTransactionRef`, which is `std::shared_ptr<const CTransaction>` ACKs for top commit: andrewtoth: ACK 9567bfe aureleoules: ACK 9567bfe Tree-SHA512: 9b6a5d539205b41d2c86402d384318ed2e1d89e66333ebd200a48fd7df3ce6f6c60a3e989eda5cc503fb34b8d82526f95e56776e1af51e63b49e3a1fef72dbcb
dc9bad5 Change dots to an ellipsis and fix capitalization (John Moffett) 9b158ae Update to mention restoring wallet via GUI (John Moffett) Pull request description: bitcoin@f9783b0 Recently added the ability to restore wallets via the GUI, but the current wallet guide says backups must be restored via RPC. ACKs for top commit: kouloumos: ACK dc9bad5 jarolrod: re-ACK dc9bad5 hebasto: re-ACK dc9bad5 Tree-SHA512: 325a0023ef10c75073b0288f69c99f01b029b0b7b64ae91e7ef72d4ab1fa4da60fe4cd1b4528c1c0d34617122d9aee3cd9cb32aef05a25493fc01e9ec2e6cc10
0f883df build: fix configuring with only bitcoin-util (fanquake) Pull request description: Fixes the issue presented in bitcoin#25037 in a single (easily backportable) diff, with no additional refactoring/changes. Can be tested with: ```bash ./configure \ --disable-tests \ --disable-bench \ --without-libs \ --without-daemon \ --without-gui \ --disable-fuzz-binary \ --without-utils \ --enable-util-util ``` ACKs for top commit: TheCharlatan: tACK 0f883df hebasto: ACK 0f883df, tested on Ubuntu 22.04. Tree-SHA512: 3682712405c360852c4edd90c171e21302154bf8789252c64083974a5c873cf04d97e8721c7916d5b2dafa6acd2b8dc32deecf550e90e03bcbbabbbbf75ce959
4bb91be debian: remove nonexistent files from copyright (fanquake) Pull request description: The removed files were dropped during a secp256k1 subtree update. Top commit has no ACKs. Tree-SHA512: 19ef1cf76908b5468265cc25b76abf8cf3a1dd0d5f7390f9cf4c5cd4c421c8cb04b5991ded7102add896d06555696a8059df37fd1d8f7374487a12dfa594c9cd
… issues faddb73 ci: Bump --combinedlogslen to debug intermittent issues (MarcoFalke) Pull request description: May help to debug intermittent issues such as bitcoin#26808 ACKs for top commit: fanquake: ACK faddb73 - if this is going to improve the chance of tracking down intermittent failures. Tree-SHA512: f844856ede71b9fb816c39bfba6241e35480db71bdc2e534d4746a666114bfc82f9dea804f70201fbf8af32eb579b7eab3c164a0bb2f77268b5554467ff6e97d
What was done?
Regular backports from Bitcoin Core v25
How Has This Been Tested?
Run unit & functional tests
Breaking Changes
N/A
Checklist: