Repository navigation
fix(client): preserve config values and apply AutoNAT CLI override - #960
Merged
aterentic-ethernal merged 1 commit intoAug 3, 2026
Merged
aterentic-ethernal merged 1 commit into
aterentic-ethernal merged 1 commit into
Conversation
aterentic-ethernal
approved these changes
Aug 3, 2026
Contributor
|
Closing PR to retrigger failing workflow by reopening it, due to missing token for test dependency fetching. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix CLI configuration merging so that omitted command-line options no longer overwrite values loaded from the configuration file.
This change:
--auto-nat-modeoptional and applies it only when explicitly provided;no_updateandtracking_service_enablewhen they are enabled in the config file;operator_addresswhen the corresponding CLI option is omitted;Problem
--auto-nat-modewas defined withdisabledas its CLI default, but its value was never applied tocfg.libp2p.behaviour.auto_nat_mode. As a result, passing--auto-nat-mode enabledhad no effect.Using a non-optional default would also make it impossible to distinguish an omitted CLI option from an explicit
disabledvalue, causing configuration-file values to be overwritten.Additionally, the following assignments always replaced values loaded from the configuration file with CLI defaults:
When those options were omitted, true values were reset to false and an existing operator address was reset to None.
Fix
Change auto_nat_mode to Option and apply it only when supplied.
Use additive behavior for the enable-only boolean flags, and update the operator address only when the CLI option is present.
I have tested by the following cmd: