-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
P2P Architecture for Lodestar #127
Comments
Related to
I would take a look at how prysm structures their p2p service and their sync service for some inspiration on how the p2p service could interplay with the rest of the system. In their conception, the p2p service handles managing the gossipsub and dht machinery: fully configuring them, starting and stopping them. The sync service, depending on the sync "strategy" (initial sync vs regular sync), uses the p2p service to subscribe/unsubscribe to various p2p topics/feeds/events, uses the chain service to subscribe to various local chain updates, and relays the necessary data from one to the other. I think we could follow a similar strategy. |
After a call with the other eth2.0 teams around networking and the wire protocol, as an interim solution, we will be implementing the hobbits wire protocol and opening up a tcp socket at port Another thing that was brought up during the call was testing devp2p. Since all eth1.0 clients have an implementation of devp2p, we should be able to use it as an interim solution as well. The Nimbus team has tested using both a libp2p daemon and their nim implementation of devp2p. I think it might be worthwhile to test devp2p as well. We will still be using libp2p but in order to get more realistic testing done, we need some simple networking stack. This is when a lot of bugs will come out and will make Lodestar a better client. |
Is this relevant? |
I think its resolved |
Before opening up a PR for this, I am laying out a proposed architecture for the P2P networking stuff for Lodestar.
Recommended Reading
High Level Overview of expected behavior
When a node runs the Lodestar client, the node should act as a host so that other peers in the network can connect to it. These connections can potentially be reused by taking advantage of
libp2p
's various stream multiplexing libraries. Every node needs to generate its own private/public key pair in order to identify itself in the network. A node needs to be able to handle incoming data streams (AKA messages) in order to process the messages according to the beacon chain protocol. Once the required processing is done, nodes need to propagate messages to other nodes in the network and store any necessary info required for future processing.P2P stack
The proposed P2P stack is based on the current ideas around networking in ETH2.0 and is subject to change. Currently, it consists of
There are other aspects of the P2P stack that are still undecided:
Structure
/p2p
- Will contain all of the p2p related codeserver.js
- Will contain the p2p service as described by @wemeetagainlibp2pNode.js
- Will define our ownlibp2p
bundle with the required components. Will also be able to create nodes.utils.js
- Will contain any utility that we need for handling peers,etcconfig.json
- Contains all the configuration for ourlibp2p
bundleIt is expected that some p2p functionality will be used by other components and coded into other components directly.
Note about Typescript
We will be needing typescript bindings for p2p communication. We have yet to make a decision about how to go about this. There are several suggestions here.
Since there are a lot of unsolved questions regarding networking in ETH2.0, this is all that I have unfortunately. I can definitely add more details to this issue as I get more feedback.
Any actionable feedback is highly needed. What is unclear/underspecified? What have I left out? Also, it is expected that this issue overlaps with @wemeetagain's work with services.
The text was updated successfully, but these errors were encountered: