ipfs-inactive / bifrost-gateway

Experimental gateway with delegated backend. No longer maintained, consider migrating to https://github.com/ipfs/rainbow/
Other
41 stars 20 forks source link

Rename ?format=car URL params to match IPIP-402 #80

Closed lidel closed 1 year ago

lidel commented 1 year ago

This issue is based on discussions I had with @aschmahmann and with @hannahhoward (slack) about around depth=0|1|all. cc https://github.com/ipfs/specs/issues/348

Problem

The depth=0|1|all parameter was provisionally introduced as part of Rhea project and we quickly realized we need to improve if we want to upstream it to https://specs.ipfs.tech/http-gateways/trustless-gateway/

The name is unfortunate, because after all Graph API interations we've ended up with "depth" that lost original meaning ("how deep to fetch a DAG (or path)"), and ended up meaning "logical depth from the perspective of end user thinking in terms of a single block, a file or a directory enumeration".

In that framing, the name makes very little sense:

I don’t think we should have an integer range where there are only two possible values with well-defined behavior.

I agree, we ended up with three states:

I think we both want to clean this up. and we agree "depth" is simply an invalid term here. I also agree with you, strings are more meaningful than numbers for this abstraction layer.

What we want

Solution

Based on my notes and discussion with Hannah, we agreed car-scope=block|file|all is a better framing:

This is way easier to reason about, no need to read docs, hard to make a mistake, and a better fit for a future IPIP that updates https://specs.ipfs.tech/http-gateways/trustless-gateway/ which we want to do this year.

Transition plan.

Updated plan

lidel commented 1 year ago

Eyeballed metrics on staging, unsurprisingly the file scope is requested the most often:

Screenshot 2023-04-07 at 02-02-48 bifrost-gw staging metrics - Project Rhea - Dashboards - Grafana

lidel commented 1 year ago

We had another round of renames in https://github.com/ipfs/specs/pull/402#issuecomment-1544819745:

  • name changes based on rough consensus. (Juan, Rod, and Adin all suggested removing ambiguity and name dependency on CAR and UnixFS formats, making things more future-proof):
    • car-scope=filedag-scope=entity
    • bytesentity-bytes

Repurposing this issue to align bifrost-gateway implementation with specs.