ipfs / service-worker-gateway

IPFS Gateway implemented in Service Worker
https://inbrowser.link
Other
27 stars 8 forks source link

ux: add configuration toggle for delegated routing #288

Open lidel opened 4 months ago

lidel commented 4 months ago

IPFS Camp UX improvement suggestion based on discussions with @aschmahmann

Current state

Proposed UX fix

aschmahmann commented 4 months ago

@lidel I don't know if that fix is quite enough. If the delegated routing endpoints are being used for IPNS resolution (as opposed to using the trustless gateway endpoints) then we still need them around even if not doing direct retrievals.

We could at the Helia level not turn on the content or peer routing systems though (or potentially use the trustless gateways for IPNS fetch).

lidel commented 4 months ago

Yes, the idea here is to have "quality of life" toggle that disables all delegated routing, and only relies on trustless gateways.

You can still do IPNS via trustless gateways alone, but if verified-fetch does not leverage it yet, we can simply error on IPNS errors, informing user they need to enable delegated routing.

2color commented 4 months ago

This seems like a duplicate of #267.

@lidel I don't know if that fix is quite enough. If the delegated routing endpoints are being used for IPNS resolution (as opposed to using the trustless gateway endpoints) then we still need them around even if not doing direct retrievals.

That's right. Currently, Helia is built in a way that accepts 3 kinds of routers (libp2p, delegatedHTTPRouting, and httpGatewayRouting) and by default includes both delegatedHTTPRouting, and httpGatewayRouting. The problem is that if we remove the delegatedHTTPRouting, there's no way for Helia to Resolve IPNS names.

I've opened https://github.com/ipfs/helia/issues/558 to address this gap in Helia.

lidel commented 4 months ago

Descoping from Camp milestone due to impact on DNSLink (see https://github.com/ipfs/service-worker-gateway/pull/303#pullrequestreview-2148664363).

SgtPooki commented 1 day ago

Do we still want to do this? I think the only action item here would be to disable delegated routing if direct retrieval is not enabled and trustless gateways are enabled.