From 7b4c1f9c15388fbd4ce198e13899cb78723d0f81 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Thu, 18 Jan 2024 18:04:39 +1100 Subject: [PATCH 1/2] Fix panics? --- protocols/gossipsub/src/behaviour.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 86f0eac43dd..80e487d72dc 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -1995,6 +1995,9 @@ where // remove unsubscribed peers from the mesh if it exists for (peer_id, topic_hash) in unsubscribed_peers { + self.fanout + .get_mut(&topic_hash) + .map(|peers| peers.remove(&peer_id)); self.remove_peer_from_mesh(&peer_id, &topic_hash, None, false, Churn::Unsub); } From 83e445824a33ca9342bcf0f818d831c8fb438221 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Mon, 22 Jan 2024 15:44:27 +1100 Subject: [PATCH 2/2] Update protocols/gossipsub/src/behaviour.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: João Oliveira --- protocols/gossipsub/src/behaviour.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocols/gossipsub/src/behaviour.rs b/protocols/gossipsub/src/behaviour.rs index 80e487d72dc..aa8a7bf3c58 100644 --- a/protocols/gossipsub/src/behaviour.rs +++ b/protocols/gossipsub/src/behaviour.rs @@ -1993,7 +1993,7 @@ where } } - // remove unsubscribed peers from the mesh if it exists + // remove unsubscribed peers from the mesh and fanout if it they exist there. for (peer_id, topic_hash) in unsubscribed_peers { self.fanout .get_mut(&topic_hash)