Skip to content

Gossip routing integration for partial messages #456

@lucassaldanha

Description

@lucassaldanha

Implements the three spec-mandated routing changes inside GossipRouter (Steps 6, 7, 9 of #435).

All three are gated on partialMessagesEnabled() and on the per-peer handshake state established in #444.

Scope

1. Full-message suppression (Step 6)

When broadcasting a Message for topic T to peer P:

  • If peerSupportsPartialMessages(P) AND peerRequestsPartial(P, T)do not send the full message to P. The client pushes parts via publishPartial(...).
  • Filter applied in broadcastInbound / broadcastOutbound, before messages are queued into GossipRpcPartsQueue.
  • Spec MUST: if peer supports sending partial but did NOT request, we still send the full message. Omitting partialMessage when sending a partial RPC to such a peer is handled in Publish partial messages #445.

2. IDONTWANT suppression (Step 7)

When emitting IDONTWANT for a message on topic T:

  • If we iRequestPartial(T) AND peerSupportsSendingPartial(P, T) → skip IDONTWANT to P.
  • go-libp2p: gossipsub.go:892-904.

3. IHAVE replacement with onEmitGossip (Step 9)

During gossipsub heartbeat lazy-push:

  • Partition IHAVE targets into fullPeers and partialPeers = { p | iSupportSendingPartial(T) ∧ peerRequestsPartial(p, T) }.
  • Do not enqueue IHAVE for partialPeers.
  • For each locally-initiated group under T, call handler.onEmitGossip(T, groupId, partialPeers, peerStatesForGroup) once per group.
  • go-libp2p: gossipsub.go:2018-2074.

Reference

Design: docs/partial-messages.md §5 (lands with the first PR on #435).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions