rpc: Deprecate watchonly wallet no-op named options #36855

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2611-rpc-wallet-deprecate-watchonly-options changing 7 files +45 −4
  1. maflcko commented at 3:09 PM on November 13, 2026: member

    Since "leet" commit 1337c72198a7d32935431d64e9e58c12f9003abc, the options are deprecated no-ops, so it seems time to properly start a deprecation cycle for them.

  2. DrahtBot added the label RPC/REST/ZMQ on Nov 13, 2026
  3. DrahtBot commented at 3:10 PM on November 13, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    External sites

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK seduless

    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:

    • #36743 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36743.svg"></sub> ([RFC] build: build with -Wmissing-declarations/prototypes by fanquake)

    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-->

  4. rpc: Deprecate watchonly wallet no-op named options fa73a095dc
  5. maflcko force-pushed on Nov 13, 2026
  6. DrahtBot added the label CI failed on Nov 13, 2026
  7. maflcko commented at 3:19 PM on November 13, 2026: member

    For reference, the positional ones are tedious to deprecate, so that can be done later, maybe via OBJ_NAMED_PARAMS, if possible, but that will be a larger breaking change than this, so I'll leave it for later.

    <!-- ```diff diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py index 2d36291..f77f9ed 100755 --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -85,3 +85,3 @@ class WalletTest(BitcoinTestFramework): assert_equal(self.nodes[0].getbalance(minconf=0), 50) - assert_equal(self.nodes[0].getbalance("*", 1, True), 50) + assert_equal(self.nodes[0].getbalance(dummy="*", minconf=1, include_watchonly=True), 50) assert_equal(self.nodes[1].getbalance(minconf=0), 50) diff --git a/test/functional/wallet_listreceivedby.py b/test/functional/wallet_listreceivedby.py index 3a6a6df..7251576 100755 --- a/test/functional/wallet_listreceivedby.py +++ b/test/functional/wallet_listreceivedby.py @@ -78,3 +78,3 @@ class ReceivedByTest(BitcoinTestFramework): # Another address receive money - res = self.nodes[1].listreceivedbyaddress(0, True, True) + res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True) assert_equal(len(res), 2 + num_cb_reward_addresses) # Right now 2 entries @@ -85,3 +85,3 @@ class ReceivedByTest(BitcoinTestFramework): expected = {"address": addr, "label": "", "amount": Decimal("0.1"), "confirmations": 11, "txids": [txid, ]} - res = self.nodes[1].listreceivedbyaddress(0, True, True, addr) + res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True, address_filter=addr) assert_array_result(res, {"address": addr}, expected) @@ -90,3 +90,3 @@ class ReceivedByTest(BitcoinTestFramework): expected = {"address": other_addr, "label": "", "amount": Decimal("0.1"), "confirmations": 1, "txids": [txid2, ]} - res = self.nodes[1].listreceivedbyaddress(0, True, True, other_addr) + res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True, address_filter=other_addr) assert_array_result(res, {"address": other_addr}, expected) @@ -94,3 +94,3 @@ class ReceivedByTest(BitcoinTestFramework): # Should be two entries though without filter - res = self.nodes[1].listreceivedbyaddress(0, True, True) + res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True) assert_equal(len(res), 3 + num_cb_reward_addresses) # Became 3 entries @@ -99,3 +99,3 @@ class ReceivedByTest(BitcoinTestFramework): other_addr = self.nodes[0].getnewaddress() # note on node[0]! just a random addr - res = self.nodes[1].listreceivedbyaddress(0, True, True, other_addr) + res = self.nodes[1].listreceivedbyaddress(minconf=0, include_empty=True, include_watchonly=True, address_filter=other_addr) assert_equal(len(res), 0) ``` • ### Flag Use one value, -deprecatedrpc=watchonly, for the six RPCs. With it, accept their legacy positional signatures. Without it, reject those signatures with a deprecation error. The new options forms work either way. ### RPC arguments RPC Legacy positional arguments, in order New form ━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ getbalance dummy?, minconf, include_watchonly, avoid_reuse options={minconf, avoid_reuse} ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────────────── listreceivedbyaddress minconf, include_empty, include_watchonly, address_filter?, include_immature_coinbase options={minconf, include_empty, address_filter, include_immature_coinbase} ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────────────── listreceivedbylabel minconf, include_empty, include_watchonly, include_immature_coinbase options={minconf, include_empty, include_immature_coinbase} ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────────────── listtransactions label?, count, skip, include_watchonly label?, options={count, skip} ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────────────── listsinceblock blockhash?, target_confirmations, include_watchonly, include_removed, include_change, label? blockhash?, options={target_confirmations, include_removed, include_change, label} ─────────────────────── ────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────────────────────────────────────────────────────────────────────── gettransaction txid, include_watchonly, verbose txid, options={verbose} ### Proposed parsing approach Keep OBJ_NAMED_PARAMS for the new options, with skip_type_check on the options argument so the positional parser can also receive the old scalar at that position. Add optional trailing legacy slots so the RPC’s fixed argument-count check accepts old calls. In each RPC, distinguish an options object from a legacy scalar; gate the legacy path with rpcEnableDeprecated("watchonly"), validate its old arguments, ignore include_watchonly, and use the remaining values in their old positions. Named parameters should still be collected into the options object by OBJ_NAMED_PARAMS. Deprecated named fields such as include_watchonly would need to remain in metadata for conversion and be gated in the handler. The hidden legacy slots need care because the current named-argument mapping also sees hidden arguments; this approach is a sketch that would need a focused implementation check.

  8. DrahtBot removed the label CI failed on Nov 13, 2026
  9. seduless commented at 9:39 PM on November 14, 2026: contributor

    Tested ACK fa73a095dc6920f83f9ea248c5e44dfd5a0a373a

    Verified locally that all five RPCs with the -deprecatedrpc=watchonly flag accept their deprecated options.

  10. fanquake requested review from willcl-ark on Nov 16, 2026


willcl-ark


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-19 19:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me