sigp / enr

Ethereum Node Record
MIT License
61 stars 29 forks source link

fix: broken decoding #75

Closed emhane closed 5 months ago

emhane commented 5 months ago

Thanks to very important find by @mattsse. All enrs with for example "eth2" kv-pair have failed decoding.

AgeManning commented 5 months ago

A few things to note here.

The bug identified here relates solely to applications that are attempting to RLP-encode lists as ENR values and decode them. ENRs currently cannot decode values that are stored as RLP lists or recursive RLP lists.

The specific key you are referring to, "eth2" is used in Ethereum's consensus protocol is unaffected by this, because that protocol doesn't store ENR values as RLP lists. The protocol always uses straight bytes encoded as ssz.

This PR as it stands actually breaks the tests and prevents decoding of other fields that are not RLP lists. In its current form we cannot merge this PR.

I've tried pushing fixes to this branch, but appear not to have permissions. As this appears urgent for your use case, i'm going to open other PR with the changes.