#17581 refactor: Remove settings merge reverse precedence code
https://github.com/bitcoin/bitcoin/pull/17581 · · +1200/-223 in 18 files, 19 commits · labels: Refactoring · draft
Goal
- Simplify settings evaluation logic by removing obsolete legacy precedence handling
- Eases maintenance of configuration parsing once duplicate settings are disallowed
This PR removes legacy reverse-precedence handling in settings parsing where configuration file settings took the first assigned value instead of the last. Because prerequisite PR #17493 forbids duplicate single-value settings in configuration files, this special-case fallback logic becomes obsolete.
Problem: Settings parsing contained legacy backwards-compatibility code to prefer the first value in configuration files, complicating settings evaluation logic.
Category: Utilities (logging, arguments, libraries) (#63 of 66)
P4 · cleanup
- P4 because it is an internal cleanup removing redundant settings parsing code
- Does not alter user-facing behavior once prerequisite pull requests land
P4 because the PR is an internal cleanup removing redundant precedence code without changing behavior once base PR #17493 lands.
Membership: Changes settings resolution logic in src/common/settings.cpp.
Factors: security/stability 0, bug 0, performance 0, user value 0, leverage 0
Reviewability: Ready: Review #17493 first
- Review #17493 first
- Contains one unique commit sitting on top of a stack of prerequisite pull requests
The PR contains only one unique commit on top of a stack (#16545, #17580, and #17493); reviewers should review the base PRs first.
Author status: active, regularly rebasing stack
Agreement: Crickets
- No reviewer feedback or discussion yet
- The author remains active and regularly rebases the stack
No reviewer feedback yet
There has been no review activity or discussion on the PR outside of automated rebases by the author.
Review verdicts (DrahtBot): 0
Dependencies
Depends on: #16545, #17493, #17580
Files
908 lines under test/bench/ci.
- src/test/argsman_tests.cpp +690/-72
- src/common/args.cpp +158/-49
- src/common/args.h +162/-21
- src/init.cpp +44/-36
- src/test/getarg_tests.cpp +61/-3
- src/test/fuzz/system.cpp +47/-7
- src/common/settings.cpp +1/-10
- src/test/settings_tests.cpp +2/-9
- doc/release-notes-17493.md +8/-0
- src/chainparamsbase.cpp +4/-4
- 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
- .github/workflows/ci.yml +1/-1
- src/wallet/init.cpp +1/-1
- test/functional/feature_config_args.py +1/-1
Card
This PR removes legacy reverse-precedence resolution code in the settings manager, making later settings consistently take precedence over earlier settings. It relies on base PR #17493 disallowing ambiguous multiple assignments to single-value settings in configuration files. As an internal cleanup, it has no direct user-facing impact or behavioral change. Reviewers should focus on base PR #17493 before reviewing this PR.