Skip to content

Commit 4df989c

Browse files
authored
fix(gossipsub): fix inconsistent publish to floodsub peers
publish broadcasted to all floodsub peers regardless of their topics Pull-Request: #5904.
1 parent b685b63 commit 4df989c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

protocols/gossipsub/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Fix messages were not forwarded to floodsub peers.
1919
See [PR 5908](https://github.com/libp2p/rust-libp2p/pull/5908)
2020

21+
- Fix messages were published to all floodsub peers regardless of their topic.
22+
See [PR 5904](https://github.com/libp2p/rust-libp2p/pull/5904)
23+
2124
## 0.48.0
2225

2326
- Allow broadcasting `IDONTWANT` messages when publishing to avoid downloading data that is already available.

protocols/gossipsub/src/behaviour.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ where
717717
// Floodsub peers
718718
for (peer, connections) in &self.connected_peers {
719719
if connections.kind == PeerKind::Floodsub
720+
&& connections.topics.contains(&topic_hash)
720721
&& !self
721722
.score_below_threshold(peer, |ts| ts.publish_threshold)
722723
.0

0 commit comments

Comments
 (0)