refactor(crypto): remove unused SM2 and SM3 support - #56
Federico2014 wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced 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 |
There was a problem hiding this comment.
All reported issues were addressed across 97 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
65d9f19 to
c8fd19f
Compare
Remove SM2/SM3 implementations and runtime engine selection, simplify cryptographic APIs and update their callers and tests. Reject unsupported legacy crypto.engine settings before storage or keystore initialization, with migration guidance and startup regression coverage.
c8fd19f to
93ec564
Compare
What does this PR do?
Remove SM2/SM3 implementations, runtime engine selection, and Toolkit
--sm2options. Simplify signing and hashing APIs to ECKey/secp256k1 and SHA-256, and update their callers and tests across the dependent modules.Retain a startup-only compatibility check before storage or keystore initialization: an absent
crypto.engineuses the default suite; expliciteckeyis accepted with a deprecation warning; all other values, includingsm2, null, and non-string values, fail with migration guidance. Add configuration and FullNode startup regression tests and document the migration requirements.Why are these changes required?
The unused engine switch spans consensus-critical hashes, signatures, addresses, and Merkle roots. Removing it simplifies the cryptographic path, while the startup check prevents an existing SM2 deployment from silently switching algorithms against incompatible chain data. Implements the compatibility requirements discussed in tronprotocol#6959.
This PR has been tested by:
eckey, unsupported values, and rejection before database-directory creation or keystore initialization../gradlew test :framework:checkstyleMain :framework:checkstyleTest --continue --console=plainpassed: 3,437 tests passed, 27 skipped, zero failures; both framework Checkstyle tasks passed.Follow up
Existing SM2/SM3 deployments must remain on a compatible release until a separate migration is completed. Changing the configuration does not convert chain data or keys.
Extra details
Targets
release_v4.8.3. The cross-module changes are required by the removal of shared engine-selecting APIs. This breaks those Java APIs and removes SM2/SM3 support; the default ECKey/SHA-256 path is retained.