Skip to content

Commit

Permalink
Move broadcast of IDONTWANT to after publishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmygchen committed Oct 31, 2024
1 parent a7c1288 commit 7c624a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions beacon_node/lighthouse_network/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 7c624a6

Please sign in to comment.