Skip to content

Commit 2cbf50d

Browse files
authored
Merge branch 'master' into master
2 parents 5fa1164 + 9caa7f5 commit 2cbf50d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

protocols/gossipsub/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- Respect already received IDONTWANT messages when handling IWANT.
99
See [PR 5901](https://github.com/libp2p/rust-libp2p/pull/5901)
1010

11+
- Fix messages were not forwarded to floodsub peers.
12+
See [PR 5908](https://github.com/libp2p/rust-libp2p/pull/5908)
13+
1114
## 0.48.0
1215

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

protocols/gossipsub/src/behaviour.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -2673,15 +2673,17 @@ where
26732673

26742674
// Populate the recipient peers mapping
26752675

2676-
// Add explicit peers
2677-
for peer_id in &self.explicit_peers {
2678-
let Some(peer) = self.connected_peers.get(peer_id) else {
2679-
continue;
2680-
};
2676+
// Add explicit peers and floodsub peers
2677+
for (peer_id, peer) in &self.connected_peers {
26812678
if Some(peer_id) != propagation_source
26822679
&& !originating_peers.contains(peer_id)
26832680
&& Some(peer_id) != message.source.as_ref()
26842681
&& peer.topics.contains(&message.topic)
2682+
&& (self.explicit_peers.contains(peer_id)
2683+
|| (peer.kind == PeerKind::Floodsub
2684+
&& !self
2685+
.score_below_threshold(peer_id, |ts| ts.publish_threshold)
2686+
.0))
26852687
{
26862688
recipient_peers.insert(*peer_id);
26872689
}

0 commit comments

Comments
 (0)