Review report

core: PR #36167

6 suggestions

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

Optional improvements

Link

[suggestion] · The refactor changes accepted numeric ranges for maxtries and psbt_version

Negative maxtries values now fail and values above INT_MAX succeed; no in-tree caller uses these values, so the practical impact is unconfirmed.

Location: src/rpc/mining.cpp:317 (head).

Details and suggested fix

Previously, an explicit maxtries was parsed as int and then converted to uint64_t: -1 was accepted and wrapped to 2^64−1, while values above INT_MAX failed with “JSON integer out of range.” Parsing it as uint64_t now rejects -1 and accepts 2147483648. walletcreatefundedpsbt has a smaller change of the same kind. For psbt_version, parsing as uint32_t instead of int makes a negative value fail with “JSON integer out of range” rather than RPC_INVALID_PARAMETER with “The PSBT version can only be 2 or 0.” The new maxtries behavior matches generatetodescriptor and may be the better contract, but commit 0c12fb4 says this refactor does not change behavior. Keep getInt<int>() parsing in this commit, or move the range change to a separate commit that describes it and adds boundary tests. No in-tree caller or test uses these boundary values; the test framework passes maxtries=1000000, so the practical impact is unconfirmed.


Link

[suggestion] · The added -Wunused flag is redundant; the effective change enables -Wunused-parameter

Most of the resulting source changes address unused-parameter warnings, which do not catch the unused functions cited as motivation.

Location: CMakeLists.txt:483 (head).

Details and suggested fix

The warning interface already adds -Wall and -Wextra. GCC documents that -Wall implies -Wunused, and Clang includes -Wunused through -Wmost, so the added -Wunused line enables no additional diagnostics. The effective warning change is deleting the base configuration that appended -Wno-unused-parameter; with -Wextra, this re-enables -Wunused-parameter and drives nearly all the source changes. That warning reports unused function parameters, not unused externally linked functions such as SetTargetBlockHash from #36137. Other unused-entity warnings were already enabled by -Wall and the existing -Wunused-* lines. Drop the redundant -Wunused line and describe the change as enabling -Wunused-parameter, so reviewers can weigh the churn and the three subtree PRs against what the warning catches. This flag grouping is based on GCC and Clang documentation and was not confirmed by compiling.


Link

[suggestion] · Parameters that are dead in every build remain in internal functions

Removing names from internal, non-virtual parameters hides leftovers from -Wunused-parameter instead of removing them.

Location: src/init.cpp:909 (head).

Details and suggested fix

Removing parameter names is appropriate when overrides or callbacks have fixed signatures. Some changed functions are internal and non-virtual, however, and their parameters are unused in every build configuration. AppInitBasicSetup never reads args or exit_status, yet bitcoind.cpp and node/interfaces.cpp still pass them. SendCoinsDialog::processSendCoinsReturn ignores msgArg, while PrepareSendText formats a fee string only to pass it in. Removing the names prevents -Wunused-parameter from reporting these leftovers. Consider deleting such parameters here or in a listed follow-up, and reserve name removal for fixed signatures. Not every non-virtual case qualifies: TestChain100Setup must retain chain_type because MakeNoLogFileContext<T> constructs fixtures as T(chain_type, opts). These parameters predate the PR, and behavior is unchanged.


Link

[suggestion] · Unnamed notification parameters hide the meaning of same-typed arguments

The base declarations were the only place these callback arguments were named, so implementers can no longer distinguish arguments of the same type.

Location: src/kernel/bitcoinkernel_wrapper.h:1124 (head).

Details and suggested fix

The change removes parameter names from default no-op virtuals in interface headers. KernelNotifications::HeaderTipHandler and kernel::Notifications::headerTip now take (SynchronizationState, int64_t, int64_t, bool), so their declarations no longer show which int64_t is the height and which is the timestamp. BlockTipHandler no longer identifies its double as verification progress. CValidationInterface::UpdatedBlockTip no longer distinguishes the new tip from the fork point, and the adjacent comments do not name them either. An override that swaps same-typed arguments still compiles. Use /*name*/ comments or [[maybe_unused]] names in these base declarations to silence -Wunused-parameter while keeping the meanings visible. bitcoinkernel_wrapper.h is not installed, so this mainly affects in-tree implementers and readers.


Link

[suggestion] · The alias test does not verify that Arg rejects the legacy name

The test never looks up legacy_def_bool, so it does not support the claim that the second alias is ignored.

Location: src/test/rpc_tests.cpp:650 (head).

Details and suggested fix

The fixture renames the argument to def_bool|legacy_def_bool but looks it up only as Arg<bool>("def_bool"). This shows that lookup by the first name works; the old GetName() path would have triggered CHECK_NONFATAL on the |. But nothing calls Arg<bool>("legacy_def_bool"). The test would still pass if GetParamIndex later matched every alias, contrary to the commit message's claim that the test shows the second alias is ignored. Add BOOST_CHECK_THROW(self.Arg<bool>("legacy_def_bool"), NonFatalCheckError); inside check_positional, or adjust the commit message.


Link

[suggestion] · <ranges> replaces <iterator> while std::distance remains in use

The file relies on a transitive include for std::distance, contrary to the direct-include rule that IWYU enforces for rpc/*.cpp.

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

Details and suggested fix

GetParamIndex still returns std::distance(m_args.begin(), it), but the patch replaces #include <iterator> with #include <ranges>. std::ranges::find_if is declared in <algorithm>, which is already included, and the file already used std::ranges::any_of without <ranges>. The code therefore relies on <ranges> to include <iterator> transitively. The developer notes ask each file to include the headers it uses directly, and rpc/*.cpp is in CI's enforced IWYU set, which may flag this. Keep <iterator> and drop <ranges> unless another use requires it. The IWYU job was not run.


Coverage details

Earlier concerns

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