rpc: Correct invalid OpenRPC defaults #36297

pull willcl-ark wants to merge 1 commits into bitcoin:master from willcl-ark:openrpc-fixes2 changing 3 files +6 −6
  1. willcl-ark commented at 8:14 PM on September 18, 2026: member

    getopenrpcinfo emits two defaults that do not satisfy their schemas.

    This changes getdeploymentinfo.blockhash to a default hint, since its fallback describes the current chain tip, and makes send.options.include_watching default to boolean false.

  2. DrahtBot added the label RPC/REST/ZMQ on Sep 18, 2026
  3. DrahtBot commented at 8:14 PM on September 18, 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/36297.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

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

    Type Reviewers
    ACK sedited, nervana21
    Stale ACK maflcko

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. willcl-ark commented at 8:14 PM on September 18, 2026: member

    Added assertions for both fields in rpc_openrpc.py, although probably not strictly necessary and they could perhaps be dropped from here...

  5. sedited added the label Needs Backport (32.x) on Sep 18, 2026
  6. sedited added this to the milestone 32.0 on Sep 18, 2026
  7. nervana21 commented at 12:01 AM on September 19, 2026: contributor

    Concept ACK

  8. maflcko commented at 4:42 AM on September 19, 2026: member

    Yes, please drop the test (we don't want to check special fields in a general test), and squash the two trivial (style?) fixups . I'll post the rendered diff instead.

  9. willcl-ark force-pushed on Sep 19, 2026
  10. willcl-ark commented at 6:51 AM on September 19, 2026: member

    @maflcko done.

  11. maflcko commented at 7:03 AM on September 19, 2026: member

    rendered diff, as promised:

    diff --git a/getdeploymentinfo b/getdeploymentinfo
    index e827974..2de1a0c 100644
    --- a/getdeploymentinfo
    +++ b/getdeploymentinfo
    @@ -4,7 +4,7 @@ Returns an object containing various state info regarding deployments of consens
     Consensus changes for which the new rules are enforced from genesis are not listed in "deployments".
     
     Arguments:
    -1. blockhash    (string, optional, default="hash of current chain tip") The block hash at which to query deployment state
    +1. blockhash    (string, optional, default=hash of current chain tip) The block hash at which to query deployment state
     
     Result:
     {                                       (json object)
    diff --git a/getopenrpcinfo.full.json b/getopenrpcinfo.full.json
    index 6e007c8..0918146 100644
    --- a/getopenrpcinfo.full.json
    +++ b/getopenrpcinfo.full.json
    @@ -5844,7 +5844,7 @@
                         "schema": {
                             "type": "string",
                             "pattern": "^[0-9a-fA-F]+$",
    -                        "default": "hash of current chain tip"
    +                        "x-bitcoin-default-hint": "hash of current chain tip"
                         },
                         "description": "The block hash at which to query deployment state"
                     }
    @@ -12811,7 +12811,7 @@
                                 },
                                 "include_watching": {
                                     "type": "boolean",
    -                                "default": "false",
    +                                "default": false,
                                     "description": "(DEPRECATED) No longer used"
                                 },
                                 "inputs": {
    diff --git a/send b/send
    index 7586a57..a0ac488 100644
    --- a/send
    +++ b/send
    @@ -43,7 +43,7 @@ change_address               (string, optional, default=automatic) The bitcoin a
     change_position              (numeric, optional, default=random) The index of the change output
     change_type                  (string, optional, default=set by -changetype) The output type to use. Only valid if change_address is not specified. Options are "legacy", "p2sh-segwit", "bech32", "bech32m".
     fee_rate                     (numeric or string, optional, default=not set, fall back to wallet fee estimation) Specify a fee rate in sat/vB.
    -include_watching             (boolean, optional, default="false") (DEPRECATED) No longer used
    +include_watching             (boolean, optional, default=false) (DEPRECATED) No longer used
     inputs                       (json array, optional, default=[]) Specify inputs instead of adding them automatically.
          [
            {                     (json object)
    
  12. maflcko commented at 7:05 AM on September 19, 2026: member

    review ACK e35443488db04cf713978f6df5ef72ed2374303a šŸ

    <details><summary>Show signature</summary>

    Signature:

    untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
    RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
    trusted comment: review ACK e35443488db04cf713978f6df5ef72ed2374303a šŸ
    3pk1YEGM8F7MttNjBeLlnJoFZPgpHVA1XvbpDUlJ8UgU1dd/SB+UfBuZRmldnO+yS7OsPuARWip6H+wO5tINAA==
    

    </details>

  13. sedited commented at 8:09 AM on September 19, 2026: contributor

    I did a git grep 'Default{"[^"]* ' and seems like there are a few more that could be changed to default hint in rpc/rawtransasction.cpp and wallet/rpc/spend.cpp?

  14. willcl-ark commented at 11:12 AM on September 19, 2026: member

    I did a git grep 'Default{"[^"]* ' and seems like there are a few more that could be changed to default hint in rpc/rawtransasction.cpp and wallet/rpc/spend.cpp?

    interesting…

    i didn’t search like that, rather used my rust generator to build client types and see where it complained. i’m AFK now but curious as to why it didn’t complain on those too.

  15. rpc: Correct OpenRPC default metadata
    Correct six argument metadata entries that produce misleading or invalid
    OpenRPC defaults.
    
    The getdeploymentinfo blockhash fallback and four sighashtype fallbacks
    describe how omitted arguments are resolved. They are not literal values
    accepted by the RPCs, so mark them as DefaultHint values.
    
    The send include_watching option is boolean, but its string default makes
    the generated schema internally inconsistent. Use a boolean value,
    matching the analogous sendall option.
    
    Runtime behavior is unchanged.
    b7f740c594
  16. willcl-ark force-pushed on Sep 19, 2026
  17. willcl-ark commented at 2:57 PM on September 19, 2026: member

    Ah I see, my generator did not flag them because the generated schemas only constrain these arguments to type: string, so the prose defaults satisfy the schema. The other two defaults failed a hex pattern and a boolean type check.

    Included these four more cases in latest push.

  18. sedited approved
  19. sedited commented at 3:08 PM on September 19, 2026: contributor

    ACK b7f740c594ba1482344a7906b799fb62c533464f

  20. DrahtBot requested review from maflcko on Sep 19, 2026
  21. nervana21 commented at 3:20 PM on September 19, 2026: contributor

    ACK b7f740c594ba1482344a7906b799fb62c533464f

  22. fanquake merged this on Sep 19, 2026
  23. fanquake closed this on Sep 19, 2026

  24. fanquake removed the label Needs Backport (32.x) on Sep 19, 2026
  25. fanquake commented at 3:53 PM on September 19, 2026: member

    Backported to 32.x in #36300.


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-20 15:52 UTC

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