Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Switching from discv5 to libp2p for Node Discovery #1665

Open
y0sher opened this issue Aug 27, 2024 · 1 comment
Open

Consider Switching from discv5 to libp2p for Node Discovery #1665

y0sher opened this issue Aug 27, 2024 · 1 comment
Labels
enhancement New feature or request next

Comments

@y0sher
Copy link
Contributor

y0sher commented Aug 27, 2024

Description

Our project currently uses Ethereum's discovery protocol, discv5, for node discovery between peers. While discv5 functions as intended, we are encountering limitations and issues because discv5 is specifically designed for Ethereum nodes, and our network is not part of the Ethereum ecosystem.

Issues with discv5:

  • Network Compatibility: discv5 is optimized for Ethereum nodes and networks, which can lead to inefficiencies and suboptimal performance in non-Ethereum environments.
  • Limited Customization: The protocol’s tight coupling with Ethereum’s specific requirements limits our ability to customize it for our network's unique needs.
  • Potential Scaling Concerns: As our network grows, the scalability of discv5 outside of Ethereum’s context might pose challenges.

Proposal:

To address these issues, I propose we consider switching to libp2p’s discovery mechanisms, which offer a more flexible and modular approach to peer discovery. Libp2p is designed to be network-agnostic, making it a potentially better fit for our project’s needs.

Benefits of libp2p:

  • Modular Design: Allows us to tailor the discovery protocol to our specific requirements, independent of any particular blockchain network.
  • Cross-Network Compatibility: libp2p is widely used across various projects, providing robust support and a larger community for troubleshooting and enhancements.
  • Scalability: Proven to scale efficiently across different types of decentralized networks.

Open questions

Since this is a different discovery system (though based on similar primitive like kademlia dht for example), would this require forking? how hard will it be to use the existing identity scheme (enrs)?

Next Steps:

  1. Evaluate the feasibility of migrating from discv5 to libp2p’s discovery.
  2. Identify potential challenges in integrating libp2p with our existing infrastructure.
  3. Conduct a proof-of-concept implementation to compare performance and reliability.

Request for Feedback:

Please share your thoughts on this proposal, including any potential concerns or suggestions for the migration process. If there are alternative discovery protocols we should consider, feel free to mention those as well.

@y0sher y0sher added enhancement New feature or request next labels Aug 27, 2024
@ssvlabs ssvlabs deleted a comment Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next
Projects
None yet
Development

No branches or pull requests

3 participants
@y0sher and others