Skip to content

Conversation

@MarcoPolo
Copy link
Contributor

@MarcoPolo MarcoPolo commented Jul 15, 2025

Implements libp2p/specs#685

Commits are meaningful. Best to review commit by commit.

@MarcoPolo MarcoPolo changed the base branch from master to marco/extensions July 17, 2025 21:01
@MarcoPolo MarcoPolo force-pushed the marco/extensions branch 2 times, most recently from 222428a to 5299023 Compare August 29, 2025 19:56
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 6a50510 to 8162df6 Compare August 29, 2025 20:44
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 8162df6 to 74b015e Compare September 10, 2025 21:21
@MarcoPolo MarcoPolo force-pushed the marco/extensions branch 3 times, most recently from 7402459 to 939defb Compare September 15, 2025 18:43
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch 2 times, most recently from a1d0543 to c5773aa Compare September 15, 2025 19:33
@MarcoPolo MarcoPolo force-pushed the marco/extensions branch 2 times, most recently from 4e4faae to 857c8cc Compare September 15, 2025 19:37
Base automatically changed from marco/extensions to master September 15, 2025 20:32
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch 2 times, most recently from a76890d to 96339bb Compare September 15, 2025 22:32
@MarcoPolo MarcoPolo marked this pull request as ready for review September 15, 2025 22:32
@MarcoPolo MarcoPolo requested a review from sukunrt September 15, 2025 22:32
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch 3 times, most recently from 818f40d to 7fc7eb4 Compare September 23, 2025 21:05
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 7fc7eb4 to 578e12f Compare September 24, 2025 17:50
@MarcoPolo
Copy link
Contributor Author

thanks for the review @ppopth, friendly reminder you can see the latest changes with git range-diff master 7fc7eb495bd6 578e12f4afcd

@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch 2 times, most recently from f165483 to 4bec540 Compare September 30, 2025 19:22
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 4bec540 to eb2f04a Compare October 9, 2025 19:27
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from eb2f04a to a099440 Compare October 10, 2025 17:58
The bitmap is probably the common case, so add library support for it.
This allows a peer's local partsMetadata to merge with their remote
partsMetadata. As long as the underlying PartsMetadata type supports
CRDT-like addition, we can avoid sending the peer duplicates.

Take the following example (credit Sukun):

> Say: We have parts 1, 2, 5, 6
> 
> 1. Peer sends a message saying I have part 1, 2
> 2. We send parts 5, 6 and update the peerstate in PublishMessage to (1, 2, 5, 6)
> 3. Concurrently with 2, we receive message from the peer saying I now have parts (1, 2, 3, 4)

With this change we can now correctly store the fact that this peer
should have parts 1,2,3,4,5,6. And in a way that does not assume a
specific representation of the PartsMetadata.
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from a099440 to a0a57bb Compare October 11, 2025 00:19
and fix a bug where we would skip sending them full messages if they
requested partial messages and we disabled partial messages.
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 237d418 to c66cef0 Compare October 13, 2025 21:35
MarcoPolo and others added 7 commits October 13, 2025 14:36
if they requested partial messages on a given topic.
When a topic join happens concurrently with adding a new peer, we may
send the topic join announcement before the hello packet which contains
our extensions. This is a protocol violation.

This change starts sending rpcs on new stream only after we've enqued a
hello packet. We use UrgentPush to ensure that it's the first one sent.
instead of requiring a message object
We need some way to give peer feedback to gossipsub if the application
is using partial messages. This adds a new PeerFeedback method that lets
an application modify the peer score.
@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 9158d1c to 34e9bba Compare October 15, 2025 02:39
Copy link
Member

@sukunrt sukunrt left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@MarcoPolo MarcoPolo force-pushed the marco/partial-messages-2 branch from 34e9bba to d0f9caf Compare October 24, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants