If we dial an address and then try to open a substream on LiteP2pEvent::ConnectionEstablished, opening a substream fails ~30% of time.
Timeline:
T0: litep2p.dial_address(address).await
T1: Litep2pEvent::ConnectionEstablished received
T2: self.service.open_substream(peer) — fails with error=PeerDoesNotExist
T3: self.service.dial(peer) — reports AlreadyConnected
T4: self.service.open_substream(peer) — fails for a second time with error=PeerDoesNotExist
Discovered while working on #501.
If we dial an address and then try to open a substream on
LiteP2pEvent::ConnectionEstablished, opening a substream fails ~30% of time.Timeline:
T0:
litep2p.dial_address(address).awaitT1:
Litep2pEvent::ConnectionEstablishedreceivedT2:
self.service.open_substream(peer)— fails witherror=PeerDoesNotExistT3:
self.service.dial(peer)— reportsAlreadyConnectedT4:
self.service.open_substream(peer)— fails for a second time witherror=PeerDoesNotExistDiscovered while working on #501.