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

Fix encoding for empty recipient #1276

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

Nashtare
Copy link
Collaborator

@Nashtare Nashtare commented Oct 4, 2023

The current custom encoding for empty to fields is erroneous, as it will attempt to end early the RLP processing, leading the final RLP string to miss the length of the final element (the s field of the signature) in the prefix computation.
This can be tested for instance by getting an arbitrary transaction, replace the to field with AddressOption(None) encode it, and try to decode it with an online tool like https://toolkit.abdk.consulting/ethereum#rlp.

Copy link
Contributor

@wborgeaud wborgeaud left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@Nashtare Nashtare merged commit 51eb7c0 into 0xPolygonZero:main Oct 4, 2023
2 checks passed
@Nashtare Nashtare deleted the fix_empty_to_encoding branch October 9, 2023 21:34
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