refactor(crypto): remove deprecated methods and harden SM2/SignUtils#8
refactor(crypto): remove deprecated methods and harden SM2/SignUtils#8Federico2014 wants to merge 9 commits intodevelopfrom
Conversation
Signed-off-by: imalasong <imalasong@qq.com>
fix(docs): contributing.md
opt(common): GenesisBlock timestamp valid message error
…den SM2/SignUtils
|
Closing to recreate. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThis PR introduces Jacoco-based coverage gates into the CI/CD pipeline, restructures documentation for issue reporting, removes deprecated point compression methods from cryptographic utilities, adds runtime type validation for signature operations, and implements automatic reviewer assignment for pull requests. Changes
Sequence Diagram(s)sequenceDiagram
participant PR as Pull Request
participant Build as Build & Test (PR)
participant Coverage as Jacoco Report (PR)
participant Artifact as Artifact Storage
participant Base as Build & Test (Base)
participant CoverageBase as Jacoco Report (Base)
participant Gate as Coverage Gate
participant Report as Step Summary
PR->>Build: Trigger build job
Build->>Coverage: Generate jacocoTestReport.xml
Coverage->>Artifact: Upload jacoco-coverage-pr artifact
PR->>Base: Trigger coverage-base job
Base->>CoverageBase: Generate jacocoTestReport.xml
CoverageBase->>Artifact: Upload jacoco-coverage-base artifact
Artifact->>Gate: Download both artifacts
Gate->>Gate: Parse & aggregate coverage reports
Gate->>Gate: Compute delta (PR - Base)
Gate->>Gate: Evaluate thresholds<br/>(overall ≥ -0.1%, changed-files > 60%)
Gate->>Report: Write summary & status
alt Thresholds Met
Gate-->>PR: ✓ Pass
else Thresholds Failed
Gate-->>PR: ✗ Fail workflow
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Poem
✨ Finishing Touches📝 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 |
Summary
compressPoint/decompressPointfrom bothECKeyandSM2(all 4 were
@deprecated, zero callers confirmed by grep)private static finalto SM2 curve domain parameters(
SM2_N,SM2_P,SM2_A,SM2_B,SM2_GX,SM2_GY)instanceoftype guards inSignUtils.signatureToAddressto replace silent
ClassCastExceptionwith descriptiveIllegalArgumentExceptionon engine/signature-type mismatchCompatibility
Removing
compressPoint/decompressPointis a binary-incompatiblechange. External code calling these methods via direct reference will
encounter
NoSuchMethodErrorat runtime after upgrading. Migration:use
ECPoint.getEncoded(boolean)directly.Test plan
./gradlew :framework:test --tests "org.tron.common.crypto.*"— all pass./gradlew :framework:test --tests "org.tron.core.net.messagehandler.PbftMsgHandlerTest"— pass./gradlew :framework:test --tests "org.tron.core.pbft.PbftApiTest"— pass./gradlew :chainbase:test— all passSummary by cubic
Removed deprecated point-compression helpers from
ECKeyandSM2, tightened SM2 constants, and added safer signature type checks inSignUtils. Also added PR coverage gates and auto reviewer assignment in CI.Refactors
compressPoint/decompressPointfromECKeyandSM2(useECPoint.getEncoded(boolean)instead).SignUtils.signatureToAddresswithinstanceofguards and clearIllegalArgumentExceptions.GenesisBlocktimestamp validation and error messages.CI
codecov.ymlas deprecated.Written for commit c8adb6c. Summary will update on new commits.
Summary by CodeRabbit
Chores
Bug Fixes
Documentation