descriptor, rpc, wallet: do not echo key material in error messages #36648

Open
fametrano wants to merge 1 commit from descriptor-errors-no-keys into master AGit
fametrano commented 2026-10-24 12:49:24 +00:00 (Migrated from github.com)

Some descriptor error messages quote the string the caller sent, and a descriptor can hold a private key. The error then carries the key, or part of it, into places the request may not go: an application's log, an error reporter, a screenshot shared for help.

This PR stops the quoting. A failing key is named by its position, a failing entry of solving_data.descriptors by its index, and a function name is quoted only where the parser accepts it. The commit message lists each changed error.

before after
key '<key>' is not valid key is not valid
Multi: key '<key>' is not valid Multi: key 3: key is not valid
'wpkh(<key>)x' is not a valid descriptor function Unexpected text after the closing ')' of wpkh()
'<start of a key>(<rest>' is not a valid descriptor function Not a valid descriptor expression
Unable to parse descriptor '<descriptor>': Missing checksum Unable to parse descriptor at index 1: Missing checksum
Could not add descriptor '<descriptor>': ... the same, quoting the public form of the descriptor
Some descriptor error messages quote the string the caller sent, and a descriptor can hold a private key. The error then carries the key, or part of it, into places the request may not go: an application's log, an error reporter, a screenshot shared for help. This PR stops the quoting. A failing key is named by its position, a failing entry of `solving_data.descriptors` by its index, and a function name is quoted only where the parser accepts it. The commit message lists each changed error. | before | after | | --- | --- | | `key '<key>' is not valid` | `key is not valid` | | `Multi: key '<key>' is not valid` | `Multi: key 3: key is not valid` | | `'wpkh(<key>)x' is not a valid descriptor function` | `Unexpected text after the closing ')' of wpkh()` | | `'<start of a key>(<rest>' is not a valid descriptor function` | `Not a valid descriptor expression` | | `Unable to parse descriptor '<descriptor>': Missing checksum` | `Unable to parse descriptor at index 1: Missing checksum` | | `Could not add descriptor '<descriptor>': ...` | the same, quoting the public form of the descriptor |
DrahtBot commented 2026-10-24 12:49:33 +00:00 (Migrated from github.com)

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Stale ACK jpk68

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36990 (test: replace hard-coded RPC error codes by l0rinc)
  • #36885 (wallet, rpc: Add analyzedescriptor for multisig setups by pablomartin4btc)
  • #36402 (refactor: wallet_importdescriptors to separate run_test() contents into specific functions by nebula-21)
  • #36257 (qa: assert_equal -> assert_true/assert_false by hodlinator)
  • #36122 (BIP460: CISA for Taproot key path spends by fjahr)
  • #35918 (descriptor: Expose key expression parsing by pseudoramdom)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36648 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36648.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36648#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Stale ACK | [jpk68](https://github.com/bitcoin/bitcoin/pull/36648#issuecomment-6452939364) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36990](https://github.com/bitcoin/bitcoin/pull/36990) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36990.svg"></sub> (test: replace hard-coded RPC error codes by l0rinc) * [#36885](https://github.com/bitcoin/bitcoin/pull/36885) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36885.svg"></sub> (wallet, rpc: Add analyzedescriptor for multisig setups by pablomartin4btc) * [#36402](https://github.com/bitcoin/bitcoin/pull/36402) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36402.svg"></sub> (refactor: `wallet_importdescriptors` to separate `run_test()` contents into specific functions by nebula-21) * [#36257](https://github.com/bitcoin/bitcoin/pull/36257) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36257.svg"></sub> (qa: assert_equal -> assert_true/assert_false by hodlinator) * [#36122](https://github.com/bitcoin/bitcoin/pull/36122) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36122.svg"></sub> (BIP460: CISA for Taproot key path spends by fjahr) * [#35918](https://github.com/bitcoin/bitcoin/pull/35918) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35918.svg"></sub> (descriptor: Expose key expression parsing by pseudoramdom) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

🟠 Minor · Removing <iterator> leaves its declarations used without a direct include

descriptor.cpp still uses std::back_inserter, so removing <iterator> introduces a transitive-header dependency and will likely cause the enforced IWYU job to restore it and fail.

Location: src/script/descriptor.cpp:38 (base).

🔵 Suggestion · Taproot key errors no longer identify the failing leaf

After removing the quoted key, malformed keys in different tr() leaves can produce identical errors because the new positions are local to each leaf.

Location: src/script/descriptor.cpp:2055 (head).

🔵 Suggestion · A colon alone selects the miniscript diagnostic

descriptor.cpp:2834-2850: with no '(', name is the whole expression, so any ':' selects 'Not a valid miniscript expression'. An uppercase BITCOIN:BC1Q... input gets it although miniscript's wrapper scan found no wrappers. getdescriptorinfo returns it unchanged.

Location: src/script/descriptor.cpp:2833 (head).

🔵 Suggestion · CheckUnparsable discards the private-input diagnostic

CheckUnparsable (descriptor_tests.cpp:26-35) parses prv then pub into one error and asserts only the second, so private-input diagnostics in the existing cases (e.g. line 624's malformed WIF) go unchecked for echoed key text.

Location: src/test/descriptor_tests.cpp:26 (head).

Review coverage was incomplete.


Reviewed: ad18016046b4 · Full review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:4d44b6ffa09c54db24f8f0ab27ae388beae06a733efcae741ca64db76bb1c938:7efd3c3ba41667382004cfa7a7db56605da7d8f9b7ab69bc483f27117390ba48 --> <!-- ralph-base:0e38ad26af922abdc0fc36c9379e17efd2a72b80 --> <!-- ralph-head:ad18016046b478f9d9adc807aab83328578ea603 --> <!-- ralph-case:94f83c918cce3f10aa8424a24d7a86fbaaf080e7c2d9c9509ebedfee6aeb348b --> **🟠 Minor · Removing `<iterator>` leaves its declarations used without a direct include** descriptor.cpp still uses std::back_inserter, so removing `<iterator>` introduces a transitive-header dependency and will likely cause the enforced IWYU job to restore it and fail. Location: [`src/script/descriptor.cpp:38`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/0e38ad26af922abdc0fc36c9379e17efd2a72b80/src/script/descriptor.cpp#L38>) (base). **🔵 Suggestion · Taproot key errors no longer identify the failing leaf** After removing the quoted key, malformed keys in different tr() leaves can produce identical errors because the new positions are local to each leaf. Location: [`src/script/descriptor.cpp:2055`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/ad18016046b478f9d9adc807aab83328578ea603/src/script/descriptor.cpp#L2055>) (head). **🔵 Suggestion · A colon alone selects the miniscript diagnostic** descriptor.cpp:2834-2850: with no '(', `name` is the whole expression, so any ':' selects 'Not a valid miniscript expression'. An uppercase BITCOIN:BC1Q... input gets it although miniscript's wrapper scan found no wrappers. getdescriptorinfo returns it unchanged. Location: [`src/script/descriptor.cpp:2833`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/ad18016046b478f9d9adc807aab83328578ea603/src/script/descriptor.cpp#L2833>) (head). **🔵 Suggestion · `CheckUnparsable` discards the private-input diagnostic** CheckUnparsable (descriptor_tests.cpp:26-35) parses prv then pub into one `error` and asserts only the second, so private-input diagnostics in the existing cases (e.g. line 624's malformed WIF) go unchecked for echoed key text. Location: [`src/test/descriptor_tests.cpp:26`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/ad18016046b478f9d9adc807aab83328578ea603/src/test/descriptor_tests.cpp#L26>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`ad18016046b4`](<https://git.fish.foo/bitcoin/bitcoin/commit/ad18016046b478f9d9adc807aab83328578ea603>) · [Full review report](<https://review.fish.foo/traces/36648-ad18016046b478f9d9adc807aab83328578ea603-2179-8.html>) · [Previous reports](<https://review.fish.foo/traces/36648/>) [permalink](<https://review.fish.foo/traces/36648-ad18016046b478f9d9adc807aab83328578ea603-2179-8.html>)
jpk68 commented 2026-10-27 20:35:57 +00:00 (Migrated from github.com)
ACK ad18016046b478f9d9adc807aab83328578ea603
uqlidi (Migrated from github.com) reviewed 2026-10-28 18:00:08 +00:00
uqlidi (Migrated from github.com) commented 2026-10-28 17:49:16 +00:00

In a descriptor with many keys, the error doesn't say which one failed. For wsh(multi(2,KEY1,KEY2,KEY3)) with a typo in KEY3, the error is only:

Multi: key is not valid

With 15 keys, the user has to check each one by hand.

You can print the key's position. key_exp_index already counts the keys parsed before the failing one, so no key text is needed.

Something like that:

Multi: Key #3 is not valid

Note: the count includes each musig() aggregate key, so a key after a musig() gets a number one higher than a user would count. The test expectations for these messages still need updating.

In a descriptor with many keys, the error doesn't say which one failed. For `wsh(multi(2,KEY1,KEY2,KEY3))` with a typo in KEY3, the error is only: ``` Multi: key is not valid ``` With 15 keys, the user has to check each one by hand. You can print the key's position. `key_exp_index` already counts the keys parsed before the failing one, so no key text is needed. Something like that: ``` Multi: Key #3 is not valid ``` Note: the count includes each musig() aggregate key, so a key after a musig() gets a number one higher than a user would count. The test expectations for these messages still need updating.
uqlidi (Migrated from github.com) commented 2026-10-28 17:49:19 +00:00

In a descriptor with many keys, the error doesn't say which one failed. For wsh(multi(2,KEY1,KEY2,KEY3)) with a typo in KEY3, the error is only:

Multi: key is not valid

With 15 keys, the user has to check each one by hand.

You can print the key's position. key_exp_index already counts the keys parsed before the failing one, so no key text is needed.

Something like that:

Multi: Key #3 is not valid

Note: the count includes each musig() aggregate key, so a key after a musig() gets a number one higher than a user would count. The test expectations for these messages still need updating.

In a descriptor with many keys, the error doesn't say which one failed. For `wsh(multi(2,KEY1,KEY2,KEY3))` with a typo in KEY3, the error is only: ``` Multi: key is not valid ``` With 15 keys, the user has to check each one by hand. You can print the key's position. `key_exp_index` already counts the keys parsed before the failing one, so no key text is needed. Something like that: ``` Multi: Key #3 is not valid ``` Note: the count includes each musig() aggregate key, so a key after a musig() gets a number one higher than a user would count. The test expectations for these messages still need updating.
uqlidi (Migrated from github.com) commented 2026-10-28 17:32:48 +00:00

For wpkh(KEY)x, the error is now 'wpkh(...' is not a valid descriptor function. wpkh is a valid function; the real problem is the trailing x. The old message echoed the full text, so the mistake was visible.

you can make it skip the key inside the function print the chars that is connected to ).

somethiing like that:

Invalid descriptor expression 'wpkh(...)x'
For `wpkh(KEY)x`, the error is now 'wpkh(...' is not a valid descriptor function. `wpkh` is a valid function; the real problem is the trailing x. The old message echoed the full text, so the mistake was visible. you can make it skip the key inside the function print the chars that is connected to `)`. somethiing like that: ``` Invalid descriptor expression 'wpkh(...)x' ```
uqlidi (Migrated from github.com) commented 2026-10-28 17:38:20 +00:00

suggested diff:

diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
index 3ae2da81d..29dbfa3a7 100644
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -2828,15 +2828,29 @@ std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index
         error = "A function is needed within P2WSH";
         return {};
     }
-    // Quote the function name only if it is 16 characters or fewer: every key is longer, and a bare key has no '('
+    // Show the expression as "name(...)rest", where the arguments are never quoted, the name
+    // only if it is 16 characters or fewer (every key is longer, and a bare key has no '('),
+    // and the text after the matching ')' only if it is no longer than MAX_QUOTED_TOKEN_CHARS.
     constexpr size_t MAX_FUNCTION_NAME_CHARS{16};
     const std::string_view expr_text{expr.begin(), expr.end()};
-    const size_t paren{expr_text.find('(')};
-    if (paren == std::string_view::npos || paren == 0 || paren > MAX_FUNCTION_NAME_CHARS) {
+    const size_t open{expr_text.find('(')};
+    if (open == std::string_view::npos || open == 0 || open > MAX_FUNCTION_NAME_CHARS) {
         error = "Not a valid descriptor function";
-    } else {
-        error = strprintf("'%s(...' is not a valid descriptor function", expr_text.substr(0, paren));
+        return {};
+    }
+    std::string shown{strprintf("%s(...", expr_text.substr(0, open))};
+    int depth{0};
+    for (size_t i{open}; i < expr_text.size(); ++i) {
+        if (expr_text[i] == '(') {
+            ++depth;
+        } else if (expr_text[i] == ')' && --depth == 0) {
+            const std::string_view rest{expr_text.substr(i + 1)};
+            shown += ')';
+            shown += rest.size() <= MAX_QUOTED_TOKEN_CHARS ? rest : std::string_view{"..."};
+            break;
+        }
     }
+    error = strprintf("Invalid descriptor expression '%s'", shown);
     return {};
 }
suggested diff: ```diff diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 3ae2da81d..29dbfa3a7 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -2828,15 +2828,29 @@ std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index error = "A function is needed within P2WSH"; return {}; } - // Quote the function name only if it is 16 characters or fewer: every key is longer, and a bare key has no '(' + // Show the expression as "name(...)rest", where the arguments are never quoted, the name + // only if it is 16 characters or fewer (every key is longer, and a bare key has no '('), + // and the text after the matching ')' only if it is no longer than MAX_QUOTED_TOKEN_CHARS. constexpr size_t MAX_FUNCTION_NAME_CHARS{16}; const std::string_view expr_text{expr.begin(), expr.end()}; - const size_t paren{expr_text.find('(')}; - if (paren == std::string_view::npos || paren == 0 || paren > MAX_FUNCTION_NAME_CHARS) { + const size_t open{expr_text.find('(')}; + if (open == std::string_view::npos || open == 0 || open > MAX_FUNCTION_NAME_CHARS) { error = "Not a valid descriptor function"; - } else { - error = strprintf("'%s(...' is not a valid descriptor function", expr_text.substr(0, paren)); + return {}; + } + std::string shown{strprintf("%s(...", expr_text.substr(0, open))}; + int depth{0}; + for (size_t i{open}; i < expr_text.size(); ++i) { + if (expr_text[i] == '(') { + ++depth; + } else if (expr_text[i] == ')' && --depth == 0) { + const std::string_view rest{expr_text.substr(i + 1)}; + shown += ')'; + shown += rest.size() <= MAX_QUOTED_TOKEN_CHARS ? rest : std::string_view{"..."}; + break; + } } + error = strprintf("Invalid descriptor expression '%s'", shown); return {}; } ```
uqlidi (Migrated from github.com) commented 2026-10-28 17:59:38 +00:00
i see you are using the same value of `MAX_QUOTED_CHARS` in https://github.com/bitcoin/bitcoin/pull/36648/changes#diff-dcb25ae6b5207f65ae6a1cd364c9e62e5a9df69a1cd21b9ed79849cc99c2150bR1880 you can define it here and reuse it inside descriptor.cpp
Lines 632-639
uqlidi (Migrated from github.com) commented 2026-10-28 17:56:32 +00:00

similar to the key index solving_data.descriptors is a list, now that the descriptor is no longer printed, the error doesn't say which one failed:

Unable to parse descriptor: Missing checksum

You can print its index in the list.

should be:

Unable to parse descriptor at index 1: Missing checksum

we could do something like that instead:

diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp
index 383f752dc..0ab874793 100644
--- a/src/wallet/rpc/spend.cpp
+++ b/src/wallet/rpc/spend.cpp
@@ -622,14 +622,15 @@ CreatedTransactionResult FundTransaction(CWallet& wallet, const CMutableTransact
         }
 
         if (solving_data.exists("descriptors")) {
-            for (const UniValue& desc_univ : solving_data["descriptors"].get_array().getValues()) {
-                const std::string& desc_str  = desc_univ.get_str();
+            const auto& desc_values{solving_data["descriptors"].get_array().getValues()};
+            for (size_t desc_index{0}; desc_index < desc_values.size(); ++desc_index) {
+                const std::string& desc_str{desc_values[desc_index].get_str()};
                 FlatSigningProvider desc_out;
                 std::string error;
                 std::vector<CScript> scripts_temp;
                 auto descs = Parse(desc_str, desc_out, error, true);
                 if (descs.empty()) {
-                    throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Unable to parse descriptor: %s", error));
+                    throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Unable to parse descriptor at index %u: %s", desc_index, error));
                 }
                 for (auto& desc : descs) {
                     desc->Expand(0, desc_out, scripts_temp, desc_out);
similar to the key index solving_data.descriptors is a list, now that the descriptor is no longer printed, the error doesn't say which one failed: ``` Unable to parse descriptor: Missing checksum ``` You can print its index in the list. should be: ``` Unable to parse descriptor at index 1: Missing checksum ``` we could do something like that instead: ```diff diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp index 383f752dc..0ab874793 100644 --- a/src/wallet/rpc/spend.cpp +++ b/src/wallet/rpc/spend.cpp @@ -622,14 +622,15 @@ CreatedTransactionResult FundTransaction(CWallet& wallet, const CMutableTransact } if (solving_data.exists("descriptors")) { - for (const UniValue& desc_univ : solving_data["descriptors"].get_array().getValues()) { - const std::string& desc_str = desc_univ.get_str(); + const auto& desc_values{solving_data["descriptors"].get_array().getValues()}; + for (size_t desc_index{0}; desc_index < desc_values.size(); ++desc_index) { + const std::string& desc_str{desc_values[desc_index].get_str()}; FlatSigningProvider desc_out; std::string error; std::vector<CScript> scripts_temp; auto descs = Parse(desc_str, desc_out, error, true); if (descs.empty()) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Unable to parse descriptor: %s", error)); + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Unable to parse descriptor at index %u: %s", desc_index, error)); } for (auto& desc : descs) { desc->Expand(0, desc_out, scripts_temp, desc_out); ```
fametrano (Migrated from github.com) reviewed 2026-11-01 18:52:03 +00:00
fametrano (Migrated from github.com) commented 2026-11-01 18:52:03 +00:00

Done: wpkh(KEY)x now gives Unexpected text after the closing ')' of wpkh(), which quotes the name only because it is a function the parser accepts, and never the text after the ), which can be the end of a key.

Done: `wpkh(KEY)x` now gives `Unexpected text after the closing ')' of wpkh()`, which quotes the name only because it is a function the parser accepts, and never the text after the `)`, which can be the end of a key.
fametrano (Migrated from github.com) reviewed 2026-11-01 18:52:38 +00:00
fametrano (Migrated from github.com) commented 2026-11-01 18:52:38 +00:00

Done: the error gives the key's position in its list, counted from 1, as in Multi: key 3: key is not valid, and a key after a musig() is not counted one higher.

Done: the error gives the key's position in its list, counted from 1, as in `Multi: key 3: key is not valid`, and a key after a `musig()` is not counted one higher.
fametrano (Migrated from github.com) reviewed 2026-11-01 18:52:40 +00:00
fametrano (Migrated from github.com) commented 2026-11-01 18:52:40 +00:00

Done, as in the other copy of this comment: Multi: key 3: key is not valid, counted within the list.

Done, as in the other copy of this comment: `Multi: key 3: key is not valid`, counted within the list.
fametrano (Migrated from github.com) reviewed 2026-11-01 18:52:42 +00:00
Lines 632-639
fametrano (Migrated from github.com) commented 2026-11-01 18:52:42 +00:00

Done with your loop: Unable to parse descriptor at index 1: Missing checksum.

Done with your loop: `Unable to parse descriptor at index 1: Missing checksum`.
fametrano (Migrated from github.com) reviewed 2026-11-01 18:52:44 +00:00
fametrano (Migrated from github.com) commented 2026-11-01 18:52:44 +00:00

MAX_QUOTED_CHARS is gone: no error quotes text by length any more, so there is nothing left to share with bip32.cpp.

`MAX_QUOTED_CHARS` is gone: no error quotes text by length any more, so there is nothing left to share with `bip32.cpp`.
fametrano commented 2026-11-01 18:57:50 +00:00 (Migrated from github.com)

@uqlidi Thanks, I addressed all four points; the replies are inline.

@uqlidi Thanks, I addressed all four points; the replies are inline.
DrahtBot commented 2026-11-01 19:55:28 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/41338732479/job/124943987697
LLM reason (✨ experimental): CI failed because IWYU/clang-format modified src/script/descriptor.cpp (adding <ranges>), so the lint check detected uncommitted formatting/include changes.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `iwyu`: https://github.com/bitcoin/bitcoin/actions/runs/41338732479/job/124943987697</sub> <sub>LLM reason (✨ experimental): CI failed because IWYU/clang-format modified `src/script/descriptor.cpp` (adding `<ranges>`), so the lint check detected uncommitted formatting/include changes.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
fametrano commented 2026-11-02 01:27:10 +00:00 (Migrated from github.com)

I pushed a fix for the CI failure, and one of the two suggestions in the Ralph review.

The iwyu task wanted #include <ranges> in descriptor.cpp, and rpc_getdescriptoractivity.py still expected the old message for addrx(...). Both are fixed.

An expression with miniscript wrappers that fails to parse, such as z:pk(K) or vv:pk(K), now gives "Not a valid miniscript expression" instead of "Not a valid pk() expression". The wrappers may be what is wrong, and pk(K) itself can be valid.

The other suggestion adds the position of the failing tr() leaf and key path element, as in "tr(): leaf 2: pk(): key is not valid". It rewords errors master already has: 22 expectations change in descriptor_tests.cpp, 12 of them in master's own tests (+33 −27 in two files). I can add it here if a maintainer wants it.

I pushed a fix for the CI failure, and one of the two suggestions in the Ralph review. The iwyu task wanted `#include <ranges>` in `descriptor.cpp`, and `rpc_getdescriptoractivity.py` still expected the old message for `addrx(...)`. Both are fixed. An expression with miniscript wrappers that fails to parse, such as `z:pk(K)` or `vv:pk(K)`, now gives "Not a valid miniscript expression" instead of "Not a valid pk() expression". The wrappers may be what is wrong, and `pk(K)` itself can be valid. The other suggestion adds the position of the failing `tr()` leaf and key path element, as in "tr(): leaf 2: pk(): key is not valid". It rewords errors master already has: 22 expectations change in `descriptor_tests.cpp`, 12 of them in master's own tests (+33 −27 in two files). I can add it here if a maintainer wants it.
DrahtBot commented 2026-11-04 12:55:01 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36648
No description provided.