-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Networking roadmap #1692
Comments
The current step is more or less "Rewrite network/src/protocol.rs as a libp2p NetworkBehaviour" now. For this step, I'm going to change a bit the API of After this step, the The text mentions "Move network-libp2p/src/custom_protocol to network.", but I wouldn't do that in the end. The This defines a bit more precisely the role of The next steps would then to move more content from |
@tomaka Do you need help with "Rewrite network/src/protocol.rs as a libp2p NetworkBehaviour"? |
The first step was libp2p/rust-libp2p#1046 in libp2p. Once a libp2p version is published and once most of the networking issues are fixed, I'll finish my work in progress PR. |
I'm going to close this issue, as half of it is implemented and only #2374 is still important. |
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.Service
andServiceEvent
generic over the message type, and send/receive messages instead ofBytes
objects.network-libp2p
that is implemented onMessage
and allows retrieving theRequestId
.network-libp2p/src/custom_proto/handler.rs
open 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)Clogged
event.network/src/protocol.rs
as a libp2pNetworkBehaviour
. Instead of passing aRegisteredProtocol
tonetwork-libp2p
, one can pass aNetworkBehaviour
. Movenetwork-libp2p/src/custom_protocol
tonetwork
. The messages generated by the API of network-libp2p'sService
would be the events generated by the network behaviour. We would also require a trait in addition toNetworkBehaviour
so that we can register discovered nodes to the behaviour.protocol.rs
NetworkBehaviour into theProtocolsHandler
, such as theStatus
message. 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.rs
to 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)Arc
s (Rewrite sync and network layers to use futures #834), and usetokio-timer
instead ofmaintain_peers
,tick
orgarbage_collect
.network
andnetwork-libp2p
?Later:
RequestId
fromnetwork::message::Message
and let libp2p do the ID assignment.The text was updated successfully, but these errors were encountered: