fix: decode rlp header on Enr::build #72
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #71
#71 (comment)
This changes the sanitize check from
Bytes::decode
toHeader::decode
,this is required for list types that are added via
Builder::add_value
becauseBytes::decode
fails on lists:
https://github.com/alloy-rs/rlp/blob/2ccf23f7b6a363c844443a13f9496391ee6892ac/crates/rlp/src/decode.rs#L83
added new test that fails on main:
also update
Enr::get
to restore the previous behaviour of rlp::data which returns the payload datahttps://docs.rs/rlp/latest/src/rlp/rlpin.rs.html#159
we could add a
Bytes::decode_unchecked
to alloy-rlp that does not care about listcc @DaniPopes