#17581 refactor: Remove settings merge reverse precedence code

ReviewabilityReviewsAgreementSize
#17581 ryanofsky refactor: Remove settings merge reverse precedence codeReview #16545 first0Crickets390 + 811 tests
  • Make settings precedence consistent across all sources by removing legacy reverse-precedence handling
  • Simplifies settings interpretation without altering user-facing behavior
  • No review verdicts recorded
  • No substantive comments or reviews from other participants yet
  • Only update is a rebase note from the author
  • 390 lines added or modified outside tests
  • 811 lines added or modified in tests
  • 202 lines removed in total
  • 17 files, 18 commits
Utilities (logging, arguments, libraries)#54 of 59
P4 · cleanup
  • P4 because cleans up obsolete settings parsing special-casing without changing behavior
  • Offers marginal internal code simplification for maintainers
Reviewability: ReadyStalePaused
Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets
Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs.
Size: lines added or modified outside tests, then in tests; greener = smaller.

Goal

Removes legacy reverse-precedence handling in SettingsValue GetSetting, making later settings take precedence over earlier ones across all sources. This backward-compatibility quirk is rendered obsolete once prerequisite PR #17493 forbids multiple assignments to single-value settings in configuration files.

Problem: Bitcoin Core's settings parser historically used reverse precedence for configuration files, where the first assigned value took priority over later values instead of standard last-wins precedence. This added complexity and special-casing to settings interpretation.

Evidence of importance:

  • PR description: 'This change implements one of the settings simplifications listed in #17508.'
  • PR description: 'This has no effect on behavior because as of https://github.com/bitcoin/bitcoin/pull/17493 it's not possible to specify multiple values for single value settings in the config file.'

Scope: This PR is stacked on #16545, #17580, and #17493. Only the final commit (`4bff8012d0`) is unique to this PR, touching only src/common/settings.cpp and src/test/settings_tests.cpp.

Risk of a mistake: low (other). A flaw in setting resolution logic could result in incorrect configuration values being selected on startup.

Changed since the previous assessment: Rebased on updated base PRs; the core change remains identical.

Reviewability

Ready · Review #16545 first

Stacked on #16545; the base PR's changes are included in this diff.

Waiting on (from the thread read):

  • nothing

Agreement

Crickets

no substantive comment either way

Thread notes: Draft PR with no comments or reviews from other participants. / Draft PR with no participants other than the author. The only comment is an author rebase note.

Objections, suggestions, and questions: none recorded.

Dependencies

Depends on: #16545, #17493, #17580

Based on (shares commits with): #16545, #17493, #17580

Files

908 lines under test/bench/ci.

  • src/test/argsman_tests.cpp +690/-72
  • src/common/args.cpp +157/-31
  • src/common/args.h +162/-18
  • src/init.cpp +45/-36
  • src/test/getarg_tests.cpp +61/-3
  • src/test/fuzz/system.cpp +47/-7
  • src/chainparamsbase.cpp +6/-5
  • src/common/settings.cpp +1/-10
  • src/test/settings_tests.cpp +2/-9
  • doc/release-notes-17493.md +8/-0
  • src/common/config.cpp +7/-1
  • src/init/common.cpp +3/-3
  • src/test/logging_tests.cpp +3/-3
  • test/lint/check-doc.py +3/-2
  • src/test/util/common.h +4/-0
  • src/wallet/init.cpp +1/-1
  • test/functional/feature_config_args.py +1/-1

Card

The short text the ranking pass compares across PRs.

This PR removes the legacy reverse-precedence logic in settings parsing, aligning config file setting resolution with the standard last-setting-wins rule. Because dependent PR #17493 forbids duplicate assignments to single-value settings in configuration files, this code path is redundant and the change introduces no behavioral changes. It is part of the settings simplifications tracked in issue #17508 and depends on PRs #16545, #17493, and #17580.

Data

dossier JSON · extract JSON · model ledger, generated 2026-11-01T01:16, confidence high, input hash 5bb2f5b5ea37d550
thread read through 2026-01-18 (1 statements), head 4bff8012d0
labels: Refactoring · draft

Categories

Utilities (logging, arguments, libraries)

P4 · cleanup

Cleans up obsolete reverse-precedence logic in settings parser without changing user-facing behavior. The author notes that 'This change implements one of the settings simplifications listed in #17508' and 'has no effect on behavior because as of #17493 it's not possible to specify multiple values for single value settings in the config file'.

Membership: Modifies settings handling logic in `src/common/settings.cpp`.

Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0