Skip to content

rlp: decode long hex #46

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

Merged
merged 2 commits into from
Jul 11, 2024
Merged

rlp: decode long hex #46

merged 2 commits into from
Jul 11, 2024

Conversation

zzzzzzch
Copy link
Contributor

@zzzzzzch zzzzzzch commented Jul 8, 2024

Hi, I found that RLP decoding fails when parsing long encoded string, so I modified the eth_rlp_len function and unit-tested it with an EIP-1559 transaction. It seems to be working fine.

But there are two things I'm not sure about:

  • In eth_rlp_array and eth_rlp_bytes, the checking of base values is removed. Maybe the better way is to check all possible values?
  • In eth_rlp_hex and eth_rlp_uint8/16/32/64, the default value of 0 is returned when blen is 0 (i.e. 0x80).

Besides, a free issue that could lead to memory leaks is fixed.

Please review the PR and feel free to comment. I'll fix it as soon as possible.

@mhw0
Copy link
Owner

mhw0 commented Jul 9, 2024

Hi @zzzzzzch Thank you so much for the PR! Reviewing the changes...

@mhw0 mhw0 merged commit c58f530 into mhw0:dev Jul 11, 2024
2 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.

2 participants