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
bitswap/client: broadcast reduction and metrics (#937)
* Spam reduction with metrics
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
- peers configured for peering
* boradcast to peer if peer already has a pending message
* count total blocks and haves
* mark broadcast targets instead of keeping counts
* unique blocks received metric
* disable piggybacking spam on existing messages
* bitswap client options for broadcast reduction configuration
* Configure control to local and peered peers separately
* assume local if peer has no addrs
* docs(changelog): document new metrics
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,23 @@ The following emojis are used to highlight certain changes:
16
16
17
17
### Added
18
18
19
+
-`bitswap/client`: New metrics:
20
+
-`ipfs_bitswap_wanthaves_broadcast`: Count of want-haves broadcasts
21
+
-`ipfs_bitswap_haves_received`: Count of total have responses
22
+
-`ipfs_bitswap_bcast_skips_total{`: Count of broadcasts skipped as part of spam reduction logic (see "Changed" below)
23
+
-`ipfs_bitswap_unique_blocks_received`: Count of non-duplicate blocks recieved
24
+
19
25
### Changed
20
26
27
+
-`bitswap/client`: Added an opt-in ability to reduce bitswap broadcast volume by limiting broadcasts to peers that have previously responded as having wanted blocks and peers on local network. The following bitswap client options are available to configure the behavior of broadcast reduction:
28
+
-`BroadcastControlEnable` enables or disables broadcast reduction logic. Setting this to `false` restores the previous broadcast behavior of sending broadcasts to all peers, and ignores all other `BroadcastControl` options. Default is `false` (disabled).
29
+
-`BroadcastControlMaxPeers` sets a hard limit on the number of peers to send broadcasts to. A value of `0` means no broadcasts are sent. A value of `-1` means there is no limit. Default is `-1` (unlimited).
30
+
-`BroadcastControlLocalPeers` enables or disables broadcast control for peers on the local network. If `false`, then always broadcast to peers on the local network. If `true`, apply broadcast control to local peers. Default is `false` (always broadcast to local peers).
31
+
-`BroadcastControlPeeredPeers` enables or disables broadcast control for peers configured for peering. If `false`, then always broadcast to peers configured for peering. If `true`, apply broadcast control to peered peers. Default is `false` (always broadcast to peered peers).
32
+
-`BroadcastControlMaxRandomPeers` sets the number of peers to broadcast to anyway, even though broadcast control logic has determined that they are not broadcast targets. Setting this to a non-zero value ensures at least this number of random peers receives a broadcast. This may be helpful in cases where peers that are not receiving broadcasts may have wanted blocks. Default is `0` (no random broadcasts).
33
+
-`BroadcastControlSendToPendingPeers` enables or disables sending broadcasts to any peers to which there is a pending message to send. When `true` (enabled), this sends broadcasts to many more peers, but does so in a way that does not increase the number of separate broadcast messages. There is still the increased cost of the recipients having to process and respond to the broadcasts. Default is `false`.
34
+
35
+
21
36
### Removed
22
37
23
38
-`bitswap/server` do not allow override of peer ledger with `WithPeerLedger`[#938](https://github.com/ipfs/boxo/pull/938)
0 commit comments