-
Notifications
You must be signed in to change notification settings - Fork 536
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
PeerIdentify
must not add a remote address if we don't belong to the same chain
#495
Comments
Hi is this issue is still in the plan? I plan to work on this. |
This would be much appreciated! To elaborate on the original issue, ideally we should not add a peer to |
There might be some tricky bits, like we probably have some generic protocols in common with all chains. |
Thinking about it a little more, may be it's enough to make use of identify And, also, we might have troubles when it comes to actual deployment because DHT tables of different chains are now mixed (this applies at least to parachains), and when we try to unlink them we might need to do it in a "gentle" way. CC @lexnv |
When you mention |
I mean just checking if we have some protocols in common is not a good indicator of whether we belong to the same chain, as we have some "generic" protocols not based on the genesis hash nor chain's For example, here is the list of protocols for rococo chain:
The following protocols will be present on all chains:
Grandpa legacy protocol not being based on We could, in theory, blacklist/hardcode some protocols for the purpose of detecting whether we are on the same chain with a remote peer, but generally I think this is a bad idea because we'd need to track protocol names and maintain this list. A better approach would be to use the Identify protocol name ("
So, I must admit the task is turning out to be more tricky than it appeared to be at the first glance. |
We add known addresses of the peer to
PeerStore
(exPeerset
) as a result ofPeerIdentify
here: https://github.com/paritytech/substrate/blob/d38d176b844aab1338ce79eb71cd6df86c97d4a0/client/network/src/service.rs#L1416We should do this only if we are on the same chain / have common protocols.
The text was updated successfully, but these errors were encountered: