rpc: handle malformed jsonrpc 2.0 requests correctly

bitcoin/bitcoin: PR #36758

1 minor finding

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.

Findings

Link

[minor] · The notification wording does not match malformed batch handling

The new “valid requests” wording conflicts with pre-existing suppression of malformed id-less JSON-RPC 2.0 batch members, despite corrected singleton reporting; no current production caller producing this input was found.

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

Details and suggested fix

With default RPC whitelist settings, an authenticated client sending {"jsonrpc":"2.0","method":1} alone now receives HTTP 200 with an Invalid Request error and "id": null. Inside a batch, parse() clears the absent id and recognizes V2 before throwing. The batch catch constructs the error, but the subsequent IsNotification() check discards it because that check does not require successful parsing. A batch containing only such objects therefore returns HTTP 204 without a body, contrary to the distinction documented here. Limit batch reply suppression to successfully parsed notifications, for example by setting a flag after parse() succeeds. This preserves suppression for valid notifications whose execution fails, since JSONRPCExec(..., true) catches execution errors. Update the existing ALL-notifications batch expectation, which currently suppresses its missing-method member, and add a singleton/batch comparison for the same malformed object.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.