Open
Description
Background
Right now, the only peer which subscribes to a particular "mailbox topic" (the topic associated with a particular Public Address) is the replica which is identified by that Public Address.
This means that unicast messages are never sent eagerly and through full-message pairings. Instead, for a unicast message to arrive at its recipient:
- Its metadata record needs to be gossiped to the recipient.
- The recipient then needs to state that it wants the message ("IWANT").
- The recipient then needs to wait until the IWANT arrives at the sending peer.
- Finally, the recipient needs to wait for the message to finally arrive.
This makes the sending of unicast messages slow.
Reference: libp2p pubsub overview.
Proposed solution
Peers should subscribe to the individual topics of other peers that are close to them. This greatly increases the likelihood that a sending peer which is sending a unicast message has a full-message peering for the mailbox topic of the recipient, and therefore will send the message immediately.