-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore: update libp2p-pubsub #110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things are getting cleaner now 👍
subs.forEach((subOpt) => this._processRpcSubOpt(peer, subOpt)) | ||
this.emit('pubsub:subscription-change', peer.id, peer.topics, subs) | ||
subs.forEach((subOpt) => this._processRpcSubOpt(idB58Str, subOpt)) | ||
this.emit('pubsub:subscription-change', peerStreams.id, subs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any strong reason to remove the topics the peer is subscribed from the event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't indexing "peer => subscribed topics" anymore.
Previously the Peer
maintained a list of topics - Peer#topics
Now we just have this.topics
- topic => subscribed peers
we could:
- leave this as is, keeping this event modified
- loop thru all this.topics, collecting subscribed peers
- create another index, eg:
this.peerTopics
- peer => subscribed topics
I've got a preference for 1 or 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it for now. If we have something built on top of this information, we can reconsider what to do
CI seems broken. Any cache related issue? |
Yeah, just cleared the cache and rerunning now |
It seems the tests are failing w floodsub interop. Floodsub seems to be using the 0.6.x branch of libp2p-pubsub 🤔 |
I'll put in a PR to update floodsub, link to that branch here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Update
libp2p-pubsub
tov0.6.x
(passes tests with libp2p/js-libp2p-pubsub#65 and libp2p/js-libp2p-pubsub#66 applied)InMessage
object to includereceivedFrom
peer-id string(id: string, msg: InMessage)
to just be(msg: InMessage)
since InMessage now contains thereceivedFrom
peer idvalidate
to throw on invalid messages_processTopicValidatorResult
in favor of overridingvalidate
in order to apply validation penaltiespublish
/_publish
for publishing a single messagepeer
/Peer
withpeerStreams
/PeerStreams
in many placespeerStreams
in many places)_onPeerConnected
).