Skip to content

node: FINDNODE/NODES and TALKREQ/TALKRESP on established sessions#28

Merged
ch4r10t33r merged 1 commit into
mainfrom
node/findnode-talkreq
May 10, 2026
Merged

node: FINDNODE/NODES and TALKREQ/TALKRESP on established sessions#28
ch4r10t33r merged 1 commit into
mainfrom
node/findnode-talkreq

Conversation

@ch4r10t33r
Copy link
Copy Markdown
Owner

Summary

  • Peer ENR cache: store raw ENR from verified inbound handshakes (rememberPeerRecord + automatic on responder path).
  • FINDNODE: validate distance list; answer with NODES using cached ENRs for routing-table matches; chunk replies (3 ENRs per UDP datagram) with correct resp_count; empty result still returns one NODES packet.
  • TALKREQ: require non-empty protocol; TALKRESP echoes the request message bytes (default behavior).
  • Refactor shared ordinary encryption path; decodePlaintext cleanup (deinit) for allocated message types.

Tests

  • zig build test (new coverage for FINDNODE and TALKREQ over an established session).

Closes #18

Cache peer ENR from verified responder handshakes and via rememberPeerRecord. Reply to FINDNODE with chunked NODES (cached ENRs only). Echo TALKREQ message in TALKRESP when protocol is non-empty. Refactor ordinary-message encryption helper; decodePlaintext cleanup for allocated variants.
@ch4r10t33r ch4r10t33r merged commit 8bc5e24 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: node-layer FINDNODE/NODES and TALKREQ/TALKRESP

1 participant