Skip to content

net: Use genesis-based kad protocol for discovery and deprecate /sup/kad#721

Merged
Noc2 merged 1 commit intow3f:mainfrom
lexnv:lexnv/deprecate-legacy-protocols
May 10, 2024
Merged

net: Use genesis-based kad protocol for discovery and deprecate /sup/kad#721
Noc2 merged 1 commit intow3f:mainfrom
lexnv:lexnv/deprecate-legacy-protocols

Conversation

@lexnv
Copy link
Copy Markdown
Contributor

@lexnv lexnv commented Apr 26, 2024

This PR replaces the /dot/kad p2p network protocol used for discovery with the genesis-based equivalent /91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3/kad.

The genesis-based protocol was used for quite a while to discover substrate-based chains and the spec was not updated to reflect that.

The /dot/kad is no longer included as a fallback protocol (like other protocols do), to facilitate the deprecation of the legacy protocols. This has a few advantages:

  • Untangle the networks -- the current DHT of polkadot may contain nodes not responding to substrate protocols. They can be network scrapers (like Polkawatch which uses https://github.com/lexnv/subp2p-explorer), or they can be nodes part of an entirely different network.
  • Reduce the complexity of substrate networking code and improve maintenance -- the code to facilitate fallbacks is not entirely trivial. For example, litep2p has a complete graph architecture to enable any protocols to interact with each other in case of fallbacks.

Deprecation plan:

  1. Include in DHT only nodes that contain genesis-based KAD protocols
  2. Remove /dot/kad support for substrate nodes
  3. Create a followup PR to remove other /dot/.. legacy protocols
  4. Remove /dot/.. legacy protocols support for substrate nodes
  5. Clean-up fallback support in substrate

In response to: paritytech/polkadot-sdk#3833

cc @dmitry-markin @bkchr @skunert

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
@bkchr
Copy link
Copy Markdown
Contributor

bkchr commented May 9, 2024

@Noc2 can you merge this?

@Noc2 Noc2 merged commit ea12312 into w3f:main May 10, 2024
@Noc2
Copy link
Copy Markdown
Contributor

Noc2 commented May 10, 2024

Done. Thanks for pinging me.

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.

4 participants