You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moves the keystore-factory functionality from the toolkit to the plugins module, and relocates keystore utility classes to the crypto module for better modularity.
Why are these changes required?
This refactoring improves the project structure by:
Moving KeystoreFactory.java from framework/src/main/java/org/tron/program to plugins/src/main/java/common/org/tron/plugins - aligns with the plugins-based architecture
Relocating keystore utility classes (Credentials.java, Wallet.java, WalletFile.java, WalletUtils.java) from framework to crypto module - better separation of concerns
Updating all import statements across the codebase to reflect the new locations
Keystore classes moved to crypto/src/main/java/org/tron/common/crypto/keystore/
KeystoreFactory moved to plugins module
Updated imports in Wallet.java, Args.java, FullNode.java, and test files
Added plugins/README.md documentation
This PR has been tested by:
Unit Tests
Manual Testing
Follow up
None - this is a pure refactoring with no behavioral changes.
Extra details
This change is part of the ongoing effort to modularize the java-tron codebase and improve separation between core framework components and plugin-based features.
The PR description says "pure refactoring with no behavioral changes", but there are two behavioral changes:
1. Hardcoded isECKeyCryptoEngine breaks SM2 support
Wallet.decrypt() and WalletUtils.generateNewWalletFile() replaced Args.getInstance().isECKeyCryptoEngine() with hardcoded true. But KeystoreFactory in plugins still reads the config via CommonParameter.getInstance().isECKeyCryptoEngine(). This creates a round-trip failure: an SM2 wallet generated by KeystoreFactory cannot be decrypted by Wallet.decrypt(), because decrypt always assumes ECKey.
If crypto module can't depend on Args, the boolean should be passed as a parameter rather than hardcoded.
2. --keystore-factory CLI flag removed without deprecation
Operators using java -jar FullNode.jar --keystore-factory will get an unrecognized option error after upgrading. The migration path (use Toolkit.jar keystore-factory instead) is not documented. Also, CLIParameter.keystoreFactory field is still declared but never read — dead code.
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
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.
What does this PR do?
Moves the keystore-factory functionality from the toolkit to the plugins module, and relocates keystore utility classes to the crypto module for better modularity.
Why are these changes required?
This refactoring improves the project structure by:
KeystoreFactory.javafromframework/src/main/java/org/tron/programtoplugins/src/main/java/common/org/tron/plugins- aligns with the plugins-based architectureCredentials.java,Wallet.java,WalletFile.java,WalletUtils.java) fromframeworktocryptomodule - better separation of concernsChanges:
crypto/src/main/java/org/tron/common/crypto/keystore/pluginsmoduleThis PR has been tested by:
Follow up
None - this is a pure refactoring with no behavioral changes.
Extra details
This change is part of the ongoing effort to modularize the java-tron codebase and improve separation between core framework components and plugin-based features.