refactor(core/vm): use bitutil.TestBytes to replace allZero #32434#2323
refactor(core/vm): use bitutil.TestBytes to replace allZero #32434#2323gzliudan wants to merge 1 commit intoXinFinOrg:dev-upgradefrom
allZero #32434#2323Conversation
|
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: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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.
Pull request overview
Refactors the VM precompile implementation to use the shared common/bitutil.TestBytes helper instead of a local allZero utility, reducing duplicated logic and leveraging the optimized bitutil implementation.
Changes:
- Replace the
ecrecoverprecompile’s “all-zero padding” check withbitutil.TestBytes. - Remove the now-unused
allZerohelper fromcore/vm/common.go.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
core/vm/contracts.go |
Uses bitutil.TestBytes to detect non-zero bytes in the ecrecover input validation path. |
core/vm/common.go |
Removes the local allZero helper after it becomes unused. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes
Ref: ethereum#32434
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that