Skip to content

feat: add escape hatch for fallback decoding#299

Open
klkvr wants to merge 2 commits intosigp:masterfrom
klkvr:klkvr/on-decode-failure
Open

feat: add escape hatch for fallback decoding#299
klkvr wants to merge 2 commits intosigp:masterfrom
klkvr:klkvr/on-decode-failure

Conversation

@klkvr
Copy link
Copy Markdown

@klkvr klkvr commented Apr 13, 2026

Description

In Reth we'd like to make it possible to bind both discv4 and discv5 to the same port. This requires having a way to share the binded socket and handle decode failures of one of the protocols to then attempt the fallback.

This PR implements 2 changes to support this usecase:

  1. ListenConfig::FromSockets variant is added that allows caller to prepare sockets beforehand
  2. on_decode_failure callback is added that allows handling payloads that were not decoded succesfully as a discv5 packet

Notes & open questions

Change checklist

  • Self-review
  • Documentation updates if relevant
  • Tests if relevant

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.

1 participant