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

Issues with 0x00... prefixed addresses #27

Open
slawomir-pryczek opened this issue Feb 8, 2023 · 6 comments
Open

Issues with 0x00... prefixed addresses #27

slawomir-pryczek opened this issue Feb 8, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@slawomir-pryczek
Copy link

Whe using to 0x00 prefixed addresses it'll return following error from GETH.

rlp: input string too short for common.Address, decoding into (types.DynamicFeeTx).To

I think that's the reason of recently introduced patch to remove leading 0's from strings. Seems that geth client can't decode addresses with 0's removed. So this seems to be in accordance with specification, but geth still can't read the data encoded according to specs when address is shorter than "normal".

@holiman
Copy link

holiman commented Feb 8, 2023

patch to remove leading 0's from strings.

An address is not a string, it's a fixed-length (20) byte array.

@slawomir-pryczek
Copy link
Author

So you say if the library im using is stripping 0-bytes from addresses it's not following the standard?

@slawomir-pryczek
Copy link
Author

switch ($encoding) { case 'hex': if (strpos($input, '0x') === 0) { $input = str_replace('0x', '', $input); }

This code gets triggered for address

@slawomir-pryczek
Copy link
Author

Actually found your other comment, thanks

@sc0Vu sc0Vu self-assigned this Sep 6, 2023
@sc0Vu sc0Vu added the bug Something isn't working label Sep 6, 2023
@sc0Vu
Copy link
Member

sc0Vu commented Sep 6, 2023

Thanks @slawomir-pryczek, I'll fix this asap.

@yamadashy
Copy link

I am currently facing this issue as well and am hopeful for a resolution.
Could the merging of the following PR potentially address this problem? If there is anything I can do to assist or expedite the process, I am more than willing to help.
#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants