rpc: help metadata fixes #35513

pull RuslanProgrammer wants to merge 2 commits into bitcoin:master from RuslanProgrammer:rpc-help-metadata-fixes changing 7 files +41 −47
  1. RuslanProgrammer commented at 12:16 PM on June 11, 2026: contributor

    Align RPC help documentation with actual implementation.

  2. DrahtBot commented at 12:16 PM on June 11, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35513.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK sedited, willcl-ark

    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:

    • #35813 (wallet, rpc: Add listrawtransactions RPC by pablomartin4btc)
    • #33741 (rpc: Optionally print feerates in sat/vb by polespinasa)

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

  3. pinheadmz commented at 12:26 PM on June 11, 2026: member

    Please squash your commits

  4. RuslanProgrammer force-pushed on Jun 11, 2026
  5. RuslanProgrammer force-pushed on Jun 11, 2026
  6. RuslanProgrammer force-pushed on Jun 11, 2026
  7. fanquake renamed this:
    Rpc help metadata fixes
    rpc: help metadata fixes
    on Jun 11, 2026
  8. DrahtBot added the label RPC/REST/ZMQ on Jun 11, 2026
  9. sedited requested review from willcl-ark on Jun 16, 2026
  10. DrahtBot added the label Needs rebase on Jun 19, 2026
  11. RuslanProgrammer force-pushed on Jun 22, 2026
  12. DrahtBot removed the label Needs rebase on Jun 22, 2026
  13. in src/rpc/blockchain.cpp:1608 in aadb3b5b03
    1603 | @@ -1604,7 +1604,8 @@ static RPCMethod getchaintips()
    1604 |              "2.  \"headers-only\"          Not all blocks for this branch are available, but the headers are valid\n"
    1605 |              "3.  \"valid-headers\"         All blocks are available for this branch, but they were never fully validated\n"
    1606 |              "4.  \"valid-fork\"            This branch is not part of the active chain, but is fully validated\n"
    1607 | -            "5.  \"active\"                This is the tip of the active main chain, which is certainly valid"},
    1608 | +            "5.  \"active\"                This is the tip of the active main chain, which is certainly valid\n"
    1609 | +            "6.  \"unknown\"               Status could not be determined"},
    


    maflcko commented at 5:58 PM on June 30, 2026:

    Can you explain how to trigger this? This is uncovered code according to https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/blockchain.cpp.gcov.html


    RuslanProgrammer commented at 7:37 AM on July 1, 2026:

    Agree, there is no known trigger. I only added it to show what the implementation could theoretically return


    willcl-ark commented at 8:03 AM on July 1, 2026:

    I don't think documenting something unreachable helps "align the docs" and this can be droped.


    RuslanProgrammer commented at 8:16 AM on July 1, 2026:

    Removed


    maflcko commented at 8:20 AM on July 1, 2026:

    Possibly this could be a NONFATAL_UNREACHABLE, but I haven't looked closely.

  14. in src/rpc/net.cpp:665 in aadb3b5b03
     668 | +                        {RPCResult::Type::BOOL, "localrelay", /*optional=*/true, "true if transaction relay is requested from peers"},
     669 | +                        {RPCResult::Type::NUM, "timeoffset", /*optional=*/true, "the time offset"},
     670 | +                        {RPCResult::Type::NUM, "connections", /*optional=*/true, "the total number of connections"},
     671 | +                        {RPCResult::Type::NUM, "connections_in", /*optional=*/true, "the number of inbound connections"},
     672 | +                        {RPCResult::Type::NUM, "connections_out", /*optional=*/true, "the number of outbound connections"},
     673 | +                        {RPCResult::Type::BOOL, "networkactive", /*optional=*/true, "whether p2p networking is enabled"},
    


    maflcko commented at 6:02 PM on June 30, 2026:

    I think this is wrong/dead code.

    The correct fix would be to just require connman. See EnsureAny in src/rpc/server_util.h


    willcl-ark commented at 8:02 AM on July 1, 2026:

    In aadb3b5b033d2933640e86d38e7687793f931ddc

    Agree, we should require connman (and peerman and mempool) using the helper(s).


    RuslanProgrammer commented at 8:16 AM on July 1, 2026:

    Fixed

  15. RuslanProgrammer force-pushed on Jul 1, 2026
  16. DrahtBot added the label Needs rebase on Jul 25, 2026
  17. rpc: Fix inaccuracies in RPC help docs 975229580f
  18. rpc: require connman in getnetworkinfo 8976ba50a2
  19. RuslanProgrammer force-pushed on Jul 27, 2026
  20. DrahtBot removed the label Needs rebase on Jul 27, 2026
  21. sedited approved
  22. sedited commented at 9:40 AM on September 9, 2026: contributor

    ACK 8976ba50a2b9cfa8f5b7898bd84f31be25270d5e

  23. fanquake added this to the milestone 32.0 on Sep 9, 2026
  24. fanquake removed this from the milestone 32.0 on Sep 9, 2026
  25. fanquake added this to the milestone 33.0 on Sep 9, 2026
  26. in src/wallet/rpc/transactions.cpp:714 in 975229580f
     710 | @@ -711,7 +711,7 @@ RPCMethod gettransaction()
     711 |                                  {RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true, "The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n"
     712 |                                      "'send' category of transactions."},
     713 |                                  {RPCResult::Type::BOOL, "abandoned", "'true' if the transaction has been abandoned (inputs are respendable)."},
     714 | -                                {RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'received'. List of parent descriptors for the output script of this coin.", {
     715 | +                                {RPCResult::Type::ARR, "parent_descs", /*optional=*/true, "Only if 'category' is 'receive'. List of parent descriptors for the output script of this coin.", {
    


    willcl-ark commented at 3:47 PM on September 9, 2026:

    In 975229580f742135fd84c61b68f99acd7c7a4621

    The category name correction is right, but parent_descs is also present for immature, generate, and orphan coinbase entries in both gettransaction and listtransactions.

    Not introduced by this PR, but could fix here (or in a followup).

    Regtest reproduction:

    $ demo=$(mktemp -d /tmp/pr35513.XXXXXX)
    $ ./bitcoind -regtest -datadir="$demo" -rpcport=19443 -listen=0 -connect=0 -daemonwait
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 createwallet demo
    $ address=$(./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 getnewaddress)
    $ block=$(./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 generatetoaddress 1 "$address" | jq -r '.[0]')
    $ txid=$(./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 getblock "$block" | jq -r '.tx[0]')
    
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 gettransaction "$txid" | jq '.details[] | {category, parent_descs}'
    {
      "category": "immature",
      "parent_descs": [
        "wpkh([5893553b/84h/1h/0h]tpubDCDXsrKAAeNMmBuRMaAhiCNh3Q3t8XTzHft5ak2yKDiwsvtq4GmimAnyVTUTi6g9VeUjupmHRaCEhHUeay17DcgyD4tbKMEDtzvCJLsEHqP/0/*)#7cqc0k05"
      ]
    }
    
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 generatetoaddress 100 "$address" >/dev/null
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 gettransaction "$txid" | jq '.details[] | {category, parent_descs}'
    {
      "category": "generate",
      "parent_descs": [
        "wpkh([5893553b/84h/1h/0h]tpubDCDXsrKAAeNMmBuRMaAhiCNh3Q3t8XTzHft5ak2yKDiwsvtq4GmimAnyVTUTi6g9VeUjupmHRaCEhHUeay17DcgyD4tbKMEDtzvCJLsEHqP/0/*)#7cqc0k05"
      ]
    }
    
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 invalidateblock "$block"
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 gettransaction "$txid" | jq '.details[] | {category, parent_descs}'
    {
      "category": "orphan",
      "parent_descs": [
        "wpkh([5893553b/84h/1h/0h]tpubDCDXsrKAAeNMmBuRMaAhiCNh3Q3t8XTzHft5ak2yKDiwsvtq4GmimAnyVTUTi6g9VeUjupmHRaCEhHUeay17DcgyD4tbKMEDtzvCJLsEHqP/0/*)#7cqc0k05"
      ]
    }
    
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 listtransactions "*" 1000 | jq --arg txid "$txid" '.[] | select(.txid == $txid) | {category, parent_descs}'
    {
      "category": "orphan",
      "parent_descs": [
        "wpkh([5893553b/84h/1h/0h]tpubDCDXsrKAAeNMmBuRMaAhiCNh3Q3t8XTzHft5ak2yKDiwsvtq4GmimAnyVTUTi6g9VeUjupmHRaCEhHUeay17DcgyD4tbKMEDtzvCJLsEHqP/0/*)#7cqc0k05"
      ]
    }
    
    $ ./bitcoin-cli -regtest -datadir="$demo" -rpcport=19443 stop
    

    sedited commented at 6:35 PM on September 9, 2026:

    I think a quick follow-up would be the easiest here.

  27. willcl-ark approved
  28. willcl-ark commented at 3:50 PM on September 9, 2026: member

    ACK 8976ba50a2b9cfa8f5b7898bd84f31be25270d5e

    Left one comment for a further fix here, or in a followup.

  29. sedited merged this on Sep 9, 2026
  30. sedited closed this on Sep 9, 2026


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-09-24 10:51 UTC

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