bitswap/client: broadcast reduction and metrics#937
Merged
Conversation
Reduce bitswap spam by only sending broadcast wants to: - peers that have previously replied with a have block - peers that are on the local network The value `broadcastNonSenders` sends a new CID to that number of hosts that do not match the above criteria.
lidel
reviewed
Jun 6, 2025
Member
lidel
left a comment
There was a problem hiding this comment.
Leaving internals review to @aschmahmann,
but we need to document all these new knobs better (port docs from kubo pr?)
Co-authored-by: Guillaume Michel <[email protected]>
guillaumemichel
approved these changes
Jun 12, 2025
hsanjuan
reviewed
Jun 12, 2025
Contributor
hsanjuan
left a comment
There was a problem hiding this comment.
Some small nits and a couple of questions from my side
Contributor
|
One more comment as I gave some thought: I think it would be good to think if we should broadcast to protected/tagged connections. Tagging a connection is a way of specifying that different peer is your friend. I don't know if we can distinguish between manual user tags and temporary tags made by bitswap/dht though... |
lidel
reviewed
Jun 12, 2025
3 tasks
Co-authored-by: Marcin Rataj <[email protected]>
lidel
reviewed
Jun 12, 2025
Contributor
hsanjuan
reviewed
Jun 13, 2025
- Rename broadcast control options - Configure applying control to local and peered peers separately - Rename broadcastConfig to broadcastControl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Metrics
ipfs_bitswap_wanthaves_broadcast: Count of want-haves set as broadcastsipfs_bitswap_haves_received: Count of total have responsesipfs_bitswap_bcast_skips_total{: Count of broadcasts skipped as part of spam reduction logicipfs_bitswap_unique_blocks_received: Count of non-duplicate blocks recieved.Broadcast reduction logic
Send broadcast if:
Otherwise send broadcast to peer.
References