[go: up one dir, main page]

Octez/P2P: Prioritise incoming connections

Previous situation

Consider the following situation:

  1. We have two (DAL) nodes, P and N. The node P opened its P2P port, but N didn't
  2. P tries to connect to N
  3. A very few seconds later (before the attempt in 2. timeouts), N tries to connect to P as well.

Currently (before this MR):

  • Connection (3) will be rejected with the message "already connected" because there is an outgoing connection in a "Requested" state to the same peer
  • Connection (2) will time out after 10 seconds.

Note that when this happens, connection (3) is almost done (peers' identities are exchanged), while in case (2), no response is received from the other peer at all.

This MR

Based on the situation described above (and because this behavior appears when octez-p2p is used in the DAL node), we propose a patch that changes the behaviour as follows. In such situations:

  • Connection (2) is cancelled
  • Connected (3) is not rejected anymore (is allowed to continue the usual process)

Merge request reports

Loading