Closed hannahhoward closed 1 year ago
The full pathing semantics requested for gateway traffic efficiently is at https://www.notion.so/pl-strflt/HTTP-Gateway-Requests-for-Graphs-as-CARs-001d2a9f5a35418bb0fb7d9d182d24ec?pvs=4#096312bc3dc7471cbbea9e97645bf62f
Mostly being done in https://github.com/filecoin-project/lassie/pull/119
Current team understanding/agreement of what we're aiming for (initially at least) for Rhea:
?full
+ none for shallow?depthType=full
+ ?depthType=shallow
(or none, shallow default?)?complete=full
+ ?complete=shallow
(or none, shallow default?)okay to not deal with ranges in this pass. agree it makes sense for that to happen at saturn cache layer if the optimization ends up being important
I opened https://github.com/filecoin-saturn/L1-node/issues/241 for tracking point 6
What
Lassie should support the following semantics for paths, which match the gateway semantics:
This should return a CAR containing the blocks for CID, intermediate CIDs between the CID and the root CID of
file
, and all of the cids that make upfile
.This should return a CAR containing the blocks for CID, intermediate CIDs between the CID and the root CID of
subdir
, and all of the cids that make up the directory tree forsubdir
, but NOT any files or directories associated with subdir (ultimately this means just a single block unless the directory is a HAMT)This should return a CAR containing the blocks for CID, intermediate CIDs between the CID and the root CID of
subdir
, and all of the cids that make up the directory tree forsubdir
, AND any files or directories associated with subdir AND any additional subdirectories recursivelySelector conversion
I believe there is a relatively straight forward conversion between this structure and selectors:
For each segment of the path, I think we need an ExploreInterpretAs with KnownADL "unixfs" followed by an ExploreFields.
At the end of the path, I believe we want an ExploreInterpretAs "unixfs-preload" followed by a "Matcher" selector, except in the case of the
all
query parameter where I believe we can simply use an ExploreRecursiveAll selectorParamater passing
We will need to add either a path & query string to the RetrievalRequest type, or a selector -- it's kind of implementors choice and I'm not sure I have an opinion myself, though early conversion to selector locks us into selector traversal for bitswap (see https://github.com/ipfs/go-fetcher for what this ends up looking like)