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

Messages are not propagated when only some nodes subscribe a topic #149

Closed
vasco-santos opened this issue Jan 28, 2021 · 8 comments
Closed
Assignees

Comments

@vasco-santos
Copy link
Collaborator

Let's consider a simple network with 3 peers {A, B, C}, with 2 connections established A<->B and B<->C

In this scenario, if A subscribes to a given topic and C publishes messages to that topic, A should be able to receive the messages.

It seems to me that https://github.com/ChainSafe/js-libp2p-gossipsub/blob/v0.8.0/ts/index.ts#L1034 this should not break here, otherwise we will not grab fanout peers. However, this does not seem to fix the issue, as I tried to do a small hacking in the code but messages were not sent to the peer.

Other than that, should we make canRelayMessage options to be true by default? I would expect the default behaviour to relay messages, but users might turn that off if they like.

Test scenario to test: libp2p/js-libp2p-interfaces#83 (use this branch as a dep)

@wemeetagain any ideas on what is wrong here?

cc @Gozala

@wemeetagain
Copy link
Member

I'm curious how this scenario works using go-libp2p.

It seems C won't send the message to B because nodes only send messages to peers which have subscribed to the topic (or direct peers).

As far as I know, publishing a message follows something like this:

  • publish to all direct peers
  • if flood-publishing is enabled
    • publish to all peers subscribed to the topic
  • else
    • publish to floodsub peers subscribed to the topic
    • if we are in the mesh for the topic
      • publish to mesh peers (peers subscribed to the topic)
    • else
      • publish to fanout peers (possibly creating fanout peers from peers subscribed to the topic)

@vasco-santos
Copy link
Collaborator Author

@wemeetagain I also noticed that, both in go code and spec. This is strange though, while I understand that the real world scenarios are bigger topologies, I would expect this to work. What do you think?

I did a small test with go daemon and it has the same behaviour and the other peer does not receive messages https://github.com/libp2p/interop/blob/chore/try-3-go-gossipsub-with-hop/test/pubsub/gossipsub/go2go2go.js

@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale label Jun 2, 2021
@stale
Copy link

stale bot commented Jun 11, 2021

This issue or pull request has been automatically been closed due to inactivity.

@stale stale bot closed this as completed Jun 11, 2021
@stale stale bot removed the bot:stale label Jun 11, 2021
@3xtr4t3rr3str14l
Copy link

is this still an issue?

@stale
Copy link

stale bot commented Jul 29, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the bot:stale label Apr 16, 2022
@dapplion
Copy link
Contributor

Please re-open if current version still causes this issue. The publish logic has been modified

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

No branches or pull requests

4 participants