From 7c624a601a6a7dba266814a29f65ec65be2ec1e7 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 31 Oct 2024 22:31:21 +1100 Subject: [PATCH] Move broadcast of `IDONTWANT` to after publishing. --- .../lighthouse_network/gossipsub/src/behaviour.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beacon_node/lighthouse_network/gossipsub/src/behaviour.rs b/beacon_node/lighthouse_network/gossipsub/src/behaviour.rs index 36217f22cf..933c953207 100644 --- a/beacon_node/lighthouse_network/gossipsub/src/behaviour.rs +++ b/beacon_node/lighthouse_network/gossipsub/src/behaviour.rs @@ -626,11 +626,6 @@ where return Err(PublishError::Duplicate); } - // Broadcast IDONTWANT messages - if raw_message.raw_protobuf_len() > self.config.idontwant_message_size_threshold() { - self.send_idontwant(&raw_message, &msg_id, raw_message.source.as_ref()); - } - tracing::trace!(message=%msg_id, "Publishing message"); let topic_hash = raw_message.topic.clone(); @@ -781,6 +776,11 @@ where return Err(PublishError::AllQueuesFull(recipient_peers.len())); } + // Broadcast IDONTWANT messages + if raw_message.raw_protobuf_len() > self.config.idontwant_message_size_threshold() { + self.send_idontwant(&raw_message, &msg_id, raw_message.source.as_ref()); + } + tracing::debug!(message=%msg_id, "Published message"); if let Some(metrics) = self.metrics.as_mut() {