Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pubsub): remove "Implementation note" about setting message_id_fn #557

Merged
merged 2 commits into from
Jul 16, 2023

Conversation

cce
Copy link
Contributor

@cce cce commented Jul 13, 2023

This updates an old note in the message ID section of the pubsub spec to reflect that go-libp2p-pubsub currently supports topic-specific message ID configuration, using WithTopicMessageIdFn.

@cce cce changed the title pubsub: Update message_id_fn "Implementation note" pubsub: Update "Implementation note" about setting message_id_fn Jul 13, 2023
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me the two options are equivalent:

  • a top-level message_id_fn(message) that returns different id's dependent on message.topic
  • one message_id_fn(message) per topic, where each individual function ignores the message.topic field.

Unless I am missing something and there indeed is a difference, I suggest simply removing the paragraph.

@cce
Copy link
Contributor Author

cce commented Jul 13, 2023

Great! I wasn't sure if removing the paragraph was too drastic. I can do that too

@cce
Copy link
Contributor Author

cce commented Jul 13, 2023

I removed the note — main reason for opening this PR was because I was reading the spec and go-libp2p-pubsub docs at the same time and noticed it wasn't up to date.

I think code organization would be the only difference between preferring a global message_id_fn that checks the topic, vs being able to set per-topic message_id_fns ... I found a whole discussion in libp2p/go-libp2p-pubsub#464 about it

@mxinden mxinden changed the title pubsub: Update "Implementation note" about setting message_id_fn fix(pubsub): remove "Implementation note" about setting message_id_fn Jul 16, 2023
@mxinden mxinden merged commit f5c5829 into libp2p:master Jul 16, 2023
@cce cce deleted the update-message-id-implementation-note branch July 18, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants