fix(config): deprecate CLI params and add safety guardrails#11
Open
vividctrlalt wants to merge 3 commits intodevelopfrom
Open
fix(config): deprecate CLI params and add safety guardrails#11vividctrlalt wants to merge 3 commits intodevelopfrom
vividctrlalt wants to merge 3 commits intodevelopfrom
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
4 tasks
Mark deprecated options with "(deprecated)" in help text and add a note below the Usage line that positional seedNode args are deprecated.
- Add DEPRECATED_CLI_TO_CONFIG map for CLI-to-config key lookup - Show specific config key in warning for params that have equivalents - Use generic "will be removed" message for params without config equiv (--solidity, --p2p-disable) - Replace magic literal 3_000_000L with ENERGY_LIMIT_IN_CONSTANT_TX Addresses review feedback from warku123 and 3for on tronprotocol#6580.
731abdb to
5b0e37b
Compare
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 tronprotocol#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)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 pass