Review report

bitcoin/bitcoin: PR #36384

2 suggestions

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

Optional improvements

Link

[suggestion] · The no-behavior-change note omits psbt_version error changes

For requests that reach version parsing, walletcreatefundedpsbt changes error codes for some invalid psbt_version values, so fa5d7ec8's no-behavior-change statement needs another exception.

Location: src/wallet/rpc/spend.cpp:1820 (head).

Details and suggested fix

The old code parsed psbt_version with getInt<int>() into a uint32_t; Arg<uint32_t> instead calls getInt<uint32_t>(). After FundTransaction succeeds, an input such as -1 previously converted to 4294967295 and reached RPC_INVALID_PARAMETER (-8), "The PSBT version can only be 2 or 0". It now fails unsigned from_chars parsing with "JSON integer out of range", which ExecuteCommand maps to RPC_MISC_ERROR (-1). Values in (INT_MAX, UINT32_MAX] change in the opposite direction, from -1 to -8. Both versions still accept only 0 and 2. The new parsing aligns with createpsbt, converttopsbt and psbtbumpfee, so retaining it is reasonable. Mention this alignment and error-reporting change alongside the maxtries exception in fa5d7ec8's commit message. No current in-tree caller producing these inputs was found, so practical impact is unconfirmed.


Link

[suggestion] · The helper unit test misses the two new Arg specializations

rpc_arg_helper never calls the new Arg<double> or Arg<int64_t> specializations, although functional tests exercise their RPC callers indirectly.

Location: src/rpc/util.cpp:738 (head).

Details and suggested fix

The new specializations serve estimaterawfee.threshold and setban.bantime, with defaults of 0.95 and 0. The focused test checks Arg<int>, Arg<std::string_view>, Arg<uint64_t> and Arg<bool>, but its double checks use the separate MaybeArg<double> specialization. A regression confined to either new Arg specialization would therefore leave these assertions passing. Add defaulted double and int64_t parameters to the fixture, for example with defaults 0.5 and -1, and check both helpers in the null/default and supplied-value requests. This is a focused unit-test gap rather than an untested RPC path: rpc_estimatefee.py already calls the threshold variants, and p2p_disconnect_ban.py supplies explicit bantimes.


Coverage details

Earlier concerns

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