You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This took me forever debug, but here's the issue. If you start up two nodes and immediately join a topic they will fail discover each other in the pubsub. Here's why:
Node1
Create host
Create pubsub
Node2
Create host
This causes an immediate connection to Node1 but the pubsub protocol is not yet registered.
Node1's pubsub detects the new connection, tries to open a stream, and NewStream fails because Node2 doesn't yet speak pubsub.
Create pubsub
Node2's pubsub doesn't detect the connection since it was established before the pubsub was created.
Nodes 1 and 2 never connect :(
Fortunately I was able to come up with a fix that doesn't require any changes in libp2p. Basically detect the protocolupdate event and force it think it received a new connection:
This took me forever debug, but here's the issue. If you start up two nodes and immediately join a topic they will fail discover each other in the pubsub. Here's why:
Node1
Node2
Nodes 1 and 2 never connect :(
Fortunately I was able to come up with a fix that doesn't require any changes in libp2p. Basically detect the protocolupdate event and force it think it received a new connection:
But it would be nice if this was built in as it's definitely not expected behavior.
The text was updated successfully, but these errors were encountered: