execution/abi: reject invalid int/uint bit widths in NewType#20801
Merged
yperbasis merged 4 commits intoerigontech:mainfrom Apr 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Tightens ABI type parsing in execution/abi by rejecting invalid int<M>/uint<M> bit widths at NewType time, and updates packing/unpacking/type-check tests to use valid widths while still exercising the *big.Int paths.
Changes:
- Add validation in
NewTypeto require8 <= M <= 256andM % 8 == 0forint<M>anduint<M>. - Update pack/unpack tests to use
int72/uint72instead of invalidint17/uint17. - Adjust type-check expectations and add new test cases to ensure out-of-range widths are rejected.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| execution/abi/type.go | Enforces valid ABI bit-width constraints for int/uint in NewType. |
| execution/abi/type_test.go | Updates error expectations for invalid widths and adds new invalid-width coverage. |
| execution/abi/packing_test.go | Switches invalid int17/uint17 test types to valid int72/uint72 while keeping *big.Int behavior exercised. |
| execution/abi/unpack_test.go | Same as packing tests: uses valid widths to keep big-int decoding paths under test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yperbasis
approved these changes
Apr 28, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reject invalid int/uint widths at ABI type parsing, and align pack/unpack tests to valid big.Int width cases.