refactor(crypto): remove unused SM2 and SM3 support - #54
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe PR removes SM2/SM3 support and the ChangesCryptography cleanup
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 95 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
d1d1111 to
6540280
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
6540280 to
3eb3793
Compare
3eb3793 to
94f83d9
Compare
What does this PR do?
This PR removes the unused SM2 signing and SM3 hashing implementations, eliminates the runtime crypto engine switch, and simplifies the signing and hashing APIs to use ECKey and SHA-256 directly.
It updates the dependent actuator, chainbase, common, consensus, framework, crypto, and plugin call sites. It also removes the
crypto.engineconfiguration and Toolkit--sm2option, updates documentation, and adjusts the related tests.Why are these changes required?
SM2 and SM3 are not used by the supported default node configuration. Maintaining the alternate crypto path adds duplicated logic, configuration ambiguity, and unnecessary maintenance overhead.
The cross-module changes are required because the removed algorithm-selection parameters were propagated through hashing, signing, transaction, block, consensus, Keystore, and Toolkit APIs.
This PR has been tested by:
Follow up
None.
Extra details
The supported ECKey and SHA-256 consensus behavior remains unchanged. This PR does not change database formats, does not require a hard fork, and preserves compatibility with standard ECKey Keystore files.
The removed
crypto.engineconfiguration, SM2/SM3 APIs, SM2 Keystore handling, and Toolkit--sm2option are no longer supported.This implementation follows the direction of tronprotocol#6627 and closes #51.
Summary by CodeRabbit
Breaking Changes
--sm2keystore option.Bug Fixes
0Xkey prefixes correctly.