rpc: require integer verbosity; remove boolean 'verbose'#33214
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33214. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
06f5504 to
97a2eca
Compare
dd06f31 to
5378c20
Compare
5378c20 to
66a2640
Compare
- 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.
66a2640 to
248ea17
Compare
|
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 |
|
The way to deprecate these properly would be to first require |
171af8b to
e01e104
Compare
e01e104 to
2d9e67c
Compare
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
2d9e67c to
457a21a
Compare
maflcko
left a comment
There was a problem hiding this comment.
not sure where this pull is going, but it could make sense to split out the test changes into a separate pull (replacing the deprecated values with integers and named args), except for one deprecated value for each RPC, so that all code branches remain tests, but most code is using the new way and named args.
| } | ||
| } | ||
|
|
||
| bool IsDeprecatedRPCEnabled(const std::string& method) |
| assert_raises_rpc_error(-3, "Verbosity was boolean but only integer allowed", node.getorphantxs, verbosity=True) | ||
| assert_raises_rpc_error(-3, "Verbosity was boolean but only integer allowed", node.getorphantxs, verbosity=False) | ||
| assert_raises_rpc_error(-3, "Boolean verbosity is deprecated", node.getorphantxs, verbosity=True) | ||
| assert_raises_rpc_error(-3, "Boolean verbosity is deprecated", node.getorphantxs, verbosity=False) |
There was a problem hiding this comment.
seems odd to change the behavior here to allow deprecated values when they were forbidden
| if "coinbase" not in vin: | ||
| prevout_tx = self.nodes[0].getrawtransaction( | ||
| vin["txid"], True) | ||
| vin["txid"], 1) |
There was a problem hiding this comment.
when passing integral literal values, it makes sense to use named args, otherwise it is not clear what they mean from reading just the code
|
🐙 This pull request conflicts with the target branch and needs rebase. |
|
⌛ There hasn't been much activity lately and the patch still needs rebase. What is the status here?
|
Summary
Standardize RPC verbosity to integers only and remove boolean handling for clarity, consistency, and future extensibility.
Rationale
User-visible changes
Code / Docs
Breaking change: scripts/tools using boolean verbosity must switch to integers.