libp2p / libp2p/jvm-libp2p

Publish partial messages

Open
#445 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 wire-level partial-message send/receive flow (Steps 3 + 4 of #435).

## Scope

### Inbound dispatch (Step 3)
Replace the stub at `GossipRouter.kt:476` (`processPartialMessageExtension`) with the full flow:
1. Validate that local + peer both advertised `ControlExtensions.partialMessages`.
2. Get-or-create `GroupState(topic, groupId)`, mark as peer-initiated.
3. Enforce DoS caps (tracked in #449).
4. Call `handler.onIncomingRpc(from, peerStates, rpc)`.

### Outbound publish (Step 4)
Add `Gossip.publishPartial(topic, groupId, actions)` entry point:
1. Hop to pubsub event thread.
2. Get-or-create `GroupState`, reset TTL.
3. Populate `peerStates` with zero-values for mesh peers (fallback to fanout when mesh is empty).
4. Invoke `PublishActionsFn`, iterate yielded actions.
5. Per action: build `Rpc.PartialMessagesExtension{topicID, groupID, partialMessage?, partsMetadata?}`, enqueue through `GossipRpcPartsQueue` (do NOT bypass — PR #433 got this wrong).
6. Apply `nextPeerState` atomically.
7. Enforce spec MUST: omit `partialMessage` when peer supports sending partial but did not request it on this topic.

### Not in scope here
Routing-layer changes (suppress full-msg, suppress IDONTWANT, replace IHAVE) are tracked separately — see the routing-integration sub-issue of #435.

## Reference
Design: [`docs/partial-messages.md` §4.3, §5, §6.2](../blob/develop/docs/partial-messages.md) (lands with the first PR on #435).
go-libp2p: `extensions.go:221`, `partialmsgs.go:216, 303`.

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

Start with GossipRouter.kt:476 and read docs/partial-messages.md sections 4.3, 5, and 6.2, then compare the referenced go-libp2p extensions.go:221 and partialmsgs.go:216, 303. Trace the Gossip.publishPartial entry point and GossipRpcPartsQueue; done means inbound dispatch and outbound queuing follow the listed scope, including peer-state updates and the partialMessage omission requirement.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
distributed-systems, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.