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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants