You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
Messagefor topicTto peerP:peerSupportsPartialMessages(P)ANDpeerRequestsPartial(P, T)→ do not send the full message toP. The client pushes parts viapublishPartial(...).broadcastInbound/broadcastOutbound, before messages are queued intoGossipRpcPartsQueue.partialMessagewhen 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:iRequestPartial(T)ANDpeerSupportsSendingPartial(P, T)→ skip IDONTWANT toP.gossipsub.go:892-904.3. IHAVE replacement with
onEmitGossip(Step 9)During gossipsub heartbeat lazy-push:
fullPeersandpartialPeers = { p | iSupportSendingPartial(T) ∧ peerRequestsPartial(p, T) }.partialPeers.T, callhandler.onEmitGossip(T, groupId, partialPeers, peerStatesForGroup)once per group.gossipsub.go:2018-2074.Reference
Design:
docs/partial-messages.md§5 (lands with the first PR on #435).