Skip to content

Handling Duplicate Messages in libp2p with gossipsub #5278

Answered by jxs
vinay10949 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, have you seen #2587 (comment) ?
But basically, when publishing via gossipsub, it checks on DuplicateCache if contains the entry:

// Check the if the message has been published before
if self.duplicate_cache.contains(&msg_id) {
// This message has already been seen. We don't re-publish messages that have already
// been published on the network.
tracing::warn!(
message=%msg_id,
"Not publishing a message that has already been published"
);
return Err(PublishError::Duplicate);
}

but DuplicateCache only removes stale entries when you insert a new mess…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by vinay10949
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants