This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Networking roadmap #1692
Copy link
Copy link
Closed
Labels
J1-metaA specific issue for grouping tasks or bugs of a specific category.A specific issue for grouping tasks or bugs of a specific category.
Milestone
Description
Here are some steps that I have in mind for the network crate, ordered in order to have a smooth transition. Feel welcome to comment.
- Make
ServiceandServiceEventgeneric over the message type, and send/receive messages instead ofBytesobjects. - Add a trait in
network-libp2pthat is implemented onMessageand allows retrieving theRequestId. - Make
network-libp2p/src/custom_proto/handler.rsopen a new substream for each request. Whether to wait for an answer and how to associate substreams with requests is done using the trait mentioned in the previous point. (Rework network/src/protocol.rs to use libp2p's multiplexing #1517) - Remove the
Cloggedevent. - (blurry) Rewrite
network/src/protocol.rsas a libp2pNetworkBehaviour. Instead of passing aRegisteredProtocoltonetwork-libp2p, one can pass aNetworkBehaviour. Movenetwork-libp2p/src/custom_protocoltonetwork. The messages generated by the API of network-libp2p'sServicewould be the events generated by the network behaviour. We would also require a trait in addition toNetworkBehaviourso that we can register discovered nodes to the behaviour. - Move some logic from the
protocol.rsNetworkBehaviour into theProtocolsHandler, such as theStatusmessage. After this point, Have an upgrade strategy for the network protocol #1518 and Add a networking message to enable/disable the Substrate protocol on connections #1702 can be tackled. -
Extract the gossiping fromprotocol.rsto use a different protocol from the rest (the rest meaning things such as block or header requests). -
(blurry) Use libp2p's floodsub, episub or gossipsub instead of.consensus_gossip(More sophisticated gossip for consensus messages #366) - Change everything to use futures and messages passing instead of
Arcs (Rewrite sync and network layers to use futures #834), and usetokio-timerinstead ofmaintain_peers,tickorgarbage_collect. - Merge
networkandnetwork-libp2p?
Later:
- Remove backwards compatibility for Rework network/src/protocol.rs to use libp2p's multiplexing #1517.
- Remove the
RequestIdfromnetwork::message::Messageand let libp2p do the ID assignment.
andresilvaburdges
Metadata
Metadata
Assignees
Labels
J1-metaA specific issue for grouping tasks or bugs of a specific category.A specific issue for grouping tasks or bugs of a specific category.