Required networking functionality in parachain subsystems #4786
haikoschol
started this conversation in
Research
Replies: 1 comment
-
Can we modify the network bridge subsystem to register all these protocols and then make it responsible to dispatch the messages through overseer? Basically we leave the responsability on top of a specific subsystem, can be a brand new subsystem just to receiving the network protocol messages and this subsystem will know how to decode and to which inner subsystem forward the message |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From what I've seen so far working on the parachain subsystems, the main networking functionality required there is:
PeerConnected1. Sending requests to specific peers on specific protocols
We already have an implementation for this, modeled after that in polkadot-sdk:
However, this implementation has some limitations:
IfDisconnectedBehaviorattribute is ignored.parachaintypes.RecipientIDinstead of aPeerIDis to allow sending requests to aparachaintypes.AuthorityDiscoveryID, this is not implemented yet.So far, this is used in availability distribution, but it will also be used in collator protocol, statement distribution and availability recovery, for example.
2. Receiving requests from any peer on specific protocols
This functionality is not implemented yet. So far we only have an interface as a dependency in subsystems that need it, which allows registering a request handler:
3. Processing overseer events like
PeerConnectedThese events are not yet dispatched by the overseer. Currently, the overseer knows two types of messages, broadcast and 1-to-1. Broadcast messages are "block events" like
ActiveLeavesUpdateSignalandBlockFinalizedSignal. Although there is aSubsysteminterface which includes methods for handling these, the overseer does not actually call them. Instead it sends these messages over the channel it has for each subsystem inOverseerSystem.broadcast().For 1-to-1 messages, the same channel is used. The logic which subsystem should receive which message is hard-coded in a
switchstatement inOverseerSystem.processMessage().An example for a subsystem that needs to process networking events like
PeerConnected,NewGossipTopologyorPeerViewChangeEventis bitfield distribution.We need to come up with a way for the overseer to receive and dispatch these events. Alternatively we could also give each subsystem a dependency on which it can subscribe to the events it needs, but that would require changing the implementation of the affected subsystems, since they won't get all messages via the overseer channel anymore. However, this is already true for subsystems that need to receive requests. In any case, these events need to somehow make their way from the networking layer to the subsystems.
4. Authority Discovery
There are at least two ways in which authority discovery is used inside parachain subsystems. One is already described under point 1 above. In some cases a subsystem wants to send a request to a specific peer but only has the authority ID. In that case we can handle the lookup in the code that processes
OutgoingRequest. This should be easy at least in the case where the peer ID for a given authority ID is in the cache. If a network round trip to find it is required, it might take a bit more coordination.The other way authority discovery is used is by calling the methods on the authority discovery service (e.g.
GetAddressesByAuthorityID()). It looks like this is only done in the gossip support subsystem, which then sends aUpdatedAuthorityIDsmessage to other subsystems via the overseer (This is true for polkadot-sdk. In Gossamer those events are not dispatched yet, see point 3).Beta Was this translation helpful? Give feedback.
All reactions