Skip to content

fix(l1): check ENR key/value pairs are ordered and unique - #7227

Open
zexoverz wants to merge 1 commit into
lambdaclass:mainfrom
zexoverz:fix/3493-enr-key-ordering
Open

fix(l1): check ENR key/value pairs are ordered and unique#7227
zexoverz wants to merge 1 commit into
lambdaclass:mainfrom
zexoverz:fix/3493-enr-key-ordering

Conversation

@zexoverz

Copy link
Copy Markdown

Motivation

EIP-778 requires the key/value pairs to be sorted by key and unique, and nothing checked it on decode.

Description

Rejecting rather than sorting or deduplicating on the way in, since the signature covers the encoded bytes. A record we normalised would re-encode into something other than what was signed, so it could not be verified or relayed anyway, and a peer sending one is violating the spec either way. The check lives in try_from_raw_pairs so it also covers the raw pairs built by callers, not only what arrives over the wire.

Closes #3493

Checklist

  • Updated STORE_SCHEMA_VERSION (crates/storage/lib.rs) if the PR includes breaking changes to the Store requiring a re-sync.

…licated

EIP-778 requires the pairs to be sorted by key and unique. `encode_pairs`
already emits them that way but decoding accepted any order, so a record with
a duplicate key kept whichever copy came last and one with unordered keys
re-encoded into a different byte string than the one that was signed.

Closes lambdaclass#3493

Claude-Session: https://claude.ai/code/session_01CWCwisL95EQwmp51L72uQ7
@zexoverz
zexoverz requested a review from a team as a code owner August 27, 2026 03:47
@github-actions github-actions Bot added the external-contributor PR opened by a contributor outside the team label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor PR opened by a contributor outside the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check ENR KV entries are ordered and unique

1 participant