generated from ipfs/ipfs-repository-template
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
Rename ?format=car URL params to match IPIP-402 #80
Comments
lidel
added a commit
that referenced
this issue
Apr 6, 2023
This adds support for 'car-scope' URL param next to existing 'depth' to allow Saturn L1/Lassie to migrake without breaking anything during the transition. Context: #80
Merged
lidel
added a commit
that referenced
this issue
Apr 6, 2023
This adds support for 'car-scope' URL parameter next to existing 'depth' to allow Saturn L1/Lassie to migrate without breaking anything during the transition. Context: #80
lidel
changed the title
Replace
Rename BRAPH_BACKEND URL params to match IPIP-402
May 15, 2023
depth
with car-scope
parameter
We had another round of renames in ipfs/specs#402 (comment):
Repurposing this issue to align bifrost-gateway implementation with specs. |
lidel
changed the title
Rename BRAPH_BACKEND URL params to match IPIP-402
Rename ?format=car URL params to match IPIP-402
May 16, 2023
lidel
added a commit
that referenced
this issue
Jun 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
depth=0
depth=1
depth=2
makes sense only for directories and DAGs built out of IPLD things like DAG-JSON/CBOR documents (but we don't use this for Rhea nor need for gateway atm).I agree, we ended up with three states:
0
- blocks for path + only the root block for terminal CIDIPFSBackend.GetBlock
and forIPFSBackend.ResolvePath
1
- blocks for path + all blocks for a file, or a minimal set of blocks to enumerate directory or HAMTIPFSBackend.Get
requests, as we don't want to over-fetch directories, and we don't know which path ends with a dirall
- blocks for path + all blocks for entire DAGIPFSBackend.GetAll
)and CAR (IPFSBackend.GetCAR
) responses, but this is also the implicit default for?format=car
, so we don't really need this.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:depth=0
→car-scope=block
depth=1
→car-scope=file
(non-files, like directories, and IPLD Maps only return blocks necessary for their enumeration)file
here to make more sense to non-PL user. "file" is a synonym for "the blocks needed to interact with the ADL in the transformed view", and the pathing on/ipfs/
defines the implicit ADLs to use.depth=all
→car-scope=all
(implicit default whencar-scope
is unset, send everything)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.
bifrost-gateway
starts sending requests with bothdepth
andcar-scope
car-scope
to lassie Implement depth=0 for CAR requests filecoin-saturn/L1-node#323 (comment)car-scope
→ update lassie v0.8.1 filecoin-saturn/L1-node#324car-scope=block
→ https://github.com/filecoin-saturn/L1-node/pull/324/files#r1160386359biforst-gateway
stops sendingdepth
(chore: remove unused CAR URL params #144)car-scope
→ IPIP-402: Partial CAR Support on Trustless Gateways specs#402 (comment)Updated plan
bifrost-gateway
starts sending requests withdepth
,car-scope
anddag-scope
AND bothbytes
andentity-bytes
as noted in IPIP-402 – refactor: use IPIP-402 param names when GRAPH_BACKEND=true #108The text was updated successfully, but these errors were encountered: