Skip to content

execution/abi: reject invalid int/uint bit widths in NewType#20801

Merged
yperbasis merged 4 commits intoerigontech:mainfrom
lmorett1:execution-abi-reject-invalid-int-uint-widths
Apr 28, 2026
Merged

execution/abi: reject invalid int/uint bit widths in NewType#20801
yperbasis merged 4 commits intoerigontech:mainfrom
lmorett1:execution-abi-reject-invalid-int-uint-widths

Conversation

@lmorett1
Copy link
Copy Markdown
Contributor

Reject invalid int/uint widths at ABI type parsing, and align pack/unpack tests to valid big.Int width cases.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NewType to require 8 <= M <= 256 and M % 8 == 0 for int<M> and uint<M>.
  • Update pack/unpack tests to use int72/uint72 instead of invalid int17/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 yperbasis added this to the 3.6.0 milestone Apr 25, 2026
@yperbasis yperbasis enabled auto-merge April 28, 2026 10:02
@yperbasis yperbasis added this pull request to the merge queue Apr 28, 2026
Merged via the queue into erigontech:main with commit 63ee391 Apr 28, 2026
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants