mana-ethereum / mana

Ethereum full node implementation written in Elixir.
Other
274 stars 47 forks source link

Peer mngmt #639 #688

Closed InoMurko closed 5 years ago

InoMurko commented 5 years ago

This is the first step to establish exact requirements of #639. What this does at the moment is that it passes a observer module down the supervision tree to workers. The workers are inbound and outbound connections. These worker processes link themselves to the observer module, so that in case of disconnect, the observer can catch the exit and:

  1. store the peer we were connected to, to one of the mapsets
  2. check the reason for the disconnect or process crash (while it also has access to the process state)

There's no logic yet when a connection gets dropped (either from ur or from them) - because I'm still figuring out what the logic should be. Like ... based on what should we pick a new peer?

The other part was that I removed the link between the PeerSupervisor and Kademlia. Kademlia now notifies the observer module of rounds and the flow of attaching dynamic children to outbound connections tree.