Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase strictness of base types #305

Merged
merged 5 commits into from
Jan 3, 2023

Conversation

lightclient
Copy link
Member

@lightclient lightclient commented Sep 14, 2022

Fixes #303.

  • There is an inconsistency with the base types where some types with a numeric post-fix value accept only that quantity and other accept up to that quantity. This PR makes it so all types accept only that quantity (e.g. Bytes32 requires exactly 32 bytes), with the exception of integers. They will continue to accept values up to their quantity (e.g. 0x1 will match uint256).
  • There is an error where Bytes65 was copied from Bytes512 and the bound was not updated. This has been resolved.
  • There is an error with uint256 where 0x matched validly. It's been updated to follow the same pattern matching as other uint sizes, requiring no leading zeros.
  • Some byte values actually have caps. I've added BytesMax32 for use with storage keys. They don't quite fall within the domain of uint256 (especially with the above fix) and they don't always serialize to 32 full bytes. This is the main issue in eth_getStorageAt spec ambiguity #303.
  • Generally improved the readability of the definitions a bit.

@fjl
Copy link
Contributor

fjl commented Jan 3, 2023

Can this be merged?

@lightclient
Copy link
Member Author

Yep should be good to go. I will merge it.

@lightclient lightclient merged commit 9500d37 into ethereum:main Jan 3, 2023
fjl added a commit to fjl/rpctestgen that referenced this pull request Jan 17, 2024
These tests were added to manually in ethereum/execution-apis#305, so they
would be lost if tests are regenerated from scratch.
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.

eth_getStorageAt spec ambiguity
2 participants