log: mask SENSITIVE rw_settings in LogArgs

bitcoin/bitcoin: PR #36980

Review completed with no actionable findings.

Coverage details

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Ralph's inferences

Logging unknown persisted values is an explicitly tested behavior, not merely an incidental consequence of accepting unknown keys. Its apparent purpose is diagnostic visibility into settings-file contents, independently of whether the running binary recognizes those settings.

The functional test expects unknown keys to produce both an 'Ignoring unknown rw_settings value' warning and a log entry containing the JSON value, then verifies that those entries survive shutdown unchanged. This supports treating verbatim logging and retention as existing compatibility behavior. The diagnostic purpose is inferred; the inspected evidence does not establish why verbatim values were chosen over names alone.

The observable masking mechanism is based on registered option metadata, not on inspecting arbitrary values for secrets. That mechanism does not establish an affirmative confidentiality guarantee for unknown persisted settings.

At the comparison base, configuration-file and command-line logging consult option flags and mask SENSITIVE values, while persisted settings are logged without that lookup. At the PR head, persisted keys are interpreted and checked against the same flag registry; unknown keys still have their JSON values logged. This is consistent with extending the existing metadata-based masking mechanism while preserving unknown-setting output, but historical intent for persisted-setting confidentiality remains unverified.