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: use byte array to decode ENRs uint8 fields #1227

Merged
merged 3 commits into from
Oct 3, 2024
Merged

Conversation

richard-ramos
Copy link
Member

@richard-ramos richard-ramos commented Sep 23, 2024

Allows decoding ENRs whose waku2 field contains 0x00.
For example, see enr:-LW4QL-wGVQsfol6Bc4Twnnl2LkHu2oTWD-RIm2FDlG8c4aYIM6bKsMnN_tjP-rH8SddEICwcxrslhRlcnPaRnHDAP0BgmlkgnY0gmlwhMCoAAGKbXVsdGlhZGRyc4CCcnOTAAAIAAAAAQACAAMABAAFAAYAB4lzZWNwMjU2azGhAjn6QX7KNxZGvJf9trmXLjQcsbnEdEIUKG_VPgDymcUog3RjcILqYIN1ZHCCIyiFd2FrdTIA in enr-viewer.com

Otherwise the following error will be shown: rlp: non-canonical integer (leading zero bytes) for uint8

EDIT: See also discussion here on why it should be a byte array instead to allow extending the field to support more than 8 protocols https://discord.com/channels/1110799176264056863/1276567145785987195/1287897621184380938

cc: @AlbertoSoutullo, @jm-clius

Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

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

LGTM

@richard-ramos richard-ramos merged commit 15b4aee into master Oct 3, 2024
12 checks passed
@richard-ramos richard-ramos deleted the fix/enr-encode branch October 3, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants