Split Peerset into PeerStore & ProtocolControllers (#13611)

This commit is contained in:
Dmitry Markin
2023-05-23 14:49:02 +03:00
committed by GitHub
parent 194c9edd4a
commit 01107e9ca5
19 changed files with 2915 additions and 1729 deletions
@@ -307,8 +307,20 @@ fn reconnect_after_disconnect() {
_ => {},
}
// Due to the bug in `Notifications`, the disconnected node does not always detect that
// it was disconnected. The closed inbound substream is tolerated by design, and the
// closed outbound substream is not detected until something is sent into it.
// See [PR #13396](https://github.com/paritytech/substrate/pull/13396).
// This happens if the disconnecting node reconnects to it fast enough.
// In this case the disconnected node does not transit via `ServiceState::NotConnected`
// and stays in `ServiceState::FirstConnec`.
// TODO: update this once the fix is finally merged.
if service1_state == ServiceState::ConnectedAgain &&
service2_state == ServiceState::ConnectedAgain
service2_state == ServiceState::ConnectedAgain ||
service1_state == ServiceState::ConnectedAgain &&
service2_state == ServiceState::FirstConnec ||
service1_state == ServiceState::FirstConnec &&
service2_state == ServiceState::ConnectedAgain
{
break
}