refactor(config): improve startup errors and remove inactive assertions - #44
refactor(config): improve startup errors and remove inactive assertions#44bladehan1 wants to merge 2 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #45, rebuilt from the normalized feature/opt_config_error branch with a consolidated commit and focused coverage tests. |
What does this PR do?
IllegalArgumentExceptionwithTronError(PARAMETER_INIT)for three explicitly validated startup configuration errors.Blake2bfMessageDigestimplementation.Why are these changes required?
The selected configuration failures are already known parameter initialization errors, so assigning
PARAMETER_INITimproves error classification without changing their messages, exit code, or startup result. The removed assertions are inactive by default and can incorrectly suggest that runtime validation is present.Both changes are intentionally small maintenance improvements. This PR does not introduce a general startup exception framework or change dynamic configuration reload behavior.
This PR has been tested by:
./gradlew :common:test --tests org.tron.core.config.args.CommitteeConfigTest./gradlew :framework:test --tests org.tron.core.config.args.ArgsTest./gradlew :framework:checkstyleMain./gradlew :actuator:compileJava :chainbase:compileJavagit diff --check upstream/develop...HEADFollow up
No broad exception conversion is planned as part of this PR. Other startup failures should be evaluated separately according to their specific semantics.
Extra details
upstream/develop.Closes #43
Summary by cubic
Reclassifies selected startup configuration errors to
TronErrorwithPARAMETER_INITand removes inactiveassertstatements to make failures clearer without changing startup behavior or exit codes.TronError(PARAMETER_INIT)for explicit config validation inArgs(DNSserverTypeand empty fields) andCommitteeConfig(reward/vote prerequisite check); updated test to expectTronError.assertstatements inRepositoryImpl,ResourceProcessor,EnergyProcessor,MerklePath, andTrieImpl; no logic changes.Written for commit e1acb49. Summary will update on new commits.