-
Notifications
You must be signed in to change notification settings - Fork 342
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
fixes #495: param and return types for eth_getStorageAt #513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would probably be best to try and mirror the interface of alloy here, which is to make the keys and values both U256. By switching to U256 for the key this should resolve the issue, as U256 is not required to be padded to 32 bytes when deserialized.
As for the return type, alloy uses U256, but this does mean the rpc return type may not be padded with zeros and playing with alchemy it seems responses are usually padded, so maybe the B256 makes more sense, especially if the spec demands padding.
But definitely want to go from JsonStorageKey -> U256 at a minimum, as it is deserialized the same way (I think) and is the more commonly used type.
Yes, I tried with both Geth and Reth and they are padding the return value so that's why I went with
That makes sense. Will do a lil more manual testing to verify the deserialization is as expected. |
@ncitron -- Made the slot param take |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #495.
Changes
slot
param type to beU256
instead ofB256
.eth_getStorageAt
to beB256
instead ofU256
.