Skip to content

feat: rendezvous #259

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

Merged
merged 13 commits into from
Feb 13, 2023
Merged

feat: rendezvous #259

merged 13 commits into from
Feb 13, 2023

Conversation

salmad3
Copy link
Member

@salmad3 salmad3 commented Dec 5, 2022

Context

Notes

Section this document lives under will become populated with corresponding PRs.

Latest preview

Please view the latest Fleek preview here.

@salmad3 salmad3 marked this pull request as draft December 5, 2022 04:10
@salmad3 salmad3 linked an issue Dec 5, 2022 that may be closed by this pull request
6 tasks
@salmad3 salmad3 added the ready for review PR is ready for review label Dec 5, 2022
@salmad3 salmad3 marked this pull request as ready for review December 5, 2022 09:18
@salmad3 salmad3 requested a review from mxinden December 5, 2022 09:18
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.

Thanks for the write up @DannyS03. A couple of comments.

Maybe @thomaseizinger, as the author of the rust-libp2p implementation and specification, can you take a look?

Comment on lines 60 to 62
Pubsub can also be used as a mechanism for building rendezvous services, where a number
of rendezvous points can federate using pubsub for internal real-time distribution while still
providing a simple interface to clients.
Copy link
Member

Choose a reason for hiding this comment

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

Is that implemented anywhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not aware of an implementation myself, but it is possible (as per the spec).

@salmad3 salmad3 added change request PR requires changes. and removed ready for review PR is ready for review labels Dec 19, 2022
Co-authored-by: Max Inden <mail@max-inden.de>
Copy link

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thanks for the ping @mxinden.

Before I comment on any details of the text, I'd like to point out that to my knowledge and compared to other discovery protocols like the DHT, rendezvous is not actually used by IPFS or other large deployment of libp2p.

For example, the implementation of the protocol in Go lives outside the main repository: https://github.com/berty/go-libp2p-rendezvous.
A search for "rendezvous" in the go-libp2p repository only yields (slightly misleading) examples: https://github.com/search?q=repo%3Alibp2p%2Fgo-libp2p+rendezvous+language%3AGo&type=code&l=Go

I am not sure what the scope of this recent docs update is but in my opinion, it would be better to:

  • Update the rendezvous spec to remove the sections about "replacing ws-star-rendezvous" and other things that have never been implemented.
  • Overall revise the spec to more clearly state what it is without any of the "we may do X, Y or Z" with this.
  • Trim this document down to a high-level introduction
  • Link to the spec for any details

Compared to the similar discussion we had in the TLS PR, we actually did invent this. Consequently, there isn't much we can say here in regards to "This is the general rendezvous protocol and libp2p uses only this bit". Instead, I think we should just give a brief introduction and then link to the spec for any details. If we give the spec a slight polish, it should be easier to approach which would be a net-win because it also benefits people that discover the spec from somewhere else other than this docs site :)

My 2c. Let me know what you guys think!

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

I agree with the points made about the use of "real-time".

I also think we need to point out that rendezvouz is not decentralized. It's federated at best. That's not necessarily a bad thing, there are valid use cases for that, but it introduces one central point of failure into the network. This description can then be used to contrast rendezvouz with fully decentralized solutions like the DHT and Gossipsub.

It would also be valuable to point out that rendezvouz is not used by IPFS and Filecoin (where is it used at all?).

@thomaseizinger
Copy link

It would also be valuable to point out that rendezvouz is not used by IPFS and Filecoin (where is it used at all?).

We used it at my old job for a project which I think is still live (that is why I initially wrote the Rust implementation).

nim-libp2p has an implementation but I don't know about any deployments. (cc @Menduist)

The go implementation I linked above is from berty but I heard that is a forked version and thus may not be compatible? (cc @gfanton)

@Menduist
Copy link
Contributor

We currently don't use it, but probably will in the next few months.

I think RendezVous is one of the best "service discovery" method we can have
It's also more suited to mobiles & co

I also think it does not has to be centralized: in our implementation, everyone is storing records, and when pulling records from a peer, you will also store them. So sure, you need "centralized bootnodes", exactly like the DHT
But once you discovered other peers, you can just exchange SPRs in a decentralized manner.

IMO it's just a different use-case from the DHT. A DHT is very powerful for:

  • Finding a specific value in the network
  • Random walks

But when you want to find a "group of peers" (for instance for service discovery), you either need to random-walk your way to them, or store every peers of that group under a single ID (which puts them in a very limited amount of nodes). None of which is ideal

Happy to be corrected here :) We'll try to do some simulations in the upcoming months to see if we can get to a fully decentralized rendez-vous giving better perfs than DHT for service discovery.

@gfanton
Copy link

gfanton commented Dec 26, 2022

We use a fork of an implementation made by https://github.com/vyzo (https://github.com/libp2p/go-libp2p-rendezvous/tree/implement-spec) at Berty, and it has been working well for us. I'm not sure how compatible it is with the nim-libp2p implementation though. The main change we made was to improve the Subscribe method, which allowed us to add MQTT servers for real-time discovery notification.

As @Menduist mentioned, the Rendezvous service is especially useful on mobile devices where applications have short-lived sessions and cannot use the DHT efficiently due to factors such as bootstrap time and discovery latency. We created a multi-discovery system that advertises on both the DHT and the rendezvous to provide a fallback option, but I'm not completely satisfied with it because it relies too much on the rendezvous and doesn't act as a truly decentralized service. Additionally, the DHT is essentially meaningless in this setup because it is hidden by the rendezvous service and uses too much energy on mobile devices.

Happy to be corrected here :) We'll try to do some simulations in the upcoming months to see if we can get to a fully decentralized rendez-vous giving better perfs than DHT for service discovery.

Please keep us in touch, I'm really looking forward to this 😄

@salmad3 salmad3 changed the base branch from master to init/discovery-sec January 15, 2023 18:24
@salmad3 salmad3 removed the change request PR requires changes. label Jan 15, 2023
@salmad3 salmad3 added ready for review PR is ready for review and removed needs thinking labels Jan 15, 2023
@salmad3 salmad3 added the P1 High label Jan 26, 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.

This is good to go from my end @p-shahi. What do you suggest as next steps? I don't understand the branching strategy here.

@p-shahi p-shahi merged commit 4e5cc2e into init/discovery-sec Feb 13, 2023
@p-shahi p-shahi deleted the discovery/rendezvous branch February 13, 2023 19:10
p-shahi pushed a commit that referenced this pull request Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High ready for review PR is ready for review
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

Create and populate discovery & routing section
7 participants