Skip to content

fix(config): deprecate CLI params and add safety guardrails#11

Open
vividctrlalt wants to merge 3 commits intodevelopfrom
fix/pr6569-review-followup
Open

fix(config): deprecate CLI params and add safety guardrails#11
vividctrlalt wants to merge 3 commits intodevelopfrom
fix/pr6569-review-followup

Conversation

@vividctrlalt
Copy link
Owner

Summary

Follow-up to tronprotocol#6569 review feedback:

  • Deprecate 23 CLI parameters that can be replaced by config-file options, marking them with @Deprecated in CLIParameter and logging runtime warnings via reflection when used
  • Add max(3_000_000L, ...) guardrail for --max-energy-limit-for-constant CLI path, consistent with config-file validation (addresses @waynercheung's review)
  • Document seedNodes positional parameter behavior with comment explaining why isEmpty() is used instead of isAssigned(), plus deprecation warning

Retained CLI params (11)

-c, -d, --log-config, -h, -v, -w, -p, --witness-address, --password, --keystore-factory, --debug

Deprecated 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

…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
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.
@vividctrlalt vividctrlalt force-pushed the fix/pr6569-review-followup branch from 731abdb to 5b0e37b Compare March 17, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant