Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Make the Status networking message the handshake message #2010

Closed
tomaka opened this issue Mar 15, 2019 · 2 comments · Fixed by #5938
Closed

Make the Status networking message the handshake message #2010

tomaka opened this issue Mar 15, 2019 · 2 comments · Fixed by #5938

Comments

@tomaka
Copy link
Contributor

tomaka commented Mar 15, 2019

cc #1692

Will write better description, or ping me if I forget.

@tomaka
Copy link
Contributor Author

tomaka commented Mar 18, 2019

Expanding.

Not all the nodes that are connected to use are actually being used for Substrate-related reasons. For example, even when all our slots are occupied, we still accept incoming connections and start outgoing connections for discovery-related purposes.

Consequently, "connected to a node" doesn't necessarily mean "let's start talking about blockchains". There needs to be a signal beforehand that indicates that we should talk blockchains. That signal, right now, is the fact that we open a substream with the /substrate/sub/0 protocol.

When that signal is received (ie. the new substream), the API of network-libp2p reports that we have established a link with another node. Then only the sync layer sends a "status" packet on that substream to indicate to the remote our status.

It would be better if that "link established handshake" was the status packet itself. In other words, the "status" packet would be seen by the low-level protocol, and it is only when we receive a "status" packet that we report in the API that a link has been established.

@tomaka
Copy link
Contributor Author

tomaka commented Apr 16, 2020

cc #5670 should be done in the block-announces substream.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant