Skip to content

Gossipsub: make partial message part forwarding normative - #737

Open
MavenRain wants to merge 2 commits into
libp2p:masterfrom
MavenRain:feat/partial-messages-normative-forwarding
Open

Gossipsub: make partial message part forwarding normative#737
MavenRain wants to merge 2 commits into
libp2p:masterfrom
MavenRain:feat/partial-messages-normative-forwarding

Conversation

@MavenRain

Copy link
Copy Markdown

Summary

The partial-messages spec mentions forwarding parts before full receipt only as a motivation-level possibility ("partial messages could also be forwarded"). This PR promotes that behavior to normative requirements and bumps the revision to r1.

The new Forwarding Message Parts section specifies:

  • A part that the application can validate on its own is individually verifiable.
  • Applications SHOULD validate individually verifiable parts on receipt and SHOULD forward validated parts to mesh peers that requested partial messages, without waiting for the full message.
  • Applications MUST NOT forward a part that failed validation.
  • Implementations MUST accept a partial publish for a group before the full message is known, MUST accept repeated publishes for the same group as more parts arrive, and SHOULD deduplicate per peer so repeated publishes only send what a peer lacks.
  • Parts that are not individually verifiable MUST NOT be forwarded before the full message validates.

The Motivation bullet now points at the new section instead of the "could" phrasing.

Why normative, and why now

This codifies behavior that is already deployed rather than proposing new behavior:

  • The rust-libp2p implementation of this extension (feat(gossipsub): implement partial messages extension rust-libp2p#6275) places no completeness requirement on publish_partial: it caches the application's partial, supports incremental re-publish of a growing group, and skips sends whose metadata adds nothing.
  • Lighthouse's cell dissemination (Cell Dissemination (Partial messages) sigp/lighthouse#8314, merged 2026-04-23) uses exactly this path in production code: every merge that adds KZG-verified cells to a still-incomplete column immediately republishes the incomplete column to the network (PartialDataColumnAssembler::merge_partials returns updated_partials, which gossip_methods publishes via publish_partial).

Making the forwarding rule normative gives other implementations and applications a clear interop target for the store-and-forward latency win that motivated the extension, and pins down the safety condition (individual verifiability plus validation before forwarding) that the deployed code already honors.

Relationship to the v1.4 work

Complementary to #654 / #720: those define fragmentation and pipelined relay for opaque payloads at the protocol layer, while this change covers applications with application-defined verifiable parts on the shipped v1.3 partial-messages extension.

Promote forwarding of individually verifiable message parts from a
motivation-level possibility to normative requirements, and bump the
partial-messages spec revision to r1.

The new Forwarding Message Parts section specifies that applications
SHOULD validate and forward individually verifiable parts before the
full message is known, MUST NOT forward parts that failed validation,
and that implementations MUST accept incremental partial publishes for
a group.  This codifies behavior that is already deployed: the
rust-libp2p implementation (libp2p/rust-libp2p#6275) places no
completeness requirement on published partials, and Lighthouse
(sigp/lighthouse#8314) validates and republishes incomplete data
columns as cells arrive.

Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
Comment thread pubsub/gossipsub/partial-messages.md Outdated
Comment on lines +71 to +72
[Forwarding Message Parts](#forwarding-message-parts)), allowing us to
reduce the store-and-forward delay [2].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Forwarding Message Parts](#forwarding-message-parts)), allowing us to
reduce the store-and-forward delay [2].
[Forwarding Message Parts](#forwarding-message-parts)), helping to
reduce the store-and-forward delay [2].

Comment thread pubsub/gossipsub/partial-messages.md Outdated
transferred. In order for fanout and gossip messages to be useful, the
Application MUST be able to send partial messages to these peers.

## Forwarding Message Parts

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe

Suggested change
## Forwarding Message Parts
## Forwarding Message Parts Without Knowing Full Message

Comment thread pubsub/gossipsub/partial-messages.md Outdated
Comment on lines +206 to +210
Some applications can validate a message part on its own, without the full
message. Such a part is individually verifiable. For example, a node can
validate a DAS cell against its KZG commitment without the other cells in the
column.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could just remove this paragraph

Suggested change
Some applications can validate a message part on its own, without the full
message. Such a part is individually verifiable. For example, a node can
validate a DAS cell against its KZG commitment without the other cells in the
column.

Comment thread pubsub/gossipsub/partial-messages.md Outdated
partial messages for the topic, without waiting for the full message. This
removes the store-and-forward delay of full message relay [2].

An application MUST NOT forward a part that failed validation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
An application MUST NOT forward a part that failed validation.
An application MUST NOT forward a part that failed validation or that cannot be individually validated.

Comment thread pubsub/gossipsub/partial-messages.md Outdated
To support this, implementations MUST accept a partial message publish for a
group before the application has the full message, and MUST accept repeated
publishes for the same group as the application obtains more parts.
Implementations SHOULD track per-peer state so that repeated publishes only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementations SHOULD track per-peer state

Maybe you can be a bit more descriptive on how this is supposed to happen implementation-wise? I know many of these details are for each implementation to decide, but I found that "track per-peer state" is a bit too vague

also, nit:

Suggested change
Implementations SHOULD track per-peer state so that repeated publishes only
Implementations SHOULD track peer state so that repeated publishes only

Comment thread pubsub/gossipsub/partial-messages.md Outdated
Comment on lines +225 to +227
Parts that are not individually verifiable MUST NOT be forwarded before the
full message validates. Applications with such parts fall back to
store-and-forward relay of the reconstructed full message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think if we apply my third suggestion we can get rid of this part

Suggested change
Parts that are not individually verifiable MUST NOT be forwarded before the
full message validates. Applications with such parts fall back to
store-and-forward relay of the reconstructed full message.

Address the first review round on the normative part forwarding
section of the partial-messages spec:

- Rename the section to "Forwarding Message Parts Without Knowing
  Full Message" and update the Motivation link to match.
- Soften the Motivation bullet from "allowing us to reduce" to
  "helping to reduce" the store-and-forward delay.
- Drop the paragraph that defined individually verifiable parts; the
  Terms section already defines a Message Part as the smallest
  verifiable part of a message.
- Fold the "cannot be individually validated" case into the single
  MUST NOT forward rule and remove the now redundant closing
  paragraph.
- Replace "track per-peer state" with "track peer state" and add a
  concrete description of that state: for each peer and Group ID an
  implementation keeps the parts it believes the peer has and the
  partsMetadata it last sent, sends only the difference on repeated
  publishes, and drops both records after a bounded number of
  heartbeats.  This matches the rust-libp2p implementation
  (libp2p/rust-libp2p#6275).

Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants