rpc: require integer verbosity; remove boolean ‘verbose’ #33214

pull fqlx wants to merge 2 commits into bitcoin:master from fqlx:rpc-no-bool-verbosity changing 41 files +195 −84
  1. fqlx commented at 2:56 am on August 19, 2025: none

    Summary

    Standardize RPC verbosity to integers only and remove boolean handling for clarity, consistency, and future extensibility.

    Rationale

    • Legacy cleanup: Boolean verbosity has been discouraged/deprecated in docs since 2017 and continues to create tech debt (special-case parsing, inconsistent tests, user confusion).
    • Consistency: Integers enable multi-level output without overloading a boolean.

    User-visible changes

    • getblock, getrawtransaction, getorphantxs no longer accept booleans.
    • Passing true/false now errors with: Verbosity was boolean but only integer allowed.
    • Migration: false → 0, true → 1.

    Code / Docs

    • ParseVerbosity(arg, default) now rejects booleans (removed allow_bool).
    • Call sites and functional tests updated to use integer levels.
    • Developer notes updated; release notes added.

    Breaking change: scripts/tools using boolean verbosity must switch to integers.

  2. DrahtBot commented at 2:56 am on August 19, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Approach NACK stickies-v

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #33199 (fees: enable CBlockPolicyEstimator return sub 1 sat/vb fee rate estimates by ismaelsadeeq)
    • #32468 (rpc: generateblock to allow multiple outputs by polespinasa)
    • #32138 (wallet, rpc: remove settxfee and paytxfee by polespinasa)
    • #28676 (Cluster mempool implementation by sdaftuar)

    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.

  3. fqlx renamed this:
    Rpc no bool verbosity
    rpc: require integer verbosity; remove boolean 'verbose
    on Aug 19, 2025
  4. DrahtBot added the label RPC/REST/ZMQ on Aug 19, 2025
  5. fqlx renamed this:
    rpc: require integer verbosity; remove boolean 'verbose
    rpc: require integer verbosity; remove boolean 'verbose'
    on Aug 19, 2025
  6. fqlx force-pushed on Aug 19, 2025
  7. DrahtBot added the label CI failed on Aug 19, 2025
  8. fqlx force-pushed on Aug 19, 2025
  9. fqlx force-pushed on Aug 19, 2025
  10. fqlx force-pushed on Aug 19, 2025
  11. stickies-v commented at 11:01 am on August 19, 2025: contributor
    Directionally, this is the right way to go, but I don’t think we should be breaking the API for just this change. Let’s do these cleanups when we can bundle them with other, necessary breaking changes, on a case-by-case basis. Approach NACK.
  12. DrahtBot removed the label CI failed on Aug 19, 2025
  13. fqlx force-pushed on Aug 19, 2025
  14. rpc: require integer verbosity; drop boolean 'verbose'
    - Remove boolean handling from ParseVerbosity() and update callers.
    - getblock/getrawtransaction/getrawmempool no longer accept true/false.
    - Switch functional/Qt tests to integer verbosity.
    - Update release notes and docs.
    248ea17a60
  15. fqlx force-pushed on Aug 19, 2025
  16. maflcko commented at 8:44 am on August 28, 2025: member

    I expect those to be widely used (not only in the internal tests, as you noticed in the repeated force pushes), so this may or may not be a widely breaking change (depending on how much they are used in active projects).

    There is no auto-generated schema or RPC interface, so those projects would have to fix them manually.

    No strong opinion, but maybe this can be closed for now, and revisited when there is a schema generator?

  17. fqlx commented at 8:11 pm on August 28, 2025: none

    I expect those to be widely used (not only in the internal tests, as you noticed in the repeated force pushes), so this may or may not be a widely breaking change (depending on how much they are used in active projects).

    There is no auto-generated schema or RPC interface, so those projects would have to fix them manually.

    No strong opinion, but maybe this can be closed for now, and revisited when there is a schema generator?

    In my opinion, this is a significant breaking change - but it’s one that should have been done in like 2018 and now the tech debt has built up. The reason I’m suggesting this change is because people are completely unaware of the 0,1,2,3 API spec due to the assumption it’s a boolean and it just works. People don’t read the docs Lol. And the boolean flag is compounding a legacy spec. It’s a fair assumption given the tests are outdated too.

  18. achow101 commented at 11:32 pm on August 28, 2025: member
    The way to deprecate these properly would be to first require -deprecatedrpc=boolverbose (or similar) which gates the old behavior. Then the following release can remove them.
  19. fqlx requested review from stickies-v on Sep 4, 2025
  20. in src/common/args.cpp:904 in 9169b9fe31 outdated
    899@@ -900,3 +900,10 @@ std::pair<int, char**> WinCmdLineArgs::get()
    900 }
    901 #endif
    902 } // namespace common
    903+
    904+bool IsDeprecatedRPCEnabled(const std::string& method)
    


    maflcko commented at 12:28 pm on September 4, 2025:
    why is this moved? should be a separate commit with rationale, or reverted?

    fqlx commented at 3:29 pm on September 4, 2025:
    Moved into rpc namespace util.cpp for circular dep
  21. fqlx force-pushed on Sep 4, 2025
  22. rpc-no-bool-verbosity: Add -deprecatedrpc=boolverbose flag
      1. rpc_deprecated.py: Tests that boolean verbosity fails without the deprecation flag
      2. rpc_boolverbose_deprecated.py: Tests that boolean verbosity works with the -deprecatedrpc=boolverbose flag
      3. Updated existing tests: Now expect the new "Boolean verbosity is deprecated" error message
    e01e104206
  23. fqlx force-pushed on Sep 4, 2025

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: 2025-09-12 09:13 UTC

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