-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Peer lifecycle management is devided between the Reactors and Switch. The Switch acts as intermediary, creating peers with references to the reactors as well as calling reactor.AddPeer to start reactor specific go routines. These go-routines depend peer state which must be initialized by the reactor in reactor.InitPeer. The spreading of responsibility has led to several issues when Reactors and the Switch have mismatched expectations around peer state (#3346 , #3338)
In order to specify and verify the lifecycle of peer, it would be helpful to refactor the current implementation into a schema that leaves a single entity responsible for Start/Stopping a peer and
communicate its state to other components and avoid race conditions.
This issue probably falls within the purview of the greater p2p refactor #2067