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

add a config option to allow all protocols via circuit v2 #2079

Closed
Tracked by #2062
marten-seemann opened this issue Feb 9, 2023 · 5 comments · Fixed by #2125
Closed
Tracked by #2062

add a config option to allow all protocols via circuit v2 #2079

marten-seemann opened this issue Feb 9, 2023 · 5 comments · Fixed by #2125

Comments

@marten-seemann
Copy link
Contributor

We should do this if we want to drop v1 support

@marten-seemann marten-seemann changed the title add a confit option to allow all protocols via circuit v2 add a config option to allow all protocols via circuit v2 Feb 9, 2023
@lidel
Copy link
Member

lidel commented Feb 9, 2023

I'd love to expose this ability in Kubo as opt-in option under Swarm.RelayService.

People loved the fact they could use regular Kubo as a static relay v1 for their web app (in controlled environments, when both service and clients running on web pages were set up statically). Bitswap over relayed connection "just worked".

Since we've removed v1 service, it is impossible to do bitswap over relayed connection, and people are forced to run a separate daemon just for the relay feature, which is pretty bad UX for using IPFS in web apps.

With this new config option, people will be able to deploy web apps that run bitswap over relay again 👍
cc @2color @TheDiscordian

@p-shahi p-shahi mentioned this issue Feb 9, 2023
25 tasks
@marten-seemann
Copy link
Contributor Author

@lidel that’s not what this issue is about. I don’t plan adding an unlimited relay mode here. The transition to circuit v2 (which enabled decentralized hole punching) was only possible because relays are imposing strict usage limits.

@lidel
Copy link
Member

lidel commented Feb 9, 2023

@marten-seemann ack, i think we are on the same page, we talk about additional option to allow all protocols here, nothing more.

I only meant that this new option, together with existing ability to set limits very high, allows users to have a (more-or-less) drop-in replacement for how they use v1 today.

@Winterhuman
Copy link

Winterhuman commented Feb 14, 2023

Would this feature be advertised as a multistream protocol component, like /libp2p/circuit/relay/0.2.0/all-protocols as an example? (probably not the best way of constructing this, but you get the idea)

Being able to discover which nodes provide this feature would be very useful, as I imagine nodes willing to enable this will be quite scarce overall

@marten-seemann
Copy link
Contributor Author

We don't need a config option, we can just say that if the relay gives us infinite limits we don't apply any filter which protocols can be used.

In fact, that's what we're already doing:

if limit := msg.GetLimit(); limit != nil {
stat.Transient = true
stat.Extra = make(map[interface{}]interface{})
stat.Extra[StatLimitDuration] = time.Duration(limit.GetDuration()) * time.Second
stat.Extra[StatLimitData] = limit.GetData()
}

I confirmed that this actually works. An unlimited v2 relay can be started using the relay.WithLimit(nil) option to libp2p.EnableRelayService option. We could consider introducing a more intuitive way of doing this.

Other than that, I believe this issue is fully resolved.

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 a pull request may close this issue.

4 participants