libp2p / libp2p/go-libp2p-pubsub
with gossipsub subscribers may not receive the first couple of messages
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 364
- Forks
- 221
- PR merge metrics
- No merged PRs in 30d
Description
While trying to sync js repos with go-ipfs 0.5.x i notice pubsub tests were failing for js-ipfs-http-client the specific test works like this:
1. peer1 swarm connects to peer2
2. peer1 and peer2 subscribe to topicA
3. peer2 runs ipfs.pubsub.peers() multiple times until it sees peer1
4. peer2 publishes a msg to the topic
5. test asserts that both peers receive the msg
So this test started to fail with go-ipfs 0.5 talking to @aschmahmann we discovered that this behaviour is due to 0.5 defaulting to gossipsub because with floodsub the test passes.
To make the test pass with gossipsub i needed to add a ~2s (may work with less just a random number) delay between step 3 and 4.
Can we remove the need for that delay and make gossipsub work like floodsub ?
issue https://github.com/ipfs/js-ipfs/issues/3030
pr https://github.com/ipfs/js-ipfs/pull/3013
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the described pubsub test flow with go-ipfs 0.5.x, comparing gossipsub and floodsub behavior around ipfs.pubsub.peers(). Trace the subscription and peer-discovery path before the publish step; done means both peers receive the first message without an arbitrary delay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100