rpc: Report -rpcwhitelist denials as JSON-RPC errors #36753

Open
ryanofsky wants to merge 8 commits from pr/rpcdeny into master AGit
ryanofsky commented 2026-11-04 12:56:09 +00:00 (Migrated from github.com)

This PR adds two JSON-RPC error codes for requests refused by -rpcwhitelist, which until now got an HTTP 403 status with an empty body:

  • RPC_METHOD_NOT_PERMITTED (-38) is returned for a refused request, with HTTP 200 for JSON-RPC 2.0 requests and 403 for legacy 1.x requests.
  • RPC_REQUEST_NOT_EXECUTED (-39) is returned for the other requests in a refused batch. A refused batch now gets HTTP 200 and an array with an error for each request, and still runs none of them.

Problem: -rpcwhitelist errors are currently handled differently from other JSON-RPC errors, so clients report them with vague or misleading messages, and for JSON-RPC 2.0 requests the handling does not follow documented behavior. Specifically, requests refused by -rpcwhitelist get HTTP 403 with an empty body, so the refusal shows up as a generic transport error rather than a specific JSON-RPC error. This is especially a problem for JSON-RPC 2.0 requests, which are supposed to report failed method calls only as JSON-RPC errors, not HTTP errors. The empty reply causes a concrete problem when JSON-RPC requests are sent over IPC instead of HTTP: bitcoin-cli -ipcconnect receives only the response body, so a refused call prints a JSON type error instead of a permission error, as described in a private security review. Over HTTP, bitcoin-cli currently stops at the 403 status and prints only "server returned HTTP error 403" instead of the actual error.

Solution: Report whitelist denials like any other failed call: a JSON-RPC error in the body, with the HTTP status the request's version calls for. This brings the behavior in line with the documentation. bitcoin-cli then prints the permission error over both HTTP and IPC, with no change to the IPC interface. The first commit documents how batch requests work, since the documentation didn't mention them. The second adds tests for the current replies, so the later commits' test changes show how each reply changes. Two refactoring commits follow: one suggested in #36642 moves connection fields out of JSONRPCRequest into a new JSONRPCClient struct, and one moves the batch handling out of ExecuteHTTPRPC() into an ExecuteBatch() function. Between them, a small commit makes JSONRPCRequest::parse() reset the fields it sets, so a reused request object can't answer with an earlier request's id. A small bitcoin-cli fix makes -generate report errors from generatetoaddress, which it ignored. The last two commits make the change, in src/httprpc.cpp and src/rpc/protocol.h. Details in the commit messages.

Compatibility: HTTP clients that send "jsonrpc": "2.0" or batches and check for a 403 status need to read the error code instead. Single 1.x requests keep the 403 status, now with an error body.

Open question for review: RPC_METHOD_NOT_PERMITTED could be named RPC_ACCESS_DENIED, and RPC_REQUEST_NOT_EXECUTED is documented as batch-specific but would fit any request refused before it runs.

This PR adds two JSON-RPC error codes for requests refused by `-rpcwhitelist`, which until now got an HTTP 403 status with an empty body: - `RPC_METHOD_NOT_PERMITTED` (-38) is returned for a refused request, with HTTP 200 for JSON-RPC 2.0 requests and 403 for legacy 1.x requests. - `RPC_REQUEST_NOT_EXECUTED` (-39) is returned for the other requests in a refused batch. A refused batch now gets HTTP 200 and an array with an error for each request, and still runs none of them. **Problem:** `-rpcwhitelist` errors are currently handled differently from other JSON-RPC errors, so clients report them with vague or misleading messages, and for JSON-RPC 2.0 requests the handling does not follow [documented behavior](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-11-vs-20). Specifically, requests refused by `-rpcwhitelist` get HTTP 403 with an empty body, so the refusal shows up as a generic transport error rather than a specific JSON-RPC error. This is especially a problem for JSON-RPC 2.0 requests, which are [supposed to](https://github.com/bitcoin/bitcoin/commit/bf1a1f1662427fbf1a43bb951364eface469bdb7) report failed method calls only as JSON-RPC errors, not HTTP errors. The empty reply causes a concrete problem when JSON-RPC requests are sent over IPC instead of HTTP: `bitcoin-cli -ipcconnect` receives only the response body, so a refused call prints a JSON type error instead of a permission error, as described in a [private security review](https://ipcbugs.ofsky.org/audits/ar-56/). Over HTTP, `bitcoin-cli` currently stops at the 403 status and prints only "server returned HTTP error 403" instead of the actual error. **Solution:** Report whitelist denials like any other failed call: a JSON-RPC error in the body, with the HTTP status the request's version calls for. This brings the behavior in line with the documentation. `bitcoin-cli` then prints the permission error over both HTTP and IPC, with no change to the IPC interface. The first commit documents how batch requests work, since the documentation didn't mention them. The second adds tests for the current replies, so the later commits' test changes show how each reply changes. Two refactoring commits follow: one suggested in #36642 moves connection fields out of `JSONRPCRequest` into a new `JSONRPCClient` struct, and one moves the batch handling out of `ExecuteHTTPRPC()` into an `ExecuteBatch()` function. Between them, a small commit makes `JSONRPCRequest::parse()` reset the fields it sets, so a reused request object can't answer with an earlier request's id. A small `bitcoin-cli` fix makes `-generate` report errors from `generatetoaddress`, which it ignored. The last two commits make the change, in `src/httprpc.cpp` and `src/rpc/protocol.h`. Details in the commit messages. Compatibility: HTTP clients that send `"jsonrpc": "2.0"` or batches and check for a 403 status need to read the error code instead. Single 1.x requests keep the 403 status, now with an error body. Open question for review: `RPC_METHOD_NOT_PERMITTED` could be named `RPC_ACCESS_DENIED`, and `RPC_REQUEST_NOT_EXECUTED` is documented as batch-specific but would fit any request refused before it runs.
DrahtBot commented 2026-11-04 12:56:19 +00:00 (Migrated from github.com)

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

External sites

Reviews

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

Type Reviewers
ACK pinheadmz
Concept ACK janb84, winterrdog
Stale ACK Zippo76, hodlinator

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36826 (rpc: Return the right RPCErrorCode more consistently by maflcko)
  • #36200 (rpc: invalid credentials can occupy every HTTP worker by hodlinator)

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.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36753 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36753.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36753#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [pinheadmz](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-6176905177) | | Concept ACK | [janb84](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-5844412500), [winterrdog](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-6180469981) | | Stale ACK | [Zippo76](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-5903519678), [hodlinator](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-5925060210) | 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: * [#36826](https://github.com/bitcoin/bitcoin/pull/36826) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36826.svg"></sub> (rpc: Return the right RPCErrorCode more consistently by maflcko) * [#36200](https://github.com/bitcoin/bitcoin/pull/36200) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36200.svg"></sub> (rpc: invalid credentials can occupy every HTTP worker by hodlinator) 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-->
First-time contributor

🔵 Suggestion · Default-denied users have no batch authorization coverage

Batches from users denied by -rpcwhitelistdefault=1 now depend on per-element authorization, but every default-deny assertion sends a single request.

Location: test/functional/rpc_whitelist.py:297 (head).

🔵 Suggestion · The IPC denial test never exercises a batch reply

The new IPC test covers only single requests, leaving the advertised bitcoin-cli -getinfo -ipcconnect refusal behavior without end-to-end regression coverage.

Location: test/functional/interface_ipc_cli.py:87 (head).

🔵 Suggestion · Refused-batch documentation omits parse-error precedence

The batch documentation promises -38 or -39 for every request, but malformed elements retain their parse errors and notifications receive no reply.

Location: doc/JSON-RPC-interface.md:107 (head).

🔵 Suggestion · The batch-reply commit also changes malformed-batch execution

Commit 7c1c2320 combines a change to which requests execute in malformed batches with the new error format for refused batches.

Location: src/httprpc.cpp:199 (commit).

Review coverage was incomplete.


Reviewed: 7c1c2320ecc5 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:e1a29e5e677c47d383756f0fcf8f3760725c91d1104dd3ccb2f333b6217eba26:47880f5569fd2047d249266f337c4f2a509adf7d96c3ccb1c7644c2c2a650bff --> <!-- ralph-base:2f3f6397bb92beccaccce16742f0574d1617fb3e --> <!-- ralph-head:7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f --> <!-- ralph-case:fe1b9f3a9d820e5fb6bc873189c226f165dab3b96ada0a1b5f76cdedeeba290c --> **🔵 Suggestion · Default-denied users have no batch authorization coverage** Batches from users denied by `-rpcwhitelistdefault=1` now depend on per-element authorization, but every default-deny assertion sends a single request. Location: [`test/functional/rpc_whitelist.py:297`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f/test/functional/rpc_whitelist.py#L297>) (head). **🔵 Suggestion · The IPC denial test never exercises a batch reply** The new IPC test covers only single requests, leaving the advertised `bitcoin-cli -getinfo -ipcconnect` refusal behavior without end-to-end regression coverage. Location: [`test/functional/interface_ipc_cli.py:87`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f/test/functional/interface_ipc_cli.py#L87>) (head). **🔵 Suggestion · Refused-batch documentation omits parse-error precedence** The batch documentation promises `-38` or `-39` for every request, but malformed elements retain their parse errors and notifications receive no reply. Location: [`doc/JSON-RPC-interface.md:107`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f/doc/JSON-RPC-interface.md#L107>) (head). **🔵 Suggestion · The batch-reply commit also changes malformed-batch execution** Commit `7c1c2320` combines a change to which requests execute in malformed batches with the new error format for refused batches. Location: src/httprpc.cpp:199 (commit). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`7c1c2320ecc5`](<https://git.fish.foo/bitcoin/bitcoin/commit/7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f>) · [Review report](<https://review.fish.foo/report/36753-7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f-3495-6.html>) · [Previous reports](<https://review.fish.foo/traces/36753/>) [permalink](<https://review.fish.foo/report/36753-7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f-3495-6.html>)
DrahtBot commented 2026-11-04 14:13:43 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586635980
LLM reason (✨ experimental): CI failed because clang-tidy flagged std::move(*denial) in httprpc.cpp:193 as ineffective on a const reference, and warnings are treated as errors.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `tidy`: https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586635980</sub> <sub>LLM reason (✨ experimental): CI failed because clang-tidy flagged `std::move(*denial)` in `httprpc.cpp:193` as ineffective on a const reference, and warnings are treated as errors.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
ryanofsky commented 2026-11-04 19:08:20 +00:00 (Migrated from github.com)

Updated 8cfdc340b7 -> 21526b182f (pr/rpcdeny.1 -> pr/rpcdeny.2, compare) to fix CI: drop a no-op std::move flagged by clang-tidy https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586635980; and pass the IPC socket path explicitly in the new interface_ipc_cli.py whitelist test, since -ipcconnect=auto can't find it when the datadir path is too long https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586636207

<!-- begin push-2 --> Updated 8cfdc340b779dc9c31f360900d98b8d807192e9b -> 21526b182fa04f557ca3a55650ff643742b8e94d ([`pr/rpcdeny.1`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.1) -> [`pr/rpcdeny.2`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.2), [compare](https://github.com/ryanofsky/bitcoin/compare/pr/rpcdeny.1..pr/rpcdeny.2))<!-- end --> to fix CI: drop a no-op std::move flagged by clang-tidy https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586635980; and pass the IPC socket path explicitly in the new interface_ipc_cli.py whitelist test, since -ipcconnect=auto can't find it when the datadir path is too long https://github.com/bitcoin/bitcoin/actions/runs/41833576128/job/126586636207
pinheadmz commented 2026-11-04 19:20:26 +00:00 (Migrated from github.com)

concept ACK
Narrowly avoiding a merge conflict with https://github.com/bitcoin/bitcoin/pull/36758 but I think 36758 should be merged first, since this PR (36753) exposes that bug to a slightly wider use case.

concept ACK Narrowly avoiding a merge conflict with https://github.com/bitcoin/bitcoin/pull/36758 but I think 36758 should be merged first, since this PR (36753) exposes that bug to a slightly wider use case.
ryanofsky commented 2026-11-05 13:01:09 +00:00 (Migrated from github.com)

Updated 21526b182f -> 3667e19fe9 (pr/rpcdeny.2 -> pr/rpcdeny.3, compare) to address findings from the Ralph LLM review (https://review.fish.foo/traces/36753-8cfdc340b779dc9c31f360900d98b8d807192e9b-2121-1.html): name the denied methods in RPC_REQUEST_NOT_EXECUTED errors so bitcoin-cli -getinfo shows them, report parse errors for malformed requests in refused batches, test that a refused batch has no effect, and add a release note

<!-- begin push-3 --> Updated 21526b182fa04f557ca3a55650ff643742b8e94d -> 3667e19fe9b189662e9ca4c7931c40d348eb34e3 ([`pr/rpcdeny.2`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.2) -> [`pr/rpcdeny.3`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.3), [compare](https://github.com/ryanofsky/bitcoin/compare/pr/rpcdeny.2..pr/rpcdeny.3))<!-- end --> to address findings from the Ralph LLM review (https://review.fish.foo/traces/36753-8cfdc340b779dc9c31f360900d98b8d807192e9b-2121-1.html): name the denied methods in RPC_REQUEST_NOT_EXECUTED errors so `bitcoin-cli -getinfo` shows them, report parse errors for malformed requests in refused batches, test that a refused batch has no effect, and add a release note
fametrano commented 2026-11-10 07:23:29 +00:00 (Migrated from github.com)

My #36642 gives a non-object batch element a null id, so if it lands, the batch loop here can stay as it is.

janb84 asked on #36642 for the same batch replies with or without -rpcwhitelist, and pinheadmz pointed him here. On master, a user without a whitelist gets the previous element's id on that element's error, and this PR extends that reply to whitelisted users. I ran janb84's batches against each PR and their merge (https://gist.github.com/fametrano/2fc9fb4e35b060c3870aaf198668c271/dd9a540a099199d4293f6854f543915a838b0fbb): with both, each user gets the null id. The two merge cleanly (tree 1042df97fa), and either can land first.

My #36642 gives a non-object batch element a null id, so if it lands, the batch loop here can stay as it is. janb84 asked on #36642 for the same batch replies with or without -rpcwhitelist, and pinheadmz pointed him here. On master, a user without a whitelist gets the previous element's id on that element's error, and this PR extends that reply to whitelisted users. I ran janb84's batches against each PR and their merge (https://gist.github.com/fametrano/2fc9fb4e35b060c3870aaf198668c271/dd9a540a099199d4293f6854f543915a838b0fbb): with both, each user gets the null id. The two merge cleanly (tree 1042df97fa), and either can land first.
janb84 (Migrated from github.com) reviewed 2026-11-10 15:26:30 +00:00
janb84 (Migrated from github.com) left a comment

Concept ACK 3667e19fe9

Concept ACK 3667e19fe9b189662e9ca4c7931c40d348eb34e3
Lines 146-155
janb84 (Migrated from github.com) commented 2026-11-10 15:26:02 +00:00

Think this code still has the DOS vector as highlighted by Ralph

Think this code still has the DOS vector as highlighted by Ralph
Zippo76 (Migrated from github.com) reviewed 2026-11-10 21:18:49 +00:00
Zippo76 (Migrated from github.com) left a comment
N Request size Response size Peak observed RSS
800 92 KB 8.5 MB 69 MB
1600 184 KB 33.7 MB 200 MB
3200 370 KB 134 MB 706 MB
| N | Request size | Response size | Peak observed RSS | |-----:|-------------:|--------------:|------------------:| | 800 | 92 KB | 8.5 MB | 69 MB | | 1600 | 184 KB | 33.7 MB | 200 MB | | 3200 | 370 KB | 134 MB | 706 MB |
ryanofsky (Migrated from github.com) reviewed 2026-11-12 18:21:03 +00:00
ryanofsky (Migrated from github.com) left a comment

Thanks for the reviews!

Rebased 3667e19fe9 -> 711222b96f (pr/rpcdeny.3 -> pr/rpcdeny.4, compare) after #36642 was merged:

  • Added a first commit with characterization tests of the current replies, so the later commits' test changes only update expected values.
  • Added two refactoring commits suggested in #36642: a JSONRPCClient struct, so each batch element gets a fresh request without copying anything, and a ProcessBatch() helper shared by executed and refused batches.
  • Bounded the -39 error to at most three short denied method names. Listing all of them in every held-back request's error made the reply size quadratic (reported by janb84 and Ralph).
  • Added a commit fixing bitcoin-cli -generate, which ignored errors from generatetoaddress and reported success when it was denied (Ralph).

The other two findings in that Ralph review are fixed elsewhere: non-object batch elements reusing the previous id by #36642, and malformed 2.0 requests reaching the Assume() in JSONErrorReply() by #36758.

Thanks for the reviews! <!-- begin push-4 --> Rebased 3667e19fe9b189662e9ca4c7931c40d348eb34e3 -> 711222b96fddcf0f5d86e7f4ee3a45942666bbf2 ([`pr/rpcdeny.3`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.3) -> [`pr/rpcdeny.4`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.4), [compare](https://github.com/ryanofsky/bitcoin/compare/pr/rpcdeny.3-rebase..pr/rpcdeny.4))<!-- end --> after #36642 was merged: - Added a first commit with characterization tests of the current replies, so the later commits' test changes only update expected values. - Added two refactoring commits suggested in [#36642](https://github.com/bitcoin/bitcoin/pull/36642): a `JSONRPCClient` struct, so each batch element gets a fresh request without copying anything, and a `ProcessBatch()` helper shared by executed and refused batches. - Bounded the -39 error to at most three short denied method names. Listing all of them in every held-back request's error made the reply size quadratic (reported by [janb84](https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4526778129) and [Ralph](https://review.fish.foo/traces/36753-3667e19fe9b189662e9ca4c7931c40d348eb34e3-2230-3.html#:~:text=Refused%2Dbatch%20summaries%20amplify%20memory%20and%20CPU%20use)). - Added a commit fixing `bitcoin-cli -generate`, which ignored errors from `generatetoaddress` and reported success when it was denied ([Ralph](https://review.fish.foo/traces/36753-3667e19fe9b189662e9ca4c7931c40d348eb34e3-2230-3.html#:~:text=bitcoin%2Dcli%20%2Dgenerate%20reports%20success%20when%20generatetoaddress%20is%20denied)). The other two findings in that [Ralph review](https://review.fish.foo/traces/36753-3667e19fe9b189662e9ca4c7931c40d348eb34e3-2230-3.html) are fixed elsewhere: [non-object batch elements reusing the previous id](https://review.fish.foo/traces/36753-3667e19fe9b189662e9ca4c7931c40d348eb34e3-2230-3.html#:~:text=Non%2Dobject%20batch%20members%20inherit%20another%20request) by #36642, and malformed 2.0 requests reaching the `Assume()` in `JSONErrorReply()` by #36758.
Lines 145-147
ryanofsky (Migrated from github.com) commented 2026-11-12 18:01:10 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#issuecomment-6761562101

In commit "refactor: rpc: move batch loop into ProcessBatch()" (8036a77077)

I ran janb84's batches against each PR and their merge ... with both, each user gets the null id.

Thanks for checking. This PR is now based on #36642, and the reply to a refused batch goes through the same ProcessBatch() loop, so both paths give a non-object element a null id.

re: https://github.com/bitcoin/bitcoin/pull/36753#issuecomment-6761562101 In commit "refactor: rpc: move batch loop into ProcessBatch()" (8036a77077723194f36b3089e66df9d1c6b25dbb) > I ran janb84's batches against each PR and their merge ... with both, each user gets the null id. Thanks for checking. This PR is now based on #36642, and the reply to a refused batch goes through the same `ProcessBatch()` loop, so both paths give a non-object element a null id.
Lines 146-155
ryanofsky (Migrated from github.com) commented 2026-11-12 18:01:09 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4526778129

In commit "rpc: Add RPC_REQUEST_NOT_EXECUTED error for refused -rpcwhitelist batches" (711222b96f)

Think this code still has the DOS vector as highlighted by Ralph

Thanks, you're right. The -39 message listed every denied method and was repeated in each held-back request's error, so the reply could grow with the product of the two. It now names at most three short methods and says how many more there are, so the reply grows linearly with the batch. There's a new test for it.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4526778129 In commit "rpc: Add RPC_REQUEST_NOT_EXECUTED error for refused -rpcwhitelist batches" (711222b96fddcf0f5d86e7f4ee3a45942666bbf2) > Think this code still has the DOS vector as highlighted by Ralph Thanks, you're right. The -39 message listed every denied method and was repeated in each held-back request's error, so the reply could grow with the product of the two. It now names at most three short methods and says how many more there are, so the reply grows linearly with the batch. There's a [new test](https://github.com/bitcoin/bitcoin/blob/711222b96fddcf0f5d86e7f4ee3a45942666bbf2/test/functional/rpc_whitelist.py#L187-L195) for it.
Zippo76 (Migrated from github.com) reviewed 2026-11-14 09:47:06 +00:00
Zippo76 (Migrated from github.com) left a comment

tACK 711222b96f

Tested on macOS 27.2.1 arm64 against master 9183edd25e. Both rpc_whitelist.py and interface_ipc_cli.py from this PR fail on master and pass with this PR.

Retested the cases from my November 10 review:

Case Previous results (3667e19fe9) Current results (711222b96f)
Response size, N = 800 / 1600 / 3200 8.5 / 33.7 / 134 MB 243 / 488 / 978 KB
Peak observed RSS at N = 3200 706 MB 36 MB; 23 MB before the full series
1,000 allowed calls plus one forbidden method with a 10,000-character name 10 MB response 179 KB response
-generate, user allowed only getnewaddress "blocks": null, exit 0 Error -38 for generatetoaddress, exit 38
-generate, unrestricted user with an out-of-range block count "blocks": null, exit 0 Error -1, "JSON integer out of range", exit 1

Response size now scales linearly across the tested batch sizes.

For batches containing a non-object element, master returns HTTP 400 for the entire batch for the restricted user, while the unrestricted user receives per-element responses. With this PR, both users receive the same per-element responses with HTTP 200. The basic whitelist checks from my previous review still behave as expected.

tACK 711222b96f Tested on macOS 27.2.1 arm64 against master `9183edd25e`. Both `rpc_whitelist.py` and `interface_ipc_cli.py` from this PR fail on master and pass with this PR. Retested the cases from my November 10 review: | Case | Previous results (`3667e19fe9`) | Current results (`711222b96f`) | |---|---|---| | Response size, N = 800 / 1600 / 3200 | 8.5 / 33.7 / 134 MB | 243 / 488 / 978 KB | | Peak observed RSS at N = 3200 | 706 MB | 36 MB; 23 MB before the full series | | 1,000 allowed calls plus one forbidden method with a 10,000-character name | 10 MB response | 179 KB response | | `-generate`, user allowed only `getnewaddress` | `"blocks": null`, exit 0 | Error -38 for `generatetoaddress`, exit 38 | | `-generate`, unrestricted user with an out-of-range block count | `"blocks": null`, exit 0 | Error -1, "JSON integer out of range", exit 1 | Response size now scales linearly across the tested batch sizes. For batches containing a non-object element, master returns HTTP 400 for the entire batch for the restricted user, while the unrestricted user receives per-element responses. With this PR, both users receive the same per-element responses with HTTP 200. The basic whitelist checks from my previous review still behave as expected.
hodlinator (Migrated from github.com) approved these changes 2026-11-17 10:38:51 +00:00
hodlinator (Migrated from github.com) left a comment

ACK 711222b96f

This change primarily fixes the error handling bug for RPC over IPC where we get an unexpected JSON value when a user is blocked from executing an RPC due to the whitelist. It also implements much finer grained error reporting when it comes to batched requests and corrects HTTP status codes returned upon permission failure to match the JSON-RPC-interface.md docs. (interface_rpc.py is unchanged by this PR and already demonstrates fine-grained batch errors with expected HTTP status codes).

Happy you implemented a variant of my suggestion to split the client's fields from the requests (with more correct handling of context)!

ACK 711222b96fddcf0f5d86e7f4ee3a45942666bbf2 This change primarily fixes the error handling bug for RPC over IPC where we get an unexpected JSON value when a user is blocked from executing an RPC due to the whitelist. It also implements much finer grained error reporting when it comes to batched requests and corrects HTTP status codes returned upon permission failure to match the JSON-RPC-interface.md docs. (interface_rpc.py is unchanged by this PR and already demonstrates fine-grained batch errors with expected HTTP status codes). Happy you implemented a variant of my suggestion to split the client's fields from the requests (with more correct handling of `context`)!
Lines 178-182
hodlinator (Migrated from github.com) commented 2026-11-17 09:31:56 +00:00

No reason for these to live outside the scope of WhitelistErrorBatch()?

No reason for these to live outside the scope of `WhitelistErrorBatch()`?
hodlinator (Migrated from github.com) commented 2026-11-17 09:48:35 +00:00

nit: This if condition is essentially if (named.empty()) (and unnamed > 0).

Seems clearer:

--- a/src/httprpc.cpp
+++ b/src/httprpc.cpp
@@ -206,10 +206,12 @@ static UniValue WhitelistErrorBatch(const UniValue& valRequest, const std::vecto
     }
     std::string methods{util::Join(named, ", ")};
     const size_t unnamed{seen.size() - named.size()};
-    if (unnamed > 0 && !named.empty()) {
-        methods += strprintf(" and %d more", unnamed);
-    } else if (unnamed > 0) {
-        methods = unnamed == 1 ? "1 method with a long name" : strprintf("%d methods with long names", unnamed);
+    if (unnamed > 0) {
+        if (!named.empty()) {
+            methods += strprintf(" and %d more", unnamed);
+        } else {
+            methods = unnamed == 1 ? "1 method with a long name" : strprintf("%d methods with long names", unnamed);
+        }
     }
     const std::string not_executed{strprintf("Not executed because the batch includes methods the user is not permitted to call: %s", methods)};
 
nit: This if condition is essentially `if (named.empty())` (and `unnamed > 0`). Seems clearer: ```diff --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -206,10 +206,12 @@ static UniValue WhitelistErrorBatch(const UniValue& valRequest, const std::vecto } std::string methods{util::Join(named, ", ")}; const size_t unnamed{seen.size() - named.size()}; - if (unnamed > 0 && !named.empty()) { - methods += strprintf(" and %d more", unnamed); - } else if (unnamed > 0) { - methods = unnamed == 1 ? "1 method with a long name" : strprintf("%d methods with long names", unnamed); + if (unnamed > 0) { + if (!named.empty()) { + methods += strprintf(" and %d more", unnamed); + } else { + methods = unnamed == 1 ? "1 method with a long name" : strprintf("%d methods with long names", unnamed); + } } const std::string not_executed{strprintf("Not executed because the batch includes methods the user is not permitted to call: %s", methods)}; ```
Lines 12-14
hodlinator (Migrated from github.com) commented 2026-11-16 18:43:13 +00:00

nanonit: Would sort structs last:

class UniValue;
enum HTTPStatusCode : int;
struct JSONRPCClient;
nanonit: Would sort `struct`s last: ```suggestion class UniValue; enum HTTPStatusCode : int; struct JSONRPCClient; ```
Lines 61-62
hodlinator (Migrated from github.com) commented 2026-11-16 18:45:30 +00:00

nanonit: Coding style and .clang-format (13f36c020f) suggests:

struct JSONRPCClient {
nanonit: Coding style and .clang-format (13f36c020f0329b5e975282b45292fdf2a495e31) suggests: ```suggestion struct JSONRPCClient { ```
hodlinator (Migrated from github.com) commented 2026-11-16 18:13:36 +00:00

nit: Long line, made me almost miss where call was used:

        args = [self.binary_paths.bitcoincli, f"-datadir={self.nodes[0].datadir_path}", "-rpcpassword=wrong"] + \
               args + (call or ["echo", "foo"])
nit: Long line, made me almost miss where `call` was used: ```suggestion args = [self.binary_paths.bitcoincli, f"-datadir={self.nodes[0].datadir_path}", "-rpcpassword=wrong"] + \ args + (call or ["echo", "foo"]) ```
hodlinator (Migrated from github.com) commented 2026-11-16 18:21:14 +00:00

nit: Could extract the rest of run_test() into test_errors() to keep things clean?

Diff (looks like moving test_whitelist(), but it's actually extracting test_errors())
--- a/test/functional/interface_ipc_cli.py
+++ b/test/functional/interface_ipc_cli.py
@@ -35,28 +35,7 @@ class TestBitcoinIpcCli(BitcoinTestFramework):
         assert_equal(result.stderr, None)
         assert_equal(result.returncode, returncode if returncode is not None else (0 if error is None else 1))
 
-    def test_whitelist(self):
-        """A method the caller may not use, called over IPC.
-
-        The username bitcoin-cli sends over IPC is the -rpcuser value; it selects
-        which -rpcwhitelist applies and is not authenticated.
-        """
-        self.log.info("Testing -rpcwhitelist denials over IPC")
-        # -rpcwhitelistdefault=0 so the whitelist applies only to ipcuser and the
-        # test framework's own cookie connection keeps working.
-        self.restart_node(0, extra_args=["-rpcwhitelistdefault=0", "-rpcwhitelist=ipcuser:getblockcount"])
-        # Name the socket explicitly, because -ipcconnect=auto does not find it
-        # when the datadir path is too long and the socket is in a temporary
-        # directory instead.
-        args = [f"-ipcconnect=unix:{self.nodes[0].ipc_socket_path}", "-rpcuser=ipcuser"]
-        # A permitted method still works, so the whitelist is in force.
-        self.test_cli(args, call=["getblockcount"], expected="0\n")
-        # The reply to a denied method has an empty body, which bitcoin-cli
-        # reports as a JSON type error.
-        self.test_cli(args, error="error: JSON value of type null is not of expected type object")
-        self.restart_node(0)
-
-    def run_test(self):
+    def test_errors(self):
         node = self.nodes[0]
         if node.ipc_tmp_dir:
             self.log.info("Skipping a few checks because temporary directory path is too long")
@@ -84,6 +63,29 @@ class TestBitcoinIpcCli(BitcoinTestFramework):
 
             self.stop_node(0)
 
+    def test_whitelist(self):
+        """A method the caller may not use, called over IPC.
+
+        The username bitcoin-cli sends over IPC is the -rpcuser value; it selects
+        which -rpcwhitelist applies and is not authenticated.
+        """
+        self.log.info("Testing -rpcwhitelist denials over IPC")
+        # -rpcwhitelistdefault=0 so the whitelist applies only to ipcuser and the
+        # test framework's own cookie connection keeps working.
+        self.restart_node(0, extra_args=["-rpcwhitelistdefault=0", "-rpcwhitelist=ipcuser:getblockcount"])
+        # Name the socket explicitly, because -ipcconnect=auto does not find it
+        # when the datadir path is too long and the socket is in a temporary
+        # directory instead.
+        args = [f"-ipcconnect=unix:{self.nodes[0].ipc_socket_path}", "-rpcuser=ipcuser"]
+        # A permitted method still works, so the whitelist is in force.
+        self.test_cli(args, call=["getblockcount"], expected="0\n")
+        # The reply to a denied method has an empty body, which bitcoin-cli
+        # reports as a JSON type error.
+        self.test_cli(args, error="error: JSON value of type null is not of expected type object")
+        self.restart_node(0)
+
+    def run_test(self):
+        self.test_errors()
         self.start_node(0)
         self.test_whitelist()
nit: Could extract the rest of `run_test()` into `test_errors()` to keep things clean? <details><summary>Diff (looks like moving test_whitelist(), but it's actually extracting test_errors())</summary> ```diff --- a/test/functional/interface_ipc_cli.py +++ b/test/functional/interface_ipc_cli.py @@ -35,28 +35,7 @@ class TestBitcoinIpcCli(BitcoinTestFramework): assert_equal(result.stderr, None) assert_equal(result.returncode, returncode if returncode is not None else (0 if error is None else 1)) - def test_whitelist(self): - """A method the caller may not use, called over IPC. - - The username bitcoin-cli sends over IPC is the -rpcuser value; it selects - which -rpcwhitelist applies and is not authenticated. - """ - self.log.info("Testing -rpcwhitelist denials over IPC") - # -rpcwhitelistdefault=0 so the whitelist applies only to ipcuser and the - # test framework's own cookie connection keeps working. - self.restart_node(0, extra_args=["-rpcwhitelistdefault=0", "-rpcwhitelist=ipcuser:getblockcount"]) - # Name the socket explicitly, because -ipcconnect=auto does not find it - # when the datadir path is too long and the socket is in a temporary - # directory instead. - args = [f"-ipcconnect=unix:{self.nodes[0].ipc_socket_path}", "-rpcuser=ipcuser"] - # A permitted method still works, so the whitelist is in force. - self.test_cli(args, call=["getblockcount"], expected="0\n") - # The reply to a denied method has an empty body, which bitcoin-cli - # reports as a JSON type error. - self.test_cli(args, error="error: JSON value of type null is not of expected type object") - self.restart_node(0) - - def run_test(self): + def test_errors(self): node = self.nodes[0] if node.ipc_tmp_dir: self.log.info("Skipping a few checks because temporary directory path is too long") @@ -84,6 +63,29 @@ class TestBitcoinIpcCli(BitcoinTestFramework): self.stop_node(0) + def test_whitelist(self): + """A method the caller may not use, called over IPC. + + The username bitcoin-cli sends over IPC is the -rpcuser value; it selects + which -rpcwhitelist applies and is not authenticated. + """ + self.log.info("Testing -rpcwhitelist denials over IPC") + # -rpcwhitelistdefault=0 so the whitelist applies only to ipcuser and the + # test framework's own cookie connection keeps working. + self.restart_node(0, extra_args=["-rpcwhitelistdefault=0", "-rpcwhitelist=ipcuser:getblockcount"]) + # Name the socket explicitly, because -ipcconnect=auto does not find it + # when the datadir path is too long and the socket is in a temporary + # directory instead. + args = [f"-ipcconnect=unix:{self.nodes[0].ipc_socket_path}", "-rpcuser=ipcuser"] + # A permitted method still works, so the whitelist is in force. + self.test_cli(args, call=["getblockcount"], expected="0\n") + # The reply to a denied method has an empty body, which bitcoin-cli + # reports as a JSON type error. + self.test_cli(args, error="error: JSON value of type null is not of expected type object") + self.restart_node(0) + + def run_test(self): + self.test_errors() self.start_node(0) self.test_whitelist() ``` </details>
DrahtBot commented 2026-11-27 13:09:53 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
pinheadmz (Migrated from github.com) reviewed 2026-12-02 21:11:56 +00:00
pinheadmz (Migrated from github.com) left a comment

code review at 711222b96f

Still waiting for #36758 merge and rebase on top of that but I wanted to get this PR into my brain today. I left several questions and a few nits. I also agree with @Zippo76 about perhaps logging too much.

Built and tested on macos/arm64, manually tested the behavior change with eccentric RPC requests and batches. I still need to test the IPC behavior locally and try some mutations against the tests.

code review at 711222b96fddcf0f5d86e7f4ee3a45942666bbf2 Still waiting for #36758 merge and rebase on top of that but I wanted to get this PR into my brain today. I left several questions and a few nits. I also agree with @Zippo76 about perhaps logging too much. Built and tested on macos/arm64, manually tested the behavior change with eccentric RPC requests and batches. I still need to test the IPC behavior locally and try some mutations against the tests.
pinheadmz (Migrated from github.com) commented 2026-12-02 18:53:48 +00:00

0afef9d734

Remark: this logic already exists for the other "macros" -getinfo -netinfo -getaddrinfo

0afef9d734e354ce78c05d96792e9ce12e46d868 Remark: this logic already exists for the other "macros" -getinfo -netinfo -getaddrinfo
Lines 107-108
pinheadmz (Migrated from github.com) commented 2026-12-02 16:31:39 +00:00

e49c9aced7

I was confused by this comment at first but I think its indicative of this whole function trying to do too much with the batch processing and its own try/catch nested inside the singleton request logic. Maybe you clean that up in another commit in this PR... But it'd be nice if it were simpler

set variables
try { 
stuff
} catch {
use variables
}
e49c9aced7be8e252620a35fa321b0b4aa8ac08f I was confused by this comment at first but I think its indicative of this whole function trying to do too much with the batch processing and its own try/catch nested inside the singleton request logic. Maybe you clean that up in another commit in this PR... But it'd be nice if it were simpler ``` set variables try { stuff } catch { use variables }
pinheadmz (Migrated from github.com) commented 2026-12-02 18:43:58 +00:00

8036a77077

I don't understand passing a handler-lambda here instead of just calling JSONRPCExec() directly in ProcessBatch()

Also, and maybe this is coming up in another commit, it seems like we could just go directly to ProcessBatch() early if valRequest.isArray() and handle the whitelist auth in ProcessBatch()

8036a77077723194f36b3089e66df9d1c6b25dbb I don't understand passing a handler-lambda here instead of just calling `JSONRPCExec()` directly in `ProcessBatch()` Also, and maybe this is coming up in another commit, it seems like we could just go directly to `ProcessBatch()` early if `valRequest.isArray()` and handle the whitelist auth in `ProcessBatch()`
pinheadmz (Migrated from github.com) commented 2026-12-02 20:15:12 +00:00

711222b96f

This is all pretty amusing actually and feels over-engineered but the kind of over-engineering I'm getting used to expecting from LLMs ;-) I played around with different combinations of requests in batches and it's honestly impressive how generously verbose the response is.

One thing I noticed is {"method":""} will get "User is not permitted to call method " or the user is not permitted to call: and 2 more" which I think can be cleaned up with single quotes around the rejected method names.

Unless we should be rejecting empty method names for some lower level syntax reason...

711222b96fddcf0f5d86e7f4ee3a45942666bbf2 This is all pretty amusing actually and feels over-engineered but the kind of over-engineering I'm getting used to expecting from LLMs ;-) I played around with different combinations of requests in batches and it's honestly impressive how generously verbose the response is. One thing I noticed is `{"method":""}` will get `"User is not permitted to call method "` or `the user is not permitted to call: and 2 more"` which I think can be cleaned up with single quotes around the rejected method names. Unless we should be rejecting empty method names for some lower level syntax reason...
pinheadmz (Migrated from github.com) commented 2026-12-02 21:02:55 +00:00

e49c9aced7

bikeshedding nit: These data describe an HTTP request I think, not to be confused with a jsonrpc request which there might be more than one of in a batch contained in the total payload from the client. Just something about URI, authUser, and context fields which don't really describe a client.

However we are already using HTTPClient and HTTPRequest in the codebase and the rest of this PR uses client so I dunno. Even calling it HTTPContext with field nodeContext might be more clear.

e49c9aced7be8e252620a35fa321b0b4aa8ac08f bikeshedding nit: These data describe an HTTP request I think, not to be confused with a jsonrpc request which there might be more than one of in a batch contained in the total payload from the client. Just something about `URI`, `authUser`, and `context` fields which don't really describe a client. However we are already using `HTTPClient` and `HTTPRequest` in the codebase and the rest of this PR uses `client` so I dunno. Even calling it `HTTPContext` with field `nodeContext` might be more clear.
pinheadmz (Migrated from github.com) commented 2026-12-02 15:49:57 +00:00

3ecef70658

as long as you're here you can swap in the new HTTPConnection helper from netutil.py see #36916

3ecef706587a0878bf3efa0cf7b5b7811dab6f77 as long as you're here you can swap in the new `HTTPConnection` helper from `netutil.py` see #36916
pinheadmz (Migrated from github.com) commented 2026-12-02 16:00:15 +00:00

3ecef70658

looks like you only use this along with assert_equal, could just call the function assert_reply and do the check here? Not a huge change but a function called "reply" I expect to some data back to someone.

3ecef706587a0878bf3efa0cf7b5b7811dab6f77 looks like you only use this along with `assert_equal`, could just call the function `assert_reply` and do the check here? Not a huge change but a function called "reply" I expect to some data back to someone.
ryanofsky (Migrated from github.com) reviewed 2026-12-03 15:38:16 +00:00
ryanofsky (Migrated from github.com) left a comment

Thanks for the reviews!

Rebased 711222b96f -> dfcdc8b80a (pr/rpcdeny.4 -> pr/rpcdeny.5, compare) after #36758 was merged, with changes from review:

  • Restructured ExecuteHTTPRPC() as pinheadmz suggested. The third commit now moves the whole batch branch, including the -rpcwhitelist check, into an ExecuteBatch() function that calls JSONRPCExec() directly, replacing ProcessBatch() and its callback. A refused single request now throws its error for both JSON-RPC versions and lets JSONErrorReply() answer it, which works now that #36758 made JSONErrorReply() handle 2.0 requests.
  • Added a commit resetting the parsed fields at the start of JSONRPCRequest::parse(), suggested by janb84 on #36758.
  • A refused batch now logs only its first denial, as on master, instead of a warning per denied request (Zippo76, pinheadmz).
  • Quoted the method names in the -38 and -39 messages, so an empty name is visible (pinheadmz).
  • The -38 commit now keeps the empty 403 reply for refused batches, so the new batch reply only appears in the last commit (Ralph). Added tests for notifications in refused batches (Ralph) and a test for a batch whose denied request is also malformed. The release note now covers more of the changes, and each commit that changes behavior adds its own items to it (Ralph, Ralph).
  • Documented batch requests in doc/JSON-RPC-interface.md, which didn't mention them: requests in a batch are handled independently, except that a batch with a refused method is refused as a whole. The -rpcwhitelist text there now names the -38 error.
  • Took hodlinator's six suggestions and renamed the reply() test helper to parse_response().
Thanks for the reviews! <!-- begin push-5 --> Rebased 711222b96fddcf0f5d86e7f4ee3a45942666bbf2 -> dfcdc8b80a3bfb9e0c11cc0859c971a300bca894 ([`pr/rpcdeny.4`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.4) -> [`pr/rpcdeny.5`](https://github.com/ryanofsky/bitcoin/commits/pr/rpcdeny.5), [compare](https://github.com/ryanofsky/bitcoin/compare/pr/rpcdeny.4-rebase..pr/rpcdeny.5))<!-- end --> after #36758 was merged, with changes from review: - Restructured `ExecuteHTTPRPC()` as [pinheadmz suggested](https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4774215330). The third commit now moves the whole batch branch, including the `-rpcwhitelist` check, into an `ExecuteBatch()` function that calls `JSONRPCExec()` directly, replacing `ProcessBatch()` and its callback. A refused single request now throws its error for both JSON-RPC versions and lets `JSONErrorReply()` answer it, which works now that #36758 made `JSONErrorReply()` handle 2.0 requests. - Added a commit resetting the parsed fields at the start of `JSONRPCRequest::parse()`, [suggested by janb84](https://github.com/bitcoin/bitcoin/pull/36758#discussion_r4773174350) on #36758. - A refused batch now logs only its first denial, as on master, instead of a warning per denied request ([Zippo76](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-5849599854), [pinheadmz](https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-6154256166)). - Quoted the method names in the -38 and -39 messages, so an empty name is visible ([pinheadmz](https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4775400797)). - The -38 commit now keeps the empty 403 reply for refused batches, so the new batch reply only appears in the last commit ([Ralph](https://review.fish.foo/report/36753-711222b96fddcf0f5d86e7f4ee3a45942666bbf2-2604-4.html#finding-finding%3A3)). Added tests for notifications in refused batches ([Ralph](https://review.fish.foo/report/36753-711222b96fddcf0f5d86e7f4ee3a45942666bbf2-2604-4.html#finding-finding%3A2)) and a test for a batch whose denied request is also malformed. The release note now covers more of the changes, and each commit that changes behavior adds its own items to it ([Ralph](https://review.fish.foo/report/36753-711222b96fddcf0f5d86e7f4ee3a45942666bbf2-2604-4.html#finding-finding%3A1), [Ralph](https://review.fish.foo/report/36753-711222b96fddcf0f5d86e7f4ee3a45942666bbf2-2604-4.html#finding-finding%3A4)). - Documented batch requests in `doc/JSON-RPC-interface.md`, which didn't mention them: requests in a batch are handled independently, except that a batch with a refused method is refused as a whole. The `-rpcwhitelist` text there now names the -38 error. - Took hodlinator's six suggestions and renamed the `reply()` test helper to `parse_response()`.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:21 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4774344375

Right, this just makes -generate check for an error reply the way the other handlers already do. It was the odd one out, so it turned errors from its second call into "blocks": null and exit code 0.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4774344375 Right, this just makes `-generate` check for an error reply the way the other handlers already do. It was the odd one out, so it turned errors from its second call into `"blocks": null` and exit code 0.
Lines 107-108
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:19 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772820544

set variables / try { stuff } catch { use variables }

Thanks, the latest push gives ExecuteHTTPRPC() that shape. It declares the request, then inside the try hands an array to ExecuteBatch() (see the other thread), and parses and runs a single request. The denial is now just a throw for both JSON-RPC versions, so the catch blocks build every error reply from the request through JSONErrorReply(). I also rewrote the comment above jreq to say what it is used for.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772820544 > set variables / try { stuff } catch { use variables } Thanks, the latest push gives `ExecuteHTTPRPC()` that shape. It declares the request, then inside the `try` hands an array to `ExecuteBatch()` (see [the other thread](https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4786993260)), and parses and runs a single request. The denial is now just a `throw` for both JSON-RPC versions, so the `catch` blocks build every error reply from the request through `JSONErrorReply()`. I also rewrote the comment above `jreq` to say what it is used for.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:27 +00:00

In commit "rpc: Add RPC_REQUEST_NOT_EXECUTED error for refused -rpcwhitelist batches" (dfcdc8b80a)

re: https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-6154256166

I also agree with @Zippo76 about perhaps logging too much.

Agreed, and thanks @Zippo76 for measuring it. The latest push logs only the first denial in a batch, as master did when it stopped at the first one, so a refused batch writes one warning however many denied requests it has. The test checks that the second denial isn't logged.

In commit "rpc: Add RPC_REQUEST_NOT_EXECUTED error for refused -rpcwhitelist batches" (dfcdc8b80a3bfb9e0c11cc0859c971a300bca894) re: https://github.com/bitcoin/bitcoin/pull/36753#pullrequestreview-6154256166 > I also agree with @Zippo76 about perhaps logging too much. Agreed, and thanks @Zippo76 for measuring it. The latest push logs only the first denial in a batch, as master did when it stopped at the first one, so a refused batch writes one warning however many denied requests it has. The test checks that the second denial isn't logged.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:17 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4774215330

it seems like we could just go directly to ProcessBatch() early if valRequest.isArray() and handle the whitelist auth in ProcessBatch()

Agreed, this is better, and it's what the latest push does. The lambda was only there so the refused-batch reply in the last commit could reuse the loop, but that's simpler as a branch inside the loop. The third commit now moves the whole batch branch, including the whitelist check, into an ExecuteBatch() function that calls JSONRPCExec() directly, and ExecuteHTTPRPC() returns it as soon as it sees an array. The last commit changes ExecuteBatch() in place.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4774215330 > it seems like we could just go directly to `ProcessBatch()` early if `valRequest.isArray()` and handle the whitelist auth in `ProcessBatch()` Agreed, this is better, and it's what the latest push does. The lambda was only there so the refused-batch reply in the last commit could reuse the loop, but that's simpler as a branch inside the loop. The third commit now moves the whole batch branch, including the whitelist check, into an `ExecuteBatch()` function that calls `JSONRPCExec()` directly, and `ExecuteHTTPRPC()` returns it as soon as it sees an array. The last commit changes `ExecuteBatch()` in place.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:10 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4597846978

Thanks, took this and your other five suggestions in the latest push: the wrapped test_cli() line, test_errors(), the forward declaration order, the struct brace, and the constants, which now live inside the function that builds this message (NotExecutedMessage(), which replaced WhitelistErrorBatch() when the batch code was restructured).

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4597846978 Thanks, took this and your other five suggestions in the latest push: the wrapped `test_cli()` line, `test_errors()`, the forward declaration order, the struct brace, and the constants, which now live inside the function that builds this message (`NotExecutedMessage()`, which replaced `WhitelistErrorBatch()` when the batch code was restructured).
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:23 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4775400797

{"method":""} will get "User is not permitted to call method "

Thanks, the latest push quotes the method names in both messages (... call method '') and adds a test for an empty name.

This is all pretty amusing actually and feels over-engineered but the kind of over-engineering I'm getting used to expecting from LLMs ;-)

This is one of the areas where I find myself agreeing more with LLMs than with other developers. I think we often don't distinguish between different kinds of complexity and push back on all of it, when only one kind is really a problem. Complexity that's spread out, through shared state or logic split across many places, makes a codebase hard to understand and work with. Complexity that's encapsulated behind a single function or class interface can make software easier to use, not harder, in the context of the larger system. This function is an example of the second kind: it's internally fiddly, but it's a local helper that changes no state, takes the batch and returns an error string, and its only job is to give users clear feedback.

Without this feedback, clients like bitcoin-cli -getinfo only show the first error in a batch reply, and that's usually a held-back request's -39 error rather than the -38 error for the method that was actually denied. So the -39 message names the denied methods, so the user can tell which call to drop (wallet calls, in the -getinfo case). The cap on how many names it lists, and how long they can be, is there because the message is repeated in every held-back request's error, which made the reply size quadratic before janb84 pointed it out in https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4526778129.

Note: while writing the test I noticed that a trailing comma in -rpcwhitelist (as user1 in this test has) permits the empty method name, since the empty field after the comma ends up in the whitelist. That's harmless (the call then fails with "Method not found") and is unchanged by this PR.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4775400797 > `{"method":""}` will get `"User is not permitted to call method "` Thanks, the latest push quotes the method names in both messages (`... call method ''`) and adds a test for an empty name. > This is all pretty amusing actually and feels over-engineered but the kind of over-engineering I'm getting used to expecting from LLMs ;-) This is one of the areas where I find myself agreeing more with LLMs than with other developers. I think we often don't distinguish between different kinds of complexity and push back on all of it, when only one kind is really a problem. Complexity that's spread out, through shared state or logic split across many places, makes a codebase hard to understand and work with. Complexity that's encapsulated behind a single function or class interface can make software easier to use, not harder, in the context of the larger system. This function is an example of the second kind: it's internally fiddly, but it's a local helper that changes no state, takes the batch and returns an error string, and its only job is to give users clear feedback. Without this feedback, clients like `bitcoin-cli -getinfo` only show the first error in a batch reply, and that's usually a held-back request's -39 error rather than the -38 error for the method that was actually denied. So the -39 message names the denied methods, so the user can tell which call to drop (wallet calls, in the `-getinfo` case). The cap on how many names it lists, and how long they can be, is there because the message is repeated in every held-back request's error, which made the reply size quadratic before janb84 pointed it out in https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4526778129. Note: while writing the test I noticed that a trailing comma in `-rpcwhitelist` (as `user1` in this test has) permits the empty method name, since the empty field after the comma ends up in the whitelist. That's harmless (the call then fails with "Method not found") and is unchanged by this PR.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:25 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4776008806

These data describe an HTTP request I think

They describe the HTTP request for HTTP callers, but not every caller is HTTP: bitcoin-cli -ipcconnect requests come in through RpcImpl::executeRpc over IPC, and ChainImpl::executeRpc fills it in for internal calls, so I'd avoid an HTTP name. The idea of "client" is the thing that sent the request, which every element of a batch shares. I don't feel strongly about the name, though, so happy to change it if you have a better one.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4776008806 > These data describe an HTTP request I think They describe the HTTP request for HTTP callers, but not every caller is HTTP: `bitcoin-cli -ipcconnect` requests come in through [`RpcImpl::executeRpc`](https://github.com/bitcoin/bitcoin/blob/dfcdc8b80a3bfb9e0c11cc0859c971a300bca894/src/node/interfaces.cpp#L1063-L1072) over IPC, and [`ChainImpl::executeRpc`](https://github.com/bitcoin/bitcoin/blob/dfcdc8b80a3bfb9e0c11cc0859c971a300bca894/src/node/interfaces.cpp#L364-L373) fills it in for internal calls, so I'd avoid an `HTTP` name. The idea of "client" is the thing that sent the request, which every element of a batch shares. I don't feel strongly about the name, though, so happy to change it if you have a better one.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:12 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772269816

Done. #36916 already switched this file to the netutil.py helper on master, and the rebase keeps it in rpcpost().

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772269816 Done. #36916 already switched this file to the `netutil.py` helper on master, and the rebase keeps it in `rpcpost()`.
ryanofsky (Migrated from github.com) commented 2026-12-03 15:26:15 +00:00

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772418387

a function called "reply" I expect to send data back

Good point, renamed it to parse_response(). I kept it returning the value instead of making it assert_reply(), because a few checks look at one element of the result (parse_response(resp)[1][0]["error"]) instead of comparing the whole reply.

re: https://github.com/bitcoin/bitcoin/pull/36753#discussion_r4772418387 > a function called "reply" I expect to send data back Good point, renamed it to `parse_response()`. I kept it returning the value instead of making it `assert_reply()`, because a few checks look at one element of the result (`parse_response(resp)[1][0]["error"]`) instead of comparing the whole reply.
DrahtBot commented 2026-12-03 16:33:16 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task tidy: https://github.com/bitcoin/bitcoin/actions/runs/47139517821/job/144370827671
LLM reason (✨ experimental): tidy_fail: clang-tidy reports bugprone-use-after-move in httprpc.cpp (treated as an error).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening.

  • A functional or integration test failure may be intermittent or unrelated to this pull request.
    If no dedicated issue thread exists, create a new one to track it.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `tidy`: https://github.com/bitcoin/bitcoin/actions/runs/47139517821/job/144370827671</sub> <sub>LLM reason (✨ experimental): tidy_fail: clang-tidy reports `bugprone-use-after-move` in `httprpc.cpp` (treated as an error).</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * Intermittent network issues can occur; re-run CI for now, and report the issue if they keep happening. * A functional or integration test failure may be intermittent or unrelated to this pull request. If no dedicated issue thread exists, create a new one to track it. Leave a comment here, if you need help tracking down a confusing failure. </details>
pinheadmz (Migrated from github.com) approved these changes 2026-12-03 20:26:34 +00:00
pinheadmz (Migrated from github.com) left a comment

ACK 7c1c2320ec

Built and tested on macos/arm64. Played with the new errors via http and bitcoin-cli -ipcconnect, comparing to master. It's a big improvement in the UX for RPC over IPC.

I noticed a few things that are redundant with the rebase on master (I think...?)

Also noticed some slight differences in UX between HTTP and IPC simply because rpcpassword is ignored over IPC, so for example over IPC an unauthorized request gets

User is not permitted to call any methods

but over HTTP that same request gets

Incorrect rpcuser or rpcpassword were specified.

... I don't see this as a blocker at all.

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK 7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f
-----BEGIN PGP SIGNATURE-----

iQJPBAEBCAA5FiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmsRz5gbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMCwzAAoJEOfimEtiick6HXAQAMqEk7uTHW2ca78/v74g
D9leU5ELOsxuVzM1FPYgFEXw1UDOgby9wFDrX/USzUyQgc5E/cGc3LqFqn5WCfsS
Rn3VRdR3uUKlnA/46IqnNcuShWwH1qxrgXAaSz2uC36x1UjdgPeQhJLgDRG+G8In
d8h4Jg4bKlB9MTn7vOMlnosT2HqGIEgODOutvJPFccy9S6mZrWPfONn19VVEJ//3
vUNL7LE5NlP2T2hgxgxoTEjYqRnvYbZjDfLs3J+rbshnh0YaILG8sAPCodhCR6Sz
DLR65slZVXkNQJo6bSiUUMqK4L4+VKqi+P+CFVHJWrfUPyRMwm27XAVio/ofjFyW
qmJ68CorpLTJzahav4AY4rSizsuUeXAZRs7b3xqAZxXlX2WDOmR0Wg42/JTcvimf
e2VXM/+HfOgyBgJS3+ZPZ5DGl0/UACzCvPwNssEGr88Fp9vojKI+PlzDehvGMyEF
1e7ToHybebIDTwBPgtooYjjnmE3wvpKxiu3IgET0xaBeyGDorSZCHc/c5Ifl/be5
qC+xlpijbZFVsFuBxU35Kq5iSGYbWyXpws2uEvXYQhlwYbyEBPfPkz4B/GfbsFmZ
vNwQlgzFjzEVsVublWr0hrlv+qb63gx4okt5+4K5qAd1Tj2HE0GVjukAge+RelRi
Q2nIJluLJuYzFfngipb0yHd4
=JUpf
-----END PGP SIGNATURE-----

pinheadmz's public key is on openpgp.org

ACK 7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f Built and tested on macos/arm64. Played with the new errors via http and bitcoin-cli -ipcconnect, comparing to master. It's a big improvement in the UX for RPC over IPC. I noticed a few things that are redundant with the rebase on master (I think...?) Also noticed some slight differences in UX between HTTP and IPC simply because `rpcpassword` is ignored over IPC, so for example over IPC an unauthorized request gets > User is not permitted to call any methods but over HTTP that same request gets > Incorrect rpcuser or rpcpassword were specified. ... I don't see this as a blocker at all. <details><summary>Show Signature</summary> ``` -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ACK 7c1c2320ecc5eb3ef09ad530c5daedc03ae4556f -----BEGIN PGP SIGNATURE----- iQJPBAEBCAA5FiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmsRz5gbFIAAAAAABAAO bWFudTIsMi41KzEuMTIsMCwzAAoJEOfimEtiick6HXAQAMqEk7uTHW2ca78/v74g D9leU5ELOsxuVzM1FPYgFEXw1UDOgby9wFDrX/USzUyQgc5E/cGc3LqFqn5WCfsS Rn3VRdR3uUKlnA/46IqnNcuShWwH1qxrgXAaSz2uC36x1UjdgPeQhJLgDRG+G8In d8h4Jg4bKlB9MTn7vOMlnosT2HqGIEgODOutvJPFccy9S6mZrWPfONn19VVEJ//3 vUNL7LE5NlP2T2hgxgxoTEjYqRnvYbZjDfLs3J+rbshnh0YaILG8sAPCodhCR6Sz DLR65slZVXkNQJo6bSiUUMqK4L4+VKqi+P+CFVHJWrfUPyRMwm27XAVio/ofjFyW qmJ68CorpLTJzahav4AY4rSizsuUeXAZRs7b3xqAZxXlX2WDOmR0Wg42/JTcvimf e2VXM/+HfOgyBgJS3+ZPZ5DGl0/UACzCvPwNssEGr88Fp9vojKI+PlzDehvGMyEF 1e7ToHybebIDTwBPgtooYjjnmE3wvpKxiu3IgET0xaBeyGDorSZCHc/c5Ifl/be5 qC+xlpijbZFVsFuBxU35Kq5iSGYbWyXpws2uEvXYQhlwYbyEBPfPkz4B/GfbsFmZ vNwQlgzFjzEVsVublWr0hrlv+qb63gx4okt5+4K5qAd1Tj2HE0GVjukAge+RelRi Q2nIJluLJuYzFfngipb0yHd4 =JUpf -----END PGP SIGNATURE----- ``` pinheadmz's public key is [on openpgp.org](https://keys.openpgp.org/vks/v1/by-fingerprint/E61773CD6E01040E2F1BD78CE7E2984B6289C93A) </details>
Lines 50-53
pinheadmz (Migrated from github.com) commented 2026-12-03 20:01:58 +00:00
82dff389774306d246d7654a14288fd08eab5d5a Didn't we already determine this was dead code? https://github.com/bitcoin/bitcoin/pull/36758#discussion_r4589017331
pinheadmz (Migrated from github.com) commented 2026-12-03 19:42:03 +00:00

ec6a99140d

nit Might be worth mentioning that at this point if the user is not in the whitelist, it means they can execute anything, checked by the caller ExecuteHTTPRPC()

ec6a99140dc9c2d74c91055fbc411188751a1b0b nit Might be worth mentioning that at this point if the user is not in the whitelist, it means they can execute anything, checked by the caller `ExecuteHTTPRPC()`
Lines 223-226
pinheadmz (Migrated from github.com) commented 2026-12-03 19:25:56 +00:00

ed0bcf6c9a

Hm, the changes in this commit were proposed almost exactly the same in #36642 but that PR discussion it was decided to make the caller responsible. I think this commit is a no-op since that was merged.

https://github.com/bitcoin/bitcoin/pull/36642#discussion_r4494106574

ed0bcf6c9a2cbbd82a134fe4badd9f4472e68ce0 Hm, the changes in this commit were proposed almost exactly the same in #36642 but that PR discussion it was decided to make the caller responsible. I think this commit is a no-op since that was merged. https://github.com/bitcoin/bitcoin/pull/36642#discussion_r4494106574
winterrdog (Migrated from github.com) reviewed 2026-12-03 23:27:13 +00:00
winterrdog (Migrated from github.com) left a comment

concept ACK

concept ACK
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36753
No description provided.