libp2p / libp2p/jvm-libp2p

Gossip routing integration for partial messages

Open
#456 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

partial-messages
Dominant language
Kotlin
Stars
366
Forks
85
Avg merge
2d 39m
Merged PRs (30d)
6

Description

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 #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](../blob/develop/docs/partial-messages.md) (lands with the first PR on #435).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read docs/partial-messages.md §5 and trace the three routing paths in GossipRouter: broadcastInbound/broadcastOutbound, IDONTWANT emission, and gossipsub heartbeat lazy-push. Compare the referenced go-libp2p sections and inspect GossipRpcPartsQueue, partialMessagesEnabled(), and onEmitGossip. Done means all three specified routing changes honor peer handshake and partial-message state without changing behavior for other peers.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
distributed-systems, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.