Skip to content
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

RFC: Use the group to deal with the same PeerId in the network #21

Open
sunhuachuang opened this issue Feb 17, 2022 · 0 comments
Open

Comments

@sunhuachuang
Copy link
Member

sunhuachuang commented Feb 17, 2022

In the previous logic, when two same PeerID appear in the network, the node will be automatically replaced with the new peerID. This logic is based on the fact that the nodes are automatically generated randomly, but now the start_with_key interface is added, and the nodes are no longer random. May be repeated.
So there needs to be reasonable logic to handle this.

When a common node receives the same PeerId, it will check whether the peer is eq. If the peer is eq completely, will only update SessionKey. If it not, it will not be replaced, and the existing node with the same PeerId will be sent to the request node.

When the node receives the same PeerId as self, it will check whether the Peer is eq completely with self. If it is eq, it is considered to be itself. If it not, it is considered to be other nodes in the same group, and is included in the management of the same group, and sends a special message to the upper-layer application.

AND. When a node receives a message, It will broadcast this message to all node in this group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant