init: Fix surprising behaviors of negated options

bitcoin/bitcoin: PR #36880

4 suggestions

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

Optional improvements

Link

[suggestion] · Configuration compatibility changes lack a release note

Several previously accepted settings now prevent startup or change meaning, but the PR provides no release note to guide configuration updates.

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

Details and suggested fix

doc/developer-notes.md calls for release notes for configuration changes. Add a doc/release-notes-*.md describing the newly rejected negations and zero cluster limits, along with the changed string, boolean and empty-directory behavior. In particular, -notorcontrol now fails while effective -listenonion is enabled, -norpcpassword enters the cookie-authentication path instead of using password "0", cjdnsreachable=0 disables CJDNS, and -blocksdir= uses the datadir. Include migration guidance such as -nolistenonion to disable the automatic onion service and -checkblocks=0 to check all blocks. Distinguish these new rejections from -nowalletdir, which already failed startup and only changes diagnostic and rejection timing.


Link

[suggestion] · -cjdnsreachable help and diagnostics still describe presence checks

The help and diagnostics still describe -cjdnsreachable by presence although it now reads a boolean; nonnumeric values disable CJDNS, but their use in existing configurations is unknown.

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

Details and suggested fix

cjdnsreachable=true or cjdnsreachable=yes passed the old IsArgSet check but now evaluates false through GetBoolArg and InterpretBool. With -onlynet=cjdns, even an explicit -cjdnsreachable=0 produces the error that the option “is not provided”; otherwise the false value removes NET_CJDNS from reachable networks. Change the help to say “Set to 1 if this host is configured for CJDNS” and describe the option as enabled in the error, nearby comment and netbase.h. The documented bare -cjdnsreachable form remains valid because an empty boolean argument evaluates true.


Link

[suggestion] · bitcoin-cli's -norpcpassword behavior lacks regression coverage

The new node-side -norpcpassword check does not protect bitcoin-cli's separate NEGATE_TO_EMPTY registration.

Location: src/bitcoin-cli.cpp:171 (head).

Details and suggested fix

The authentication cases in interface_bitcoin_cli.py cover empty and explicit passwords, but not negation. Add assert_equal(BLOCKS, self.nodes[0].cli('-norpcpassword').getblockcount()) beside the cookie-authentication checks. This clean-chain fixture has already generated BLOCKS and has a valid cookie. Its CLI helper supplies -rpcconnect, so the request uses HTTP rather than automatic IPC. Without the CLI registration flag, GetArg("-rpcpassword", "") would return "0", skip GetAuthCookie and send password "0" instead. The extra assertion would catch that distinction without restarting the node.


Link

[suggestion] · Flagged string tests miss explicit "0" and defaults

The new stringarg assertions cover flagged negation but not explicit -bar=0 or an unset -bar, leaving the literal-value and default distinctions unprotected.

Location: src/common/args.cpp:527 (head).

Details and suggested fix

The production isFalse() check correctly distinguishes boolean negation from the string "0". All explicit-value assertions in stringarg use unflagged -foo, so a flag-gated implementation comparing the converted value to "0" would still satisfy them while emptying -bar=0. Add checks for both GetArg overloads expecting "0" after -bar=0, and for an unset flagged option returning the supplied nonempty default. This distinction matters for options such as -rpcpassword=0, where returning empty selects the cookie-authentication path instead of the explicit password.


Coverage details

Earlier concerns

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