fix(config): deprecate CLI params and add guardrails#6580
Open
vividctrlalt wants to merge 2 commits intotronprotocol:developfrom
Open
fix(config): deprecate CLI params and add guardrails#6580vividctrlalt wants to merge 2 commits intotronprotocol:developfrom
vividctrlalt wants to merge 2 commits intotronprotocol:developfrom
Conversation
…rotocol#6569 review follow-up - Mark 23 config-file-replaceable CLI parameters as @deprecated in CLIParameter - Add runtime deprecation warning via reflection when deprecated CLI options are used - Add max(3_000_000L, ...) guardrail for --max-energy-limit-for-constant CLI path, consistent with config-file validation (addresses waynercheung's review feedback) - Document seedNodes positional parameter behavior and add deprecation warning - Retain 11 essential CLI params: -c, -d, --log-config, -h, -v, -w, -p, --witness-address, --password, --keystore-factory, --debug
3for
reviewed
Mar 16, 2026
| // isAssigned(). An empty-check is used instead — this is safe because the default | ||
| // is an empty list, so non-empty means the user explicitly passed values on CLI. | ||
| if (!cmd.seedNodes.isEmpty()) { | ||
| logger.warn("Positional seed-node arguments are deprecated. " |
There was a problem hiding this comment.
Since seedNodes is deprecated, the corresponding help info should also be removed, such as: helpStr.append(String.format("%nUsage: java -jar %s [options] [seedNode ...]%n", programName));
Contributor
Author
There was a problem hiding this comment.
Thanks for the feedback! Since seedNodes is deprecated but not yet removed, users may still want to use it, so I kept the Usage line but added a deprecation note right below it. Also noticed that --es and --solidity in the help output are deprecated too (marked in this PR), so I added (deprecated) hints to all deprecated options in the help text. See 84027da.
Mark deprecated options with "(deprecated)" in help text and add a note below the Usage line that positional seedNode args are deprecated.
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
Follow-up to #6569 review feedback:
@DeprecatedinCLIParameterand logging runtime warnings via reflection when usedmax(3_000_000L, ...)guardrail for--max-energy-limit-for-constantCLI path, consistent with config-file validation (addresses @waynercheung's review in refactor(config): extract CLIParameter and restructure Args init flow #6569)seedNodespositional parameter behavior with comment explaining whyisEmpty()is used instead ofisAssigned(), plus deprecation warningRetained CLI params (11)
-c,-d,--log-config,-h,-v,-w,-p,--witness-address,--password,--keystore-factory,--debugDeprecated CLI params (23)
All storage, VM, network/thread, and misc runtime parameters — these should be configured via config file.
Test plan
./gradlew compileJava— all modules compile successfully./gradlew :framework:test --tests "org.tron.core.config.args.*"— parameter tests pass./gradlew :framework:test— full framework tests passRelated