refactor(config): extract ConfigKey and remove testnet config#5
Closed
vividctrlalt wants to merge 4 commits intodevelopfrom
Closed
refactor(config): extract ConfigKey and remove testnet config#5vividctrlalt wants to merge 4 commits intodevelopfrom
vividctrlalt wants to merge 4 commits intodevelopfrom
Conversation
added 4 commits
March 1, 2026 22:40
net.type had no practical effect; add net.addressPrefix to explicitly set the address prefix for backward compatibility. - Deprecate net.type, add net.addressPrefix to all .conf files - Add configFilePath to CommonParameter to store resolved config path - Simplify DynamicArgs to reuse configFilePath from startup - Remove unused TESTNET constants and NET_TYPE/NET_CONF constants
….java Move ~232 HOCON configuration key string constants from Constant.java to a new package-private ConfigKey.java in org.tron.core.config.args. This separates config-file keys (used only by Args/DynamicArgs/WitnessInitializer) from business constants, reducing Constant.java from ~420 lines to ~65 lines.
- Remove net.addressPrefix from all 11 config files, keep net block with commented-out type field and deprecation note - Remove ConfigKey.NET_ADDRESS_PREFIX constant and Args.java parsing logic, always use mainnet prefix 0x41 - Fix test addresses: convert 27-prefix Base58 to T-prefix, a0/A0 hex to 41 across actuator/servlet/relay/vm tests - Fix hardcoded hashes: update merkle root in BlockCapsuleTest, chainId in AllowTvmCompatibleEvmTest and IstanbulTest - Fix FreezeTest CREATE2: change FACTORY_CODE bytecode magic byte from 0xa0 to 0x41 (PUSH1 60a0 -> 6041) to match new runtime prefix
- VMContractTestBase: WITNESS_SR1_ADDRESS "a0" -> "41" - IsSRCandidateTest: nonexistentAddr hex "A0" -> "41" - config-test-storagetest.conf: convert 16 genesis 27-prefix addresses to T-prefix - config-test-index.conf: convert genesis 27-prefix address to T-prefix - .gitignore: broaden bin/ pattern to **/bin/, add *.class
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
Constant.javainto a newConfigKey.java, leaving only business constants inConstant.java0xa0address formatT-Base58 /41hex)Changes
ConfigKey.java: All HOCON config path strings (e.g."node.rpc.port") moved here, organized by config sectionConstant.java: Only ~32 business constants remain, grouped by domain (address, transaction, energy, proposal, etc.)Args.java: References changed fromConstant.XXXtoConfigKey.XXXfor config keys; address prefix hardcoded to mainnetaddressPrefixsetting;net.typemarked as deprecated27-prefix (testnet) toT-prefix (mainnet) anda0hex to41hex0xa0→0x41) to match mainnet prefixTest plan