-
Notifications
You must be signed in to change notification settings - Fork 907
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
[Networking] Add hello
message
#1531
Comments
If all clients supported the identify libp2p protocol: https://github.com/libp2p/specs/tree/master/identify Is the fork version already in Perhaps we could add the genesis state root to the I ask, because it's something most libp2p-compatible clients would support, and already gives us a clients' supported libp2p protocols and versions. |
Thanks for the link I was unaware of this function. There are two areas to understand for suitability:
I'll have a read through and see exactly how this works and report back. |
The application can configure an interval which periodically updates the information. It's also used to help peers discover their external IP's as well as each other's capabilities. The For us, it would tell us, which RPC protocols we support, which versions and encodings and also whether we support gossipsub or not. There might also be some relevant information about this here: https://docs.libp2p.io/concepts/nat/ |
Looking at https://github.com/libp2p/go-libp2p/blob/master/p2p/protocol/identify/id.go it appears the only thing that can be set by applications is the |
@AgeManning I would say that the info provided by Another issue with using With all this, I see a lot of value in having a |
For clarity, I'm not against a Some interesting points:
Substrate, for example, use the client version here.
The agent-version would tell us if they are compatible at the application layer. Agree that attempting to connect to each end-point makes unnecessary round-trips. Which is why The only difference I see between a With this being said, I also don't particularly like the idea of using Is the fork-version in the current Status message not sufficient? The reason we want to include genesis state-root is for peers that say they are on the same fork version, but for some reason have an incorrect genesis state? In the current implementation, requesting a block from such a peer, would be invalid and the peer would be dropped. Having the genesis state-root given in advance would prevent this step correct? Is there another purpose I'm missing? |
Thanks for the perspective @AgeManning!
Great, I think it's useful too. With regards to
I would call this a happy coincidence (perhaps by design) that we've chosen a scheme of one protocol string per endpoint and it works in our favor because identify does communicate the protocols it knows about. But should the app know about the version of Just leaving the above for perspective, because given the below quote, we seem to agree.
What does fork mean in the context of Eth2? Is it a protocol upgrade? If that's the case, would there be a situation where there is just no fork active, i.e. no upgrades made so far? What would the fork value be in that case |
Ideally, clients will have some notion of what they're connecting to before they make the connection - thus it would be good to include some of this information in the discovery protocol instead (fork/genesis). re multistream, the intent is to move to a newer version that cuts down on roundtrips and makes it cheaper overall - negotiating protocols and versions is in the domain of what libp2p should take care of for us and would ideally be solved there instead of also doing it in the application layer.
|
libp2p's
This would be a nice way of doing things, but again doesn't exist today.
Well for any long-running network the overhead of
It allows a node a very fast check to see if the peer even has the possibility of being compatible, and does not require the connecting peer to have built the genesis state.
The requirement is for a value that can be used to uniquely identify a software version. It could be something else (e.g. hash of last commit) if preferred. However, note this has nothing to do with the supported protocols themselves; these are provided in the last entry as an array of |
I'd also suggest to read https://eips.ethereum.org/EIPS/eip-2124 as it may give some good ideas regarding compatibility negotiation. This may be a well solved problem in Eth2 (I don't know), but getting a second perspective from Eth1 my not hurt. |
discovery is the process before libp2p identify comes into play: the selection of peers to connect to - we're using
the semantics of
the requests are versioned individually and negotiated by libp2p: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/networking/p2p-interface.md#protocol-identification - there is no such thing as a "global" spec version - there was considerable discussion on this point earlier on. |
What is the current state of discv5? If it's ready to go and we can add node version there that would be great. Although if we are going to continue to use
Although they are not enough to guarantee that we're on the correct network they are enough to quickly decide that we're not on the correct network in the negative case. At the point an Ethereum 2 node first starts up and before it connects to any peers this information is all it knows, so it can be enough for the node to decide if it at least wants to try syncing with a potential peer. |
I'm closing this issue. A |
At current when two peers first connect they exchange some information about the current state of their chains with the
status
message, but there is some information that can be useful to help peers know how to interact with each other. This should not be added to thestatus
message, as the information is static per connection and sending it with every status update would be wasteful. Instead, a new handshake messagehello
is proposed.An initial stab at the contents of a
hello
message might be:prysm/1.2.3
(bytes)This provides a basis for understanding if the two peers could talk to each other, even if either or both of them have no state information beyond genesis. It also allows for peers to tweak their behaviour depending on known idiosyncrasies in particular client/spec versions.
The text was updated successfully, but these errors were encountered: