ouroboros-network
ouroboros-network copied to clipboard
Refactor `peerMonitoringLoop` and outbound governor `deactivatePeerConnection` calls
- The
deactivatePeerConnectionfunction is currently employed in two contexts, both responsible for mux termination. However, mux termination should be exclusively handled by thepeerMonitoringLoopupon detecting aHot -> Colddemotion. - The role of
deactivatePeerConnectionin the outbound-governor should be limited to waiting for the termination of all hot mini-protocols and then either returning or throwing an exception. - Some refactoring is recommended to streamline these processes and prevent similar issues in the future.
The role of deactivatePeerConnection in the outbound-governor should be limited to waiting for the termination of all hot mini-protocols and then either returning or throwing an exception.
deactivatePeerConnection is to demote a hot peer to a warm one, not just to block on the transition. The outbound-governor is the active component which needs to have ways to promote and demote connections.