Skip to content

Subscribe to the "mailbox topics" of close peers #12

Open
@lyulka

Description

@lyulka

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:

  1. Its metadata record needs to be gossiped to the recipient.
  2. The recipient then needs to state that it wants the message ("IWANT").
  3. The recipient then needs to wait until the IWANT arrives at the sending peer.
  4. 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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions