Skip to content

node,enr: optional handshake ENR and WHOAREYOU enr-seq#31

Merged
ch4r10t33r merged 1 commit into
mainfrom
node/handshake-omit-enr-way-seq
May 10, 2026
Merged

node,enr: optional handshake ENR and WHOAREYOU enr-seq#31
ch4r10t33r merged 1 commit into
mainfrom
node/handshake-omit-enr-way-seq

Conversation

@ch4r10t33r

Copy link
Copy Markdown
Owner

Completes discv5 handshake behavior around omitted record and correct WHOAREYOU enr-seq.

  • WHOAREYOU: enr-seq is 0 when the responder has no cached ENR for the initiator; otherwise the sequence from the cached record (enr.recordSequenceFromRaw).
  • Initiator: omits handshake record on the wire only when enr-seq != 0 and matches the node’s current ENR sequence.
  • Responder: accepts empty record when pending state holds a dup of the initiator ENR used for that challenge; verifies and rememberPeerRecord as before.
  • Tests: integration test for second opening with matching seq + empty record; recordSequenceFromRaw asserted in ENR roundtrip.

Closes #20 (if that issue tracked this work).

WHOAREYOU enr-seq reflects the cached initiator ENR sequence (0 if none).
Pending challenges store a dup of that ENR for verify when the handshake
omits the record. Initiator omits the record only when challenge seq matches
its current ENR seq and seq is non-zero.
@ch4r10t33r ch4r10t33r merged commit bba8e5a into main May 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

discv5: ENR verify/sign and handshake record rules

1 participant