Skip to content

backport: Bitcoin Core v0.26 backports (batch 2 rebuild)#7400

Draft
thepastaclaw wants to merge 5 commits into
dashpay:developfrom
thepastaclaw:backport-0.26-batch-2-rebuild
Draft

backport: Bitcoin Core v0.26 backports (batch 2 rebuild)#7400
thepastaclaw wants to merge 5 commits into
dashpay:developfrom
thepastaclaw:backport-0.26-batch-2-rebuild

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jul 2, 2026

Copy link
Copy Markdown

backport: Bitcoin Core v0.26 backports (batch 2 rebuild)

Issue being fixed or feature implemented

This restores the automated Bitcoin Core v0.26 backport batch 2 after the
original PR, #7290, was closed during cleanup and the old staging
branch was found to contain fork PR merge commits.

The replacement branch replays the same five verified backport commits cleanly
on top of current develop, preserving a linear reviewable history for the
upstream Dash PR.

What was done?

Rebuilt batch 2 from the underlying backport commits without the GitHub fork PR
merge commits:

This supersedes the closed PR #7290.

Backport Review Notes

How Has This Been Tested?

  • Cherry-picked all five commits cleanly onto current upstream/develop.
  • Verified the worktree is clean and the branch is ahead of upstream/develop
    by exactly five commits.
  • Ran git diff --check upstream/develop..HEAD.
  • Ran python3 -m py_compile on the changed functional/lint Python files.
  • Ran the local pre-PR review gate:
    code-review dashpay/dash upstream/develop backport-0.26-batch-2-rebuild
    with the rebuild recovery intent.
    Result: no significant issues found; recommendation: ship.

Breaking Changes

None expected beyond the behavior of the upstream Bitcoin Core backports
themselves.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone
    (for repository code-owners and collaborators only)

…equence`

272eb55 test: fix `include_immature_coinbase` logic in `get_utxos` (brunoerg)
a951c34 test: fix `interface_usdt_mempool` by mining a block after each test (brunoerg)
1557bf1 test: fix mature utxos addition to wallet in `mempool_package_limits` (brunoerg)
60ced90 test: fix intermittent issue in `feature_bip68_sequence` (brunoerg)

Pull request description:

  Fixes bitcoin#27129

  To avoid `bad-txns-premature-spend-of-coinbase` error,
  when getting a utxo (using `get_utxo`) to create a new
  transaction `get_utxo` shouldn't return (if possible)
  by default immature coinbase.

ACKs for top commit:
  achow101:
    ACK 272eb55
  pinheadmz:
    re-ACK 272eb55

Tree-SHA512: eae821c7833bf084d8b907c94876ed010a7925d2177c3013a0c61b69d9571df006da83397a19487d93b0d1fa415951152f0b8ad0de2a55d86c39f6917934f050
(cherry picked from commit 0eb65f9)
@thepastaclaw

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

thepastaclaw commented Jul 2, 2026

Copy link
Copy Markdown
Author

✅ Review complete (commit 682e3f1)

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b95c8732-061d-411c-9174-fa2415238f8b

📥 Commits

Reviewing files that changed from the base of the PR and between 818d9f2 and 682e3f1.

📒 Files selected for processing (27)
  • doc/release-notes-27302.md
  • src/Makefile.test_util.include
  • src/bench/wallet_balance.cpp
  • src/bench/wallet_loading.cpp
  • src/init.cpp
  • src/init/common.cpp
  • src/net.h
  • src/net_processing.cpp
  • src/net_processing.h
  • src/qt/test/test_main.cpp
  • src/rpc/blockchain.cpp
  • src/rpc/client.cpp
  • src/rpc/rawtransaction.cpp
  • src/rpc/util.cpp
  • src/rpc/util.h
  • src/test/fuzz/rpc.cpp
  • src/util/system.cpp
  • src/util/system.h
  • src/wallet/test/load_util.cpp
  • src/wallet/test/util.h
  • src/wallet/test/wallet_tests.cpp
  • test/functional/feature_config_args.py
  • test/functional/p2p_compactblocks.py
  • test/functional/rpc_psbt.py
  • test/functional/test_framework/test_node.py
  • test/functional/test_framework/util.py
  • test/lint/run-lint-format-strings.py
✅ Files skipped from review due to trivial changes (5)
  • src/rpc/blockchain.cpp
  • doc/release-notes-27302.md
  • src/util/system.h
  • src/test/fuzz/rpc.cpp
  • src/net.h
🚧 Files skipped from review as they are similar to previous changes (20)
  • src/qt/test/test_main.cpp
  • src/rpc/client.cpp
  • src/net_processing.h
  • src/Makefile.test_util.include
  • src/init.cpp
  • src/bench/wallet_balance.cpp
  • test/lint/run-lint-format-strings.py
  • src/rpc/util.h
  • test/functional/test_framework/util.py
  • src/rpc/util.cpp
  • src/wallet/test/util.h
  • src/init/common.cpp
  • src/util/system.cpp
  • test/functional/feature_config_args.py
  • test/functional/rpc_psbt.py
  • src/bench/wallet_loading.cpp
  • test/functional/p2p_compactblocks.py
  • src/wallet/test/wallet_tests.cpp
  • src/rpc/rawtransaction.cpp
  • src/net_processing.cpp

Walkthrough

This PR adds ignored-config startup handling with -allowignoredconf, including config-path caching and related functional coverage. It reworks net processing block in-flight tracking from a counter-backed map to a multimap and updates compact-block, blocktxn, download, and eviction logic. It also adds the descriptorprocesspsbt RPC plus descriptor private-expansion support, extracts shared wallet test load/unload helpers, and includes smaller test, lint, and release-note updates.

Estimated code review effort: 4 (Complex) | ~75 minutes

Suggested reviewers: PastaPastaPasta, knst

Possibly related PRs: dashpay/dash#7245

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change as a batch-2 backport rebuild.
Description check ✅ Passed The description is detailed and directly describes the backported commits and testing for this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/functional/p2p_compactblocks.py (1)

715-764: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Stale getblocktxn message masks the second reconstruction check.

stalling_peer is reused for a second announce_cmpct_block() call (line 747) without clearing its last_message["getblocktxn"] from the first block (or from earlier tests reusing the same connection, e.g. test_incorrect_blocktxn_response). The assert "getblocktxn" in peer.last_message inside announce_cmpct_block (line 728) will pass even if the node fails to send a fresh getblocktxn for the new block, silently weakening this check.

🐛 Proposed fix
         # Now test that delivering an invalid compact block won't break relay
 
+        stalling_peer.clear_getblocktxn()
         block, cmpct_block = announce_cmpct_block(node, stalling_peer)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/functional/p2p_compactblocks.py` around lines 715 - 764, The second use
of stalling_peer in test_compactblock_reconstruction_stalling_peer can pass on a
stale getblocktxn entry from a prior block, so the check in announce_cmpct_block
no longer verifies that a new request was sent. Update announce_cmpct_block or
the second call site to clear or snapshot peer.last_message before sending
msg_cmpctblock, then assert the fresh getblocktxn appears for that specific
compact block. Use the existing announce_cmpct_block helper and
stalling_peer.last_message to keep the assertion tied to the current block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/functional/p2p_compactblocks.py`:
- Around line 793-863: The repeated compact block reconstruction test leaves
stale request state on stalling_peer, which can make later iterations pass
without proving a new getblocktxn was issued. Update
test_compactblock_reconstruction_parallel_reconstruction to clear
stalling_peer’s getblocktxn state at the end of each num_missing loop iteration
alongside delivery_peer, inbound_peer, and outbound_peer, so each pass through
announce_cmpct_block and the subsequent assertions verify fresh behavior.

---

Outside diff comments:
In `@test/functional/p2p_compactblocks.py`:
- Around line 715-764: The second use of stalling_peer in
test_compactblock_reconstruction_stalling_peer can pass on a stale getblocktxn
entry from a prior block, so the check in announce_cmpct_block no longer
verifies that a new request was sent. Update announce_cmpct_block or the second
call site to clear or snapshot peer.last_message before sending msg_cmpctblock,
then assert the fresh getblocktxn appears for that specific compact block. Use
the existing announce_cmpct_block helper and stalling_peer.last_message to keep
the assertion tied to the current block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e8a0be1e-3e91-4f16-8ccf-15400f575441

📥 Commits

Reviewing files that changed from the base of the PR and between 59d36a9 and 775b042.

📒 Files selected for processing (28)
  • doc/release-notes-27302.md
  • src/Makefile.test_util.include
  • src/bench/wallet_balance.cpp
  • src/bench/wallet_loading.cpp
  • src/init.cpp
  • src/init/common.cpp
  • src/net.h
  • src/net_processing.cpp
  • src/net_processing.h
  • src/qt/test/test_main.cpp
  • src/rpc/blockchain.cpp
  • src/rpc/client.cpp
  • src/rpc/rawtransaction.cpp
  • src/rpc/util.cpp
  • src/rpc/util.h
  • src/test/fuzz/rpc.cpp
  • src/util/system.cpp
  • src/util/system.h
  • src/wallet/test/load_util.cpp
  • src/wallet/test/util.h
  • src/wallet/test/wallet_tests.cpp
  • test/functional/feature_config_args.py
  • test/functional/mempool_package_limits.py
  • test/functional/p2p_compactblocks.py
  • test/functional/rpc_psbt.py
  • test/functional/test_framework/test_node.py
  • test/functional/test_framework/util.py
  • test/lint/run-lint-format-strings.py

Comment thread test/functional/p2p_compactblocks.py

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Policy gate: an agent-reported missing upstream prerequisite was restored as a blocking finding. This PR is a full Bitcoin backport, and omitted upstream hunks require their prerequisite PRs unless the finding is explicitly allowlisted (intentional_exclusion / policy_override). The agent's original evidence is preserved in the finding(s) below.

Prior verifier summary (overridden by policy gate): One real blocking bug: the compact-block READ_STATUS_FAILED branch (net_processing.cpp:4934-4945) removes the in-flight request but falls through and can still send GETBLOCKTXN for a request it just removed. Upstream fixed this immediately in bitcoin#27743 (d972695) and it should be applied here as part of the bitcoin#27626 backport. Otherwise the backport is clean: five well-formed cherry-picks, Dash-specific adaptations verified, no missing prerequisites that materially matter.

Note: canonical verifier/policy action is REQUEST_CHANGES, but GitHub does not allow this account to request changes on its own PR, so the public review is posted as a COMMENT while preserving the blocking findings.

🔴 4 blocking | 💬 2 nitpick(s)

All verified findings
  • [BLOCKING] src/net_processing.cpp:4934-4945: READ_STATUS_FAILED non-first-in-flight branch falls through instead of returning
    When partialBlock.InitData() returns READ_STATUS_FAILED for a non-first-in-flight parallel compact-block request, the else branch calls RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId()) but does not return. Execution falls through to the BlockTransactionsRequest req; block below, where the high-bandwidth branch at line 4963-4972 can still push a GETBLOCKTXN for a block we just removed from our in-flight map. When the peer responds with BLOCKTXN, that message will be treated as unexpected (no matching in-flight entry) and dropped, wasting a slot in the parallel-download budget and hurting recovery time — exactly the scenario bitcoin#27626 was meant to improve. Upstream landed the fix in bitcoin#27743 (d972695797, "Unconditionally return when compact block status == READ_STATUS_FAILED") right after bitcoin#27626 and it should be pulled into this batch (or applied inline) bef...

  • [NITPICK] src/rpc/rawtransaction.cpp:2000-2018: descriptorprocesspsbt help references segwit, Taproot, and DEFAULT sighash that Dash does not support
    The help text carries over upstream's Bitcoin-specific language: the description says "Update all segwit inputs..." and sighashtype advertises "DEFAULT" with a default of "DEFAULT for Taproot, ALL otherwise". Dash has no segwit and no Taproot, and ParseSighashString (src/core_read.cpp) rejects "DEFAULT" — a user copying sighashtype="DEFAULT" from this help will hit "DEFAULT is not a valid sighash parameter.". The RPC itself works correctly on legacy inputs because the null default resolves to SIGHASH_ALL in the C++ path, so this is docs-only, but the help should drop DEFAULT from the enumeration, reword the default to "ALL", and change the leading sentence to reflect Dash's legacy-inputs reality.

  • [NITPICK] test/functional/mempool_package_limits.py:1-3: bitcoin#27177 backport silently omits interface_usdt_mempool.py sub-fix
    Upstream bitcoin#27177 bundles four sub-commits, one of which (a951c34f17) adds self.generate(self.wallet, 1) after each subtest in test/functional/interface_usdt_mempool.py. That file has never been backported to Dash (its parent bitcoin#26531 mempool-tracepoints stack is absent), so this Dash backport skips that hunk without a note. It is inert — there is nothing in Dash for the fix to apply to — but the PR advertises a full backport of bitcoin#27177, so the omission is worth recording explicitly (release notes, a comment in non-backported.txt, or the PR description) rather than silently dropping.

  • [BLOCKING] test/functional/mempool_package_limits.py:1-3: Squashed bitcoin#27177 omits interface_usdt_mempool.py sub-fix (file doesn't exist in Dash)
    Upstream bitcoin#27177 (Merge bitcoin#27177) bundles four sub-commits: 272eb55 (get_utxos immature-coinbase fix), a951c34 (interface_usdt_mempool.py: mine a block after each test), 1557bf1 (mempool_package_limits.py mature-utxo fix), and 60ced90 (feature_bip68_sequence.py fix). This Dash backport (f454560) only touches test/functional/mempool_package_limits.py (3 lines) plus the shared get_utxos() helper in test_framework/wallet.py, and feature_bip68_sequence.py already correctly passes include_immature_coinbase=False. The a951c34 sub-fix for interface_usdt_mempool.py has no counterpart change in this PR because Dash has never backported that USDT mempool tracepoint test file — confirmed via git merge-base --is-ancestor 9f55773a37 HEAD returning false (9f55773 being an earlier upstream commit that touches the same file). This is not a defect: the file genuinely do...

  • [BLOCKING] test/functional/interface_usdt_mempool.py:176-327: Missing prerequisite: bitcoin#26531
    bitcoin#27177 includes commit a951c34, which adds self.generate(self.wallet, 1) after each mempool USDT tracepoint subtest in test/functional/interface_usdt_mempool.py. Dash's base does not have this file at all, so this part of the upstream PR is omitted. The missing file and tracepoint test stack come from bitcoin#26531 (Merge bitcoin/bitcoin#26531: mempool: Add mempool tracepoints). This is a soft prerequisite gap because the missing content is test-only and the absent USDT tracing subsystem is not used by the applied Dash hunk, but a claimed full backport of bitcoin#27177 is incomplete without the earlier tracepoint backport or an explicit exclusion. --- Policy gate (backport-prereq-restore): For full upstream backport PRs, a missing prerequisite is blocking unless the finding is explicitly allowlisted (e.g. intentional_exclusion: true or a matching entry in `polic...

  • [BLOCKING] src/util/system.cpp:1000-1013: Missing prerequisite: bitcoin#27419
    bitcoin#27302 was merged upstream after bitcoin#27419 moved ArgsManager/config parsing from src/util/system.* into src/common/args.* and src/common/config.cpp. Upstream bitcoin#27302 modifies ArgsManager::GetConfigFilePath() in src/common/args.cpp, stores m_config_path in src/common/args.h, and updates config reading in src/common/config.cpp. Dash lacks those common args/config files, so this PR ports the same logic into the older src/util/system.cpp / src/util/system.h layout instead. That is a clean workaround, not a build blocker, but by origin the missing upstream content is bitcoin#27419 rather than a Dash-specific divergence. --- Policy gate (backport-prereq-restore): For full upstream backport PRs, a missing prerequisite is blocking unless the finding is explicitly allowlisted (e.g. intentional_exclusion: true or a matching entry in policy_overrides). The...

Comment thread src/net_processing.cpp
Comment on lines 4934 to 4945
} else if (status == READ_STATUS_FAILED) {
// Duplicate txindexes, the block is now in-flight, so just request it
std::vector<CInv> vInv(1);
vInv[0] = CInv(MSG_BLOCK, blockhash);
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
return;
if (first_in_flight) {
// Duplicate txindexes, the block is now in-flight, so just request it
std::vector<CInv> vInv(1);
vInv[0] = CInv(MSG_BLOCK, blockhash);
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
return;
} else {
// Give up for this peer and wait for other peer(s)
RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId());
}
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🔴 Blocking: READ_STATUS_FAILED non-first-in-flight branch falls through instead of returning

When partialBlock.InitData() returns READ_STATUS_FAILED for a non-first-in-flight parallel compact-block request, the else branch calls RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId()) but does not return. Execution falls through to the BlockTransactionsRequest req; block below, where the high-bandwidth branch at line 4963-4972 can still push a GETBLOCKTXN for a block we just removed from our in-flight map. When the peer responds with BLOCKTXN, that message will be treated as unexpected (no matching in-flight entry) and dropped, wasting a slot in the parallel-download budget and hurting recovery time — exactly the scenario bitcoin#27626 was meant to improve. Upstream landed the fix in bitcoin#27743 (d972695797, "Unconditionally return when compact block status == READ_STATUS_FAILED") right after bitcoin#27626 and it should be pulled into this batch (or applied inline) before merge.

Suggested change
} else if (status == READ_STATUS_FAILED) {
// Duplicate txindexes, the block is now in-flight, so just request it
std::vector<CInv> vInv(1);
vInv[0] = CInv(MSG_BLOCK, blockhash);
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
return;
if (first_in_flight) {
// Duplicate txindexes, the block is now in-flight, so just request it
std::vector<CInv> vInv(1);
vInv[0] = CInv(MSG_BLOCK, blockhash);
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
return;
} else {
// Give up for this peer and wait for other peer(s)
RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId());
}
}
} else if (status == READ_STATUS_FAILED) {
if (first_in_flight) {
// Duplicate txindexes, the block is now in-flight, so just request it
std::vector<CInv> vInv(1);
vInv[0] = CInv(MSG_BLOCK, blockhash);
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));
} else {
// Give up for this peer and wait for other peer(s)
RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId());
}
return;
}

source: ['codex']

Comment thread src/rpc/rawtransaction.cpp Outdated
Comment on lines +2000 to +2018
"\nUpdate all segwit inputs in a PSBT with information from output descriptors, the UTXO set or the mempool. \n"
"Then, sign the inputs we are able to with information from the output descriptors. ",
{
{"psbt", RPCArg::Type::STR, RPCArg::Optional::NO, "The transaction base64 string"},
{"descriptors", RPCArg::Type::ARR, RPCArg::Optional::NO, "An array of either strings or objects", {
{"", RPCArg::Type::STR, RPCArg::Optional::OMITTED, "An output descriptor"},
{"", RPCArg::Type::OBJ, RPCArg::Optional::OMITTED, "An object with an output descriptor and extra information", {
{"desc", RPCArg::Type::STR, RPCArg::Optional::NO, "An output descriptor"},
{"range", RPCArg::Type::RANGE, RPCArg::Default{1000}, "Up to what index HD chains should be explored (either end or [begin,end])"},
}},
}},
{"sighashtype", RPCArg::Type::STR, RPCArg::Default{"DEFAULT for Taproot, ALL otherwise"}, "The signature hash type to sign with if not specified by the PSBT. Must be one of\n"
" \"DEFAULT\"\n"
" \"ALL\"\n"
" \"NONE\"\n"
" \"SINGLE\"\n"
" \"ALL|ANYONECANPAY\"\n"
" \"NONE|ANYONECANPAY\"\n"
" \"SINGLE|ANYONECANPAY\""},

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

💬 Nitpick: descriptorprocesspsbt help references segwit, Taproot, and DEFAULT sighash that Dash does not support

The help text carries over upstream's Bitcoin-specific language: the description says "Update all segwit inputs..." and sighashtype advertises "DEFAULT" with a default of "DEFAULT for Taproot, ALL otherwise". Dash has no segwit and no Taproot, and ParseSighashString (src/core_read.cpp) rejects "DEFAULT" — a user copying sighashtype="DEFAULT" from this help will hit "DEFAULT is not a valid sighash parameter.". The RPC itself works correctly on legacy inputs because the null default resolves to SIGHASH_ALL in the C++ path, so this is docs-only, but the help should drop DEFAULT from the enumeration, reword the default to "ALL", and change the leading sentence to reflect Dash's legacy-inputs reality.

source: ['claude']

Comment thread src/util/system.cpp
Comment on lines 1000 to 1013
@@ -1008,9 +1009,12 @@ bool ArgsManager::ReadConfigFiles(std::string& error, bool ignore_invalid_keys)
LOCK(cs_args);
m_settings.ro_config.clear();
m_config_sections.clear();
m_config_path = AbsPathForConfigVal(GetPathArg("-conf", BITCOIN_CONF_FILENAME), /*net_specific=*/false);
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🔴 Blocking: Missing prerequisite: bitcoin#27419

bitcoin#27302 was merged upstream after bitcoin#27419 moved ArgsManager/config parsing from src/util/system.* into src/common/args.* and src/common/config.cpp. Upstream bitcoin#27302 modifies ArgsManager::GetConfigFilePath() in src/common/args.cpp, stores m_config_path in src/common/args.h, and updates config reading in src/common/config.cpp. Dash lacks those common args/config files, so this PR ports the same logic into the older src/util/system.cpp / src/util/system.h layout instead. That is a clean workaround, not a build blocker, but by origin the missing upstream content is bitcoin#27419 rather than a Dash-specific divergence.


Policy gate (backport-prereq-restore): For full upstream backport PRs, a missing prerequisite is blocking unless the finding is explicitly allowlisted (e.g. intentional_exclusion: true or a matching entry in policy_overrides). The agent's original evidence above is the basis for this block; either backport the prerequisite or annotate the intentional exclusion in the PR description.

source: ['codex-backport-reviewer']

@thepastaclaw

Copy link
Copy Markdown
Author

Addressed CodeRabbit p2p_compactblocks.py request-state comments in be7930d.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Latest push be7930d adds the two missing stalling_peer.clear_getblocktxn() calls in test/functional/p2p_compactblocks.py; that latest delta looks correct and introduces no new code-defect blocker. However, every prior finding from 775b042 remains valid at the current head: the compact-block READ_STATUS_FAILED fallthrough is still present, bitcoin#27177 still omits the interface_usdt_mempool sub-fix because bitcoin#26531 is absent, bitcoin#27302 is still layered onto the pre-bitcoin#27419 args/config layout, and descriptorprocesspsbt help still carries Bitcoin-only segwit/Taproot/DEFAULT wording. New latest-delta finding: the sixth test-fix commit should be reflected in the PR body/commit provenance before merge.

🔴 3 blocking | 🟡 1 suggestion(s) | 💬 1 nitpick(s)

Carried-forward prior findings

  • [BLOCKING] src/net_processing.cpp:4934-4945: READ_STATUS_FAILED non-first-in-flight branch falls through instead of returning
    Verified at HEAD (be7930d): when partialBlock.InitData() returns READ_STATUS_FAILED for a non-first-in-flight parallel compact-block request, the else branch at line 4941-4944 calls RemoveBlockRequest(pindex->GetBlockHash(), pfrom.GetId()) but does not return. Execution falls through into the BlockTransactionsRequest req; construction at line 4947; because InitData failed the reconstructor cannot tell which txs are available so req.indexes is typically non-empty, and with first_in_flight false control reaches the highbandwidth branch at 4963-4972 which will push a GETBLOCKTXN for a hash just removed from mapBlocksInFlight. The peer's subsequent BLOCKTXN is then dropped as unexpected, wasting a slot in the parallel-download budget and defeating the recovery scenario bitcoin#27626 was intended to enable. Upstream fixed this in bitcoin#27743 (d972695797, "Unconditionally return when compact block status == READ_STATUS_FAILED"), which lives between the bitcoin#27626 and bitcoin#27666 commits already carried in this batch. Note: the latest push adds stalling_peer.clear_getblocktxn() calls in the functional test, which masks downstream test symptoms without applying the actual production fix.

  • [BLOCKING] test/functional/mempool_package_limits.py:1-3: Squashed bitcoin#27177 backport omits interface_usdt_mempool.py sub-fix (missing prerequisite bitcoin#26531)
    Upstream bitcoin#27177 bundles four sub-commits, one of which (a951c34f17, test: fix interface_usdt_mempool by mining a block after each test) modifies test/functional/interface_usdt_mempool.py. That file is confirmed absent from Dash at HEAD because the underlying USDT mempool-tracepoints stack (bitcoin#26531, mempool: Add mempool tracepoints) has never been backported. The Dash squashed commit f454560f83 advertises a full backport of bitcoin#27177 and applies the other three sub-fixes, but silently drops the fourth with no PR-body annotation, release-note fragment, or test/util/data/non-backported.txt entry. Per the backport-prereq policy, an omitted upstream hunk driven by an absent upstream prerequisite is a missing prerequisite (bitcoin#26531), not a Dash-native divergence. Either backport bitcoin#26531 (or the specific test file) or add an explicit intentional-exclusion note before merging.

  • [BLOCKING] src/util/system.cpp:1000-1013: bitcoin#27302 layered onto pre-bitcoin#27419 layout (missing prerequisite bitcoin#27419)
    Upstream bitcoin#27302 was merged after bitcoin#27419 moved ArgsManager/config parsing from src/util/system.* into src/common/args.* and src/common/config.cpp, and bitcoin#27302's actual diff modifies ArgsManager::GetConfigFilePath() in src/common/args.cpp, stores m_config_path in src/common/args.h, and updates config reading in src/common/config.cpp. src/common/args.cpp, src/common/args.h, and src/common/config.cpp are confirmed absent from Dash at HEAD, so this PR ports the same logic into the pre-move src/util/system.{cpp,h} layout instead. The port is functionally equivalent and covered by feature_config_args.py, but by upstream origin the missing content traces to bitcoin#27419, not to a Dash-intentional divergence. Per the backport-prereq policy for full-upstream backport PRs, either land bitcoin#27419 first or explicitly annotate the layout divergence in the PR body / non-backported tracking.

  • [NITPICK] src/rpc/rawtransaction.cpp:2000-2018: descriptorprocesspsbt help references segwit, Taproot, and DEFAULT sighash that Dash does not support
    Help text carries over upstream's Bitcoin-specific wording verbatim: line 2000 opens with "Update all segwit inputs in a PSBT...", line 2011 defaults sighashtype to "DEFAULT for Taproot, ALL otherwise", and line 2012 lists "DEFAULT" as a valid value. Dash has no segwit and no Taproot, and src/core_read.cpp's sighash parser does not handle the literal string DEFAULT (verified via grep — no DEFAULT handling in ParseSighashString), so a user copying sighashtype="DEFAULT" from the help will hit a parse error. The RPC itself works correctly on legacy inputs because the null default resolves to SIGHASH_ALL in C++, so this is docs-only. Suggest dropping DEFAULT from the enumeration, changing the default description to "ALL", and rewording the leading sentence to reflect Dash's legacy-inputs reality.

New finding in latest delta

  • [SUGGESTION] test/functional/p2p_compactblocks.py:747-863: Tip commit adapts an upstream-backported test in the same stack; message and PR body should reflect the sixth commit
    Commit be7930dc65 test: clear compact block request state between checks adds two stalling_peer.clear_getblocktxn() calls to test/functional/p2p_compactblocks.py, which was itself just added by d7f359b35e (part of the bitcoin#27626 backport, four commits earlier in the same stack). The commit has no upstream cherry-pick trailer, no body, and is not one of the five backport commits the PR description claims to replay (git rev-list --count develop..HEAD returns 6, not 5). The change itself is legitimate test hygiene, but as permanent Dash history it reads like an unattributed drive-by fix. Reword the commit message to note it is a Dash-authored adaptation of the bitcoin#27626 test (e.g. subject test: clear compact block request state between checks (adapt bitcoin#27626 backport) with a short body explaining the state-bleed being fixed), and update the PR description to acknowledge the sixth commit. Keeping it as a separate commit is fine — preserving the upstream backport byte-for-byte is a defensible trade-off.
Prior finding reconciliation
  • prior-1: STILL VALID — Verified src/net_processing.cpp:4934-4945 at be7930d — the else branch still lacks a return before the BlockTransactionsRequest construction at line 4947. Carried forward as findings[0].
  • prior-2: STILL VALID — test/functional/interface_usdt_mempool.py confirmed absent at HEAD; bitcoin#27177 squashed backport still omits the a951c34 sub-fix. Consolidated with prior-3/prior-6 into findings[1].
  • prior-3: STILL VALID — File absent, bitcoin#26531 (mempool tracepoints) not backported. Consolidated with prior-2/prior-6 into findings[1].
  • prior-4: STILL VALID — src/common/args.cpp, src/common/args.h, and src/common/config.cpp confirmed absent at HEAD; bitcoin#27302 still layered onto pre-bitcoin#27419 ArgsManager layout. Carried forward as findings[2].
  • prior-5: STILL VALID — Verified src/rpc/rawtransaction.cpp:2000-2018 unchanged at HEAD; core_read.cpp has no DEFAULT sighash handling. Carried forward as findings[3].
  • prior-6: STILL VALID (consolidated) — Same underlying issue as prior-2/prior-3 at nitpick severity. Consolidated into the single blocking finding[1] to avoid duplication.

Note: GitHub does not allow me to submit REQUEST_CHANGES on my own PR, so this is posted as a COMMENT while preserving the verified blocking findings.

@thepastaclaw thepastaclaw force-pushed the backport-0.26-batch-2-rebuild branch from be7930d to 3191232 Compare July 2, 2026 06:08
@thepastaclaw

Copy link
Copy Markdown
Author

Force-pushed updated five-commit branch at 319123215871672d386a9f1b95b2d3862e662f66.

Addressed the review items from the prior head:

Validation run locally: git diff --check upstream/develop..HEAD and python3 -m py_compile on the changed functional/lint Python files.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

@thepastaclaw, thanks for the detailed update. Noted the fixes folded into the respective backport commits:

Triggering a fresh review of the updated branch at 31912321.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/wallet/test/load_util.cpp`:
- Around line 18-32: `TestLoadWallet` is using the result of `CWallet::Create`
without checking for failure, so it may register or initialize a null wallet.
Update this helper to mirror the production loader flow: verify the `wallet`
returned by `CWallet::Create` before calling `AddWallet`, `NotifyWalletLoaded`,
or `postInitProcess`, and return early if creation failed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68d6719c-e2c7-4fda-9e49-6acb8c728c3d

📥 Commits

Reviewing files that changed from the base of the PR and between 775b042 and 3191232.

📒 Files selected for processing (27)
  • doc/release-notes-27302.md
  • src/Makefile.test_util.include
  • src/bench/wallet_balance.cpp
  • src/bench/wallet_loading.cpp
  • src/init.cpp
  • src/init/common.cpp
  • src/net.h
  • src/net_processing.cpp
  • src/net_processing.h
  • src/qt/test/test_main.cpp
  • src/rpc/blockchain.cpp
  • src/rpc/client.cpp
  • src/rpc/rawtransaction.cpp
  • src/rpc/util.cpp
  • src/rpc/util.h
  • src/test/fuzz/rpc.cpp
  • src/util/system.cpp
  • src/util/system.h
  • src/wallet/test/load_util.cpp
  • src/wallet/test/util.h
  • src/wallet/test/wallet_tests.cpp
  • test/functional/feature_config_args.py
  • test/functional/p2p_compactblocks.py
  • test/functional/rpc_psbt.py
  • test/functional/test_framework/test_node.py
  • test/functional/test_framework/util.py
  • test/lint/run-lint-format-strings.py
✅ Files skipped from review due to trivial changes (5)
  • src/rpc/client.cpp
  • src/net.h
  • src/rpc/blockchain.cpp
  • src/util/system.h
  • doc/release-notes-27302.md
🚧 Files skipped from review as they are similar to previous changes (21)
  • src/net_processing.h
  • src/qt/test/test_main.cpp
  • src/init/common.cpp
  • src/test/fuzz/rpc.cpp
  • src/wallet/test/util.h
  • test/functional/rpc_psbt.py
  • src/rpc/util.cpp
  • src/Makefile.test_util.include
  • test/functional/test_framework/test_node.py
  • src/init.cpp
  • test/lint/run-lint-format-strings.py
  • src/bench/wallet_loading.cpp
  • src/bench/wallet_balance.cpp
  • src/rpc/util.h
  • src/wallet/test/wallet_tests.cpp
  • test/functional/test_framework/util.py
  • test/functional/feature_config_args.py
  • src/rpc/rawtransaction.cpp
  • test/functional/p2p_compactblocks.py
  • src/util/system.cpp
  • src/net_processing.cpp

Comment thread src/wallet/test/load_util.cpp

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Latest delta (be7930d..3191232) resolves the two prior blocking/nitpick findings on the code side: READ_STATUS_FAILED now returns unconditionally in both first-in-flight and give-up branches at src/net_processing.cpp:4934-4944, and the descriptorprocesspsbt help no longer references segwit/Taproot/DEFAULT sighash. The two prior missing-prerequisite blockers (bitcoin#26531 for interface_usdt_mempool.py; bitcoin#27419 for the args/config split) are now explicitly documented as intentional Dash-side exclusions/adaptations in the PR body and verified inert in the current tree. Two carried-over minor items remain: the descriptorprocesspsbt help still advertises 'the UTXO set' as a lookup source even though Dash's ProcessPSBT deliberately skips that fallback, and the folded bitcoin#27743 fix is not recorded in the c6c26cf commit message.

🟡 1 suggestion(s) | 💬 1 nitpick(s)

Findings not posted inline (2)

These findings could not be anchored to the current diff, but they are still part of this review.

  • [NITPICK] src/rpc/rawtransaction.cpp:2000-2001: descriptorprocesspsbt help still advertises UTXO set lookup that Dash does not perform — The Dash-adapted help text at line 2000 says descriptorprocesspsbt updates legacy inputs from output descriptors, the UTXO set or the mempool. But ProcessPSBT at src/rpc/rawtransaction.cpp:282-294 only fills legacy non_witness_utxo data from g_txindex or the mempool, and the comment at line...
  • [SUGGESTION] <commit:c6c26cf29e>:1: Folded bitcoin#27743 fix is not disclosed in the c6c26cf commit message — Commit c6c26cf ('Merge bitcoin#27626: Parallel compact block downloads, take 3') carries a single (cherry picked from commit 27033bcae2d52e6c4738106fc2276082891ae59d) trailer and lists only the six sub-commits of upstream bitcoin#27626, yet the diff also folds in bitcoin#2774...
🤖 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 `<commit:c6c26cf29e>`:
- [SUGGESTION] <commit:c6c26cf29e>:1: Folded bitcoin#27743 fix is not disclosed in the c6c26cf29e commit message
  Commit c6c26cf29e ('Merge bitcoin/bitcoin#27626: Parallel compact block downloads, take 3') carries a single `(cherry picked from commit 27033bcae2d52e6c4738106fc2276082891ae59d)` trailer and lists only the six sub-commits of upstream bitcoin#27626, yet the diff also folds in bitcoin/bitcoin#27743 (`d972695797`, the READ_STATUS_FAILED unconditional-return fix). That rationale lives only in the PR body, which does not persist into `git log` / `git blame` after merge. A future blame of the `return;` at src/net_processing.cpp:4944 will land here without provenance, and diffing this commit against `27033bcae2...` will show an unexplained extra hunk. Amend the commit body before merge to add a short note such as `Also includes bitcoin/bitcoin#27743 (d972695797): Unconditionally return when compact block status == READ_STATUS_FAILED.` so provenance is self-contained in permanent history.
Prior finding reconciliation
  • READ_STATUS_FAILED non-first-in-flight branch falls through instead of returning — Fixed: delta moves return; outside the if/else at src/net_processing.cpp:4941-4944, so both the first_in_flight GETDATA branch and the else RemoveBlockRequest branch fall through to a single unconditional return;. Matches upstream bitcoin#27743.
  • Squashed bitcoin#27177 backport omits interface_usdt_mempool.py sub-fix (missing prerequisite bitcoin#26531) — Intentionally deferred and now documented in the PR body's Backport Review Notes. Verified no interface_usdt_mempool.py file exists in Dash's test tree, and bitcoin#26531 is not reachable from develop/HEAD. The applicable Dash hunks (get_utxos include_immature_coinbase, mempool_package_limits.py, feature_bip68_sequence.py-already-passing) are present. Marked as intentional_exclusion.
  • bitcoin#27302 layered onto pre-bitcoin#27419 layout (missing prerequisite bitcoin#27419) — Intentionally deferred and now documented in the PR body. Verified src/common/args.* does not exist in Dash. bitcoin#27302 was correctly ported into the existing src/util/system.{cpp,h}: GetConfigFilePath() at system.cpp:1000, m_config_path, and -allowignoredconf detection at ~lines 1101-1127, with init/common.cpp:153 consuming the new accessor. Functionally equivalent to upstream. Marked as intentional_exclusion.
  • Tip commit adapts an upstream-backported test in the same stack; message and PR body should reflect the sixth commit — Fixed: the prior tip test-adaptation commit is folded into the bitcoin#27626 backport commit c6c26cf as sub-commit d7f359b. Branch is now exactly 5 commits ahead of develop, matching the PR body. A narrower residual concern about the commit message not naming the folded-in bitcoin#27743 is captured as a new suggestion above.
  • descriptorprocesspsbt help references segwit, Taproot, and DEFAULT sighash that Dash does not support — Fixed: delta rewrites line 2000 to 'Update all legacy inputs', drops the DEFAULT enum entry, and sets sighashtype Default to 'ALL' at line 2011 with only ALL/NONE/SINGLE (+ANYONECANPAY variants) listed. A separate but related help-text inaccuracy about UTXO-set lookup is captured as a new nitpick above.

Note: GitHub does not allow me to approve my own PR, so this is posted as a COMMENT review while preserving the verified nonblocking findings.

@thepastaclaw thepastaclaw force-pushed the backport-0.26-batch-2-rebuild branch from 3191232 to e4ea5c3 Compare July 2, 2026 06:47
@thepastaclaw

Copy link
Copy Markdown
Author

Force-pushed updated five-commit branch at e4ea5c3b198d260ca78cecf3457bb57a9307e51c.

Addressed CodeRabbit’s TestLoadWallet finding by folding a null guard for CWallet::Create into the wallet-helper backport commit. Local validation: git diff --check; stack remains 5 commits over develop.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

@thepastaclaw, thanks for the update. Noted that the TestLoadWallet null-guard for CWallet::Create has been folded into the wallet-helper backport commit at e4ea5c3b. Triggering a fresh review of the updated branch.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
src/wallet/test/load_util.cpp (1)

18-32: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Null check for CWallet::Create still missing.

wallet from CWallet::Create can be nullptr on failure, but it's used unconditionally at lines 23/25/27/29 (AddWallet, NotifyWalletLoaded, wallet->postInitProcess()). This exact gap was flagged in a prior review round on this same line range. The PR discussion states a null guard for CWallet::Create was folded into this commit, but the current file content still shows no such guard — please confirm the guard actually landed here.

🐛 Proposed fix
     bilingual_str error;
     std::vector<bilingual_str> warnings;
     auto wallet = CWallet::Create(context, "", std::move(database), create_flags, error, warnings);
+    if (!wallet) {
+        return nullptr;
+    }
     if (context.coinjoin_loader) {
         // TODO: see CreateWalletWithoutChain
         AddWallet(context, wallet);
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/wallet/test/load_util.cpp` around lines 18 - 32, `TestLoadWallet` still
uses the result of `CWallet::Create` without checking for null. Add a guard
immediately after the `CWallet::Create` call in `TestLoadWallet` so failures are
handled before `AddWallet`, `NotifyWalletLoaded`, or `wallet->postInitProcess()`
are reached. Keep the existing control flow for the successful path, but ensure
any early failure returns or otherwise avoids dereferencing a null `wallet`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@src/wallet/test/load_util.cpp`:
- Around line 18-32: `TestLoadWallet` still uses the result of `CWallet::Create`
without checking for null. Add a guard immediately after the `CWallet::Create`
call in `TestLoadWallet` so failures are handled before `AddWallet`,
`NotifyWalletLoaded`, or `wallet->postInitProcess()` are reached. Keep the
existing control flow for the successful path, but ensure any early failure
returns or otherwise avoids dereferencing a null `wallet`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fe5e0493-e8e4-42a7-94b9-fd614a481897

📥 Commits

Reviewing files that changed from the base of the PR and between 3191232 and e4ea5c3.

📒 Files selected for processing (6)
  • src/Makefile.test_util.include
  • src/bench/wallet_balance.cpp
  • src/bench/wallet_loading.cpp
  • src/wallet/test/load_util.cpp
  • src/wallet/test/util.h
  • src/wallet/test/wallet_tests.cpp
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/bench/wallet_balance.cpp
  • src/Makefile.test_util.include
  • src/wallet/test/wallet_tests.cpp
  • src/bench/wallet_loading.cpp
  • src/wallet/test/util.h

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Latest delta 3191232..e4ea5c3 is tree-empty, so both prior nonblocking findings remain STILL VALID. A fresh current-head CodeRabbit review also correctly identified that the newly introduced shared TestLoadWallet helper still uses the CWallet::Create() result without a null guard before registration/notification/post-init, matching the current source at e4ea5c3.

🔴 1 blocking | 🟡 1 suggestion(s) | 💬 1 nitpick(s)

All verified findings
  • [BLOCKING] src/wallet/test/load_util.cpp:22: TestLoadWallet registers a null wallet when creation fails
    The new TestLoadWallet helper stores the result of CWallet::Create() in wallet and then immediately passes it to AddWallet(), NotifyWalletLoaded(), and wallet->postInitProcess() without checking for failure. CWallet::Create() returns nullptr on wallet load/create errors, and the production loaders in src/wallet/load.cpp and src/wallet/wallet.cpp all guard that result before registration and post-init. This helper is introduced as shared test infrastructure in src/wallet/test/util.h, so any test or benchmark that hits a wallet creation failure now follows a null shared_ptr through the wallet notification/registration path and can crash instead of returning nullptr like the rest of the wallet-loading API. Return nullptr immediately after CWallet::Create() fails before AddWallet(), NotifyWalletLoaded(), or postInitProcess().

    Suggested replacement:

    auto wallet = CWallet::Create(context, "", std::move(database), create_flags, error, warnings);
    if (!wallet) {
        return nullptr;
    }
    if (context.coinjoin_loader) {
        // TODO: see CreateWalletWithoutChain
        AddWallet(context, wallet);
    }
    NotifyWalletLoaded(context, wallet);
    if (context.chain) {
        wallet->postInitProcess();
    }
  • [SUGGESTION] <commit:c6c26cf29e>:1: Folded bitcoin#27743 fix is not disclosed in the c6c26cf commit message
    Commit c6c26cf ('Merge bitcoin#27626: Parallel compact block downloads, take 3') carries a single (cherry picked from commit 27033bcae2d52e6c4738106fc2276082891ae59d) trailer and lists only the six sub-commits of upstream bitcoin#27626 (verified via git log -1 --format=%B c6c26cf29e at head e4ea5c3). Its diff also folds in bitcoin#27743 (d972695, the unconditional-return fix when compact block status == READ_STATUS_FAILED, visible in the current else if (status == READ_STATUS_FAILED) branch of src/net_processing.cpp). Because Dash merges without squashing and the PR body does not persist into git log/git blame, future readers bisecting or blaming the READ_STATUS_FAILED handling will land on a commit that appears to be a straight cherry-pick of bitcoin#27626 but actually contains an extra upstream hunk from bitcoin#27743, complicating backport audits. Amend the commit body before merge to add a short provenance note such as Also includes bitcoin/bitcoin#27743 (d972695797): Unconditionally return when compact block status == READ_STATUS_FAILED.

  • [NITPICK] src/rpc/rawtransaction.cpp:2000: descriptorprocesspsbt help still advertises UTXO set lookup that Dash does not perform
    The Dash-adapted help text at src/rpc/rawtransaction.cpp:2000 reads 'Update all legacy inputs in a PSBT with information from output descriptors, the UTXO set or the mempool.' Verified at current head e4ea5c3. However, ProcessPSBT in the same file only fills legacy non_witness_utxo data from g_txindex or the mempool; the adjacent Dash-specific comment at lines 296-298 explicitly states the UTXO-set fallback is Bitcoin/segwit-specific and is not applicable in Dash. Users reading this help may expect confirmed legacy prevouts to be recovered from the UTXO set when txindex is disabled and the prevout transaction is no longer in the mempool, which the RPC does not do. Replace 'the UTXO set' with 'txindex' so the help matches the actual behavior.

    Suggested replacement:

                "\nUpdate all legacy inputs in a PSBT with information from output descriptors, txindex or the mempool. \n"
                "Then, sign the inputs we are able to with information from the output descriptors. "
Prior finding reconciliation
  • prior-1: STILL VALID — Folded bitcoin#27743 fix is not disclosed in the c6c26cf commit message
  • prior-2: STILL VALID — descriptorprocesspsbt help still advertises UTXO set lookup that Dash does not perform

Note: GitHub does not allow me to submit REQUEST_CHANGES on my own PR, so this is posted as a COMMENT while preserving the verified blocking finding.

@thepastaclaw thepastaclaw force-pushed the backport-0.26-batch-2-rebuild branch from e4ea5c3 to 818d9f2 Compare July 2, 2026 07:04
@thepastaclaw

Copy link
Copy Markdown
Author

Correction: the prior e4ea5c3b force-push did not include the TestLoadWallet guard. Fixed now in 818d9f2840d13877b268807a070533e8f4fe0788; verified the committed blob contains:

    auto wallet = CWallet::Create(context, "", std::move(database), create_flags, error, warnings);
    if (!wallet) return nullptr;

Local validation: git diff --cached --check before amend; stack remains 5 commits over develop.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

@thepastaclaw, thanks for the correction and for verifying the committed blob. Noted that the TestLoadWallet null-guard for CWallet::Create is now properly included in commit 818d9f2840d13877b268807a070533e8f4fe0788. Triggering a fresh review of the updated branch.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

The latest push at 818d9f2 fixes the prior blocking TestLoadWallet null-wallet issue by returning immediately after CWallet::Create() fails. Two non-blocking, in-scope findings remain: the permanent commit message for c6c26cf still omits the folded bitcoin#27743 provenance, and descriptorprocesspsbt help still advertises a UTXO-set lookup that Dash's ProcessPSBT does not perform. A codex-only missing-prerequisite claim for bitcoin#26531 was verified but dropped because the live PR body explicitly documents that omission as an intentional Dash adaptation.

🟡 1 suggestion(s) | 💬 1 nitpick(s)

All verified findings
  • [SUGGESTION] <commit:c6c26cf29e>:1: Record the folded bitcoin#27743 fix in the commit message
    Commit c6c26cf is presented as the bitcoin#27626 backport: its message lists only the six upstream bitcoin#27626 sub-commits and the cherry-pick trailer for 27033bc. The commit's diff also includes the bitcoin#27743 / d972695 READ_STATUS_FAILED unconditional-return fix, and the PR body documents that fold-in, but the PR body will not be available from git log or git blame after merge. Amend the c6c26cf commit body to record that bitcoin#27743 was also included, so future backport audits do not see an unexplained divergence from the cited bitcoin#27626 cherry-pick source.

  • [NITPICK] src/rpc/rawtransaction.cpp:2000-2001: descriptorprocesspsbt help advertises a UTXO-set lookup Dash skips
    The descriptorprocesspsbt help says legacy inputs are updated from output descriptors, the UTXO set, or the mempool. In this Dash adaptation, ProcessPSBT only fills non_witness_utxo from txindex or the mempool, and the nearby comment explicitly says the upstream UTXO-set fallback is segwit-specific and not applicable to Dash. The help text should name txindex instead of the UTXO set so users do not expect confirmed legacy prevouts to be recovered without txindex or a mempool entry.

    Suggested replacement:

                "\nUpdate all legacy inputs in a PSBT with information from output descriptors, txindex or the mempool. \n"
                "Then, sign the inputs we are able to with information from the output descriptors. ",
Prior finding reconciliation
  • prior-1: FIXED — TestLoadWallet registers a null wallet when creation fails
  • prior-2: STILL VALID — Folded bitcoin#27743 fix is not disclosed in the c6c26cf commit message
  • prior-3: STILL VALID — descriptorprocesspsbt help still advertises UTXO set lookup that Dash does not perform
Policy gate notes
  • Missing prerequisite: bitcoin#26531 was not promoted because it is explicitly documented as an intentional Dash adaptation in the PR body.

thepastaclaw and others added 4 commits July 2, 2026 02:31
d7f359b Add tests for parallel compact block downloads (Greg Sanders)
03423f8 Support up to 3 parallel compact block txn fetchings (Greg Sanders)
13f9b20 Only request full blocks from the peer we thought had the block in-flight (Greg Sanders)
cce9618 Convert mapBlocksInFlight to a multimap (Greg Sanders)
a905954 Remove nBlocksInFlight (Greg Sanders)
86cff8b alias BlockDownloadMap for mapBlocksInFlight (Greg Sanders)

Pull request description:

  This is an attempt at mitigating bitcoin#25258 , which is a revival of bitcoin#10984, which is a revival of bitcoin#9447.

  This PR attempts to mitigate a single case, where high bandwidth peers can bail us out of a flakey
  peer not completing blocks for us. We allow up to 2 additional getblocktxns requests per unique block.
  This would hopefully allow the chance for an honest high bandwidth peer to hand us the transactions
  even if the first in flight peer stalls out.

  In contrast to previous effort:

  1) it will not help if subsequent peers send block headers only, so only high-bandwidth peers this time. See: https://github.com/bitcoin/bitcoin/pull/10984/files#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3R1411
  2)  `MAX_GETBLOCKTXN_TXN_AFTER_FIRST_IN_FLIGHT` is removed, in favor of aiding recovery during turbulent mempools
  3) We require one of the 3 block fetching slots to be an outbound peer. This can be the original offering peer, or subsequent compact blocks given by high bandwidth peers.

ACKs for top commit:
  sdaftuar:
    ACK d7f359b
  mzumsande:
    Code Review ACK d7f359b

Tree-SHA512: 54980eac179e30f12a0bd49df147b2c3d63cd8f9401abb23c7baf02f76eeb59f2cfaaa155227990d0d39384de9fa38663f88774e891600a3837ae927f04f0db3
(cherry picked from commit 27033bc)

Also includes bitcoin#27743 (d972695): Unconditionally return when compact block status == READ_STATUS_FAILED.
1bce12a test: add test for `descriptorprocesspsbt` RPC (ishaanam)
fb2a3a7 rpc: add descriptorprocesspsbt rpc (ishaanam)

Pull request description:

  This PR implements an RPC called `descriptorprocesspsbt`. This RPC is based off of `walletprocesspsbt`, but instead of interacting with the wallet to update, sign and finalize a psbt, it instead accepts an array of output descriptors and uses that information along with information from the mempool, txindex, and the utxo set to do so. `utxoupdatepsbt` also updates a psbt in this manner, but doesn't sign or finalize it. Because of this overlap, a helper function that is added in this PR is called by both `utxoupdatepsbt` and `descriptorprocesspsbt`. Whether or not the helper function signs a psbt is dictated by if the HidingSigningProvider passed to it contains any private information. There is also a test added in this PR for this new RPC that uses p2wsh, p2wpkh, and legacy outputs.
  Edit: see bitcoin#25796 (comment)

ACKs for top commit:
  achow101:
    re-ACK 1bce12a
  instagibbs:
    reACK bitcoin@1bce12a

Tree-SHA512: e1d0334739943e71f2ee68b4db7637ebe725da62e7aa4be071f71c7196d2a5970a31ece96d91e372d34454cde8509e95ab0eebd2c8edb94f7d5a781a84f8fc5d
(cherry picked from commit ed99051)
eefe569 bugfix: Fix incorrect debug.log config file path (Ryan Ofsky)

3746f00 init: Error if ignored bitcoin.conf file is found (Ryan Ofsky)

398c371 lint: Fix lint-format-strings false positives when format specifiers have argument positions (Ryan Ofsky)

(cherry picked from commit e9dc081)
@thepastaclaw thepastaclaw force-pushed the backport-0.26-batch-2-rebuild branch from 818d9f2 to 682e3f1 Compare July 2, 2026 07:32
@thepastaclaw

Copy link
Copy Markdown
Author

Force-pushed updated five-commit branch at 682e3f1e66cbbf50ce06b5044d066552bc7a1fdbd.

Addressed the remaining self-review polish items:

Local validation: git diff --check; stack remains 5 commits over develop.

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

@thepastaclaw, thanks for the update. Noted the polish items applied at commit 682e3f1e66cbbf50ce06b5044d066552bc7a1fdbd:

Triggering a fresh review of the updated branch.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/rpc/rawtransaction.cpp (1)

257-321: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Propagate the caller-selected sighash into PSBT cleanup.

Line 311 signs with the caller-provided sighash_type, but Line 319 still calls RemoveUnnecessaryTransactions as if every signature used SIGHASH_ALL. For descriptorprocesspsbt callers using NONE, SINGLE, or ANYONECANPAY, cleanup can make decisions using the wrong signature mode.

🐛 Proposed fix
-    RemoveUnnecessaryTransactions(psbtx, /*sighash_type=*/1);
+    RemoveUnnecessaryTransactions(psbtx, sighash_type);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/rpc/rawtransaction.cpp` around lines 257 - 321, The PSBT cleanup step in
ProcessPSBT is still hardcoded to use SIGHASH_ALL, which can mismatch the
caller’s chosen signature mode. Update the RemoveUnnecessaryTransactions call to
use the sighash_type parameter that ProcessPSBT already receives, so
descriptorprocesspsbt behaves correctly for NONE, SINGLE, and ANYONECANPAY.
Refer to ProcessPSBT and RemoveUnnecessaryTransactions when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/rpc/rawtransaction.cpp`:
- Around line 257-321: The PSBT cleanup step in ProcessPSBT is still hardcoded
to use SIGHASH_ALL, which can mismatch the caller’s chosen signature mode.
Update the RemoveUnnecessaryTransactions call to use the sighash_type parameter
that ProcessPSBT already receives, so descriptorprocesspsbt behaves correctly
for NONE, SINGLE, and ANYONECANPAY. Refer to ProcessPSBT and
RemoveUnnecessaryTransactions when making the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6d184aa9-9a7b-4d65-854f-3da60d74d44c

📥 Commits

Reviewing files that changed from the base of the PR and between 818d9f2 and 682e3f1.

📒 Files selected for processing (27)
  • doc/release-notes-27302.md
  • src/Makefile.test_util.include
  • src/bench/wallet_balance.cpp
  • src/bench/wallet_loading.cpp
  • src/init.cpp
  • src/init/common.cpp
  • src/net.h
  • src/net_processing.cpp
  • src/net_processing.h
  • src/qt/test/test_main.cpp
  • src/rpc/blockchain.cpp
  • src/rpc/client.cpp
  • src/rpc/rawtransaction.cpp
  • src/rpc/util.cpp
  • src/rpc/util.h
  • src/test/fuzz/rpc.cpp
  • src/util/system.cpp
  • src/util/system.h
  • src/wallet/test/load_util.cpp
  • src/wallet/test/util.h
  • src/wallet/test/wallet_tests.cpp
  • test/functional/feature_config_args.py
  • test/functional/p2p_compactblocks.py
  • test/functional/rpc_psbt.py
  • test/functional/test_framework/test_node.py
  • test/functional/test_framework/util.py
  • test/lint/run-lint-format-strings.py
✅ Files skipped from review due to trivial changes (4)
  • src/rpc/blockchain.cpp
  • src/util/system.h
  • doc/release-notes-27302.md
  • src/net.h
🚧 Files skipped from review as they are similar to previous changes (21)
  • src/Makefile.test_util.include
  • src/test/fuzz/rpc.cpp
  • src/init.cpp
  • src/rpc/client.cpp
  • src/net_processing.h
  • test/functional/test_framework/util.py
  • src/rpc/util.cpp
  • src/init/common.cpp
  • test/lint/run-lint-format-strings.py
  • test/functional/rpc_psbt.py
  • src/bench/wallet_balance.cpp
  • src/wallet/test/wallet_tests.cpp
  • test/functional/test_framework/test_node.py
  • src/bench/wallet_loading.cpp
  • src/wallet/test/util.h
  • test/functional/p2p_compactblocks.py
  • src/qt/test/test_main.cpp
  • test/functional/feature_config_args.py
  • src/rpc/util.h
  • src/util/system.cpp
  • src/net_processing.cpp

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Code Review

Current head 682e3f1 fixes both mandatory prior findings. The bitcoin#27743 fold-in is now recorded in the permanent c931a07 commit message, and descriptorprocesspsbt help now matches Dash's txindex/mempool behavior. CodeRabbit has no actionable findings to validate, and I found no in-scope issues to carry forward.

Canonical action: APPROVE. Findings: 0 findings.

Prior finding reconciliation
  • prior-818d9f28-1: FIXED — Verified with git log: c931a07 now documents the folded bitcoin#27743 fix in the commit body.
  • prior-818d9f28-2: FIXED — Verified src/rpc/rawtransaction.cpp:2000 and ProcessPSBT: the help now names txindex/mempool, matching the implementation path that fills non_witness_utxo from txindex or mempool only.
Resolved prior findings
  • Record the folded bitcoin#27743 fix in the commit message — Fixed in current head: commit c931a07 now includes the note Also includes bitcoin/bitcoin#27743 (d972695797): Unconditionally return when compact block status == READ_STATUS_FAILED.
  • descriptorprocesspsbt help advertises a UTXO-set lookup Dash skips — Fixed in current head: src/rpc/rawtransaction.cpp:2000 now says descriptorprocesspsbt updates legacy inputs from output descriptors, txindex, or the mempool.

Note: GitHub does not allow me to submit APPROVE/REQUEST_CHANGES on my own PR, so this is posted as a COMMENT while preserving the canonical action.

@thepastaclaw

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@thepastaclaw

thepastaclaw commented Jul 2, 2026

Copy link
Copy Markdown
Author

CI failure triage: the red Build source jobs are not caused by this PR's code changes.

The failing jobs stop before compilation at the depends cache restore step, for example linux64-build in run 28571877624:

  • Build depends succeeds, but cache save reports: cache write denied: token has no writable scopes.
  • Build source then tries to restore that exact depends cache key with fail-on-cache-miss: true and exits with Failed to restore cache entry.

This is a fork-PR GitHub Actions cache permission/cache-miss issue, not a source build or test failure from the backport diff. I am leaving the branch untouched; maintainers can rerun/reseed CI with suitable permissions if they want a green source-build run. The remaining predict_conflicts failures are informational-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants