Skip to content

4. Peer Management

Neil Alexander edited this page Oct 22, 2021 · 1 revision

Pinecone nodes must be able to respond to changing network conditions, with peers connecting and disconnecting at any moment. A node should do the following things when peers connect or disconnect.

Peer connects

When a new peer connects to a node, the node should immediately send the latest root update from the chosen parent. If no chosen parent is available or the node is acting as a root, the node should send its own root update immediately.

Peer disconnects

A Pinecone node must immediately remove any state related to a peer that disconnects, including the last received root announcement from that peer.

If the chosen parent is the disconnected peer, the node must re-run the parent selection algorithm immediately, either selecting a new parent (with the equivalent Root public key and Root sequence) or by becoming a root node and waiting for a stronger update from a peer.

If the disconnected peer appears in any entry in the routing table, as either the Source port or Destination port, a teardown must be sent to the remaining port. For example, if the Source port is now disconnected, a teardown for the path must be sent to the Destination port. The entry should then be removed from the routing table.

If the disconnected port is the Destination port of the ascending node entry, the ascending entry should be cleared. There is no Source port for an ascending node entry, therefore it is not possible to send a teardown for this path. The node on the other side of the failed connection is responsible for sending a teardown in this case.

If the disconnected port is the Source port of the descending node entry, the descending entry should be cleared. There is no Destination port for a descending node entry, therefore it is not possible to send a teardown for this path. The node on the other side of the failed connection is responsible for sending a teardown in this case.

The next iteration of the routine maintenance should send a bootstrap message into the network if the ascending node entry was cleared.