-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
go-path integrated #8028
go-path integrated #8028
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
008d8b6
to
3dfe47d
Compare
case "ipld": | ||
resolveOnce = resolver.ResolveSingle | ||
default: | ||
if ipath.Segments()[0] != "ipfs" && ipath.Segments()[0] != "ipld" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: It would be nice if there were some const
values for the segment indexes. If those do not already exist, that probably better in a separate future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look OK to me. However, given the test failures it appears that sharded directory handling and a few other things are a problem. I do not know if that is something missing from this PR or needs to be fixed in a different PR.
@hannahhoward - confirming this isn't 'in draft' and we should finalize review of use of unixfsnode and then merge this to target merge branch? |
License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
9f3e725
to
a56fbf3
Compare
License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
1e58905
to
e3211c0
Compare
There's a sharness test failing, is this a known issue and are the deps here up to date? |
core/coreapi/path.go
Outdated
r := resolver.NewBasicResolver(api.blocks) | ||
r.FetchConfig.NodeReifier = unixfsnode.Reify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is no big deal, but this seems to exactly match the Resolve function declared in core/node/core.go.
Was there a dependency issue or are we just copying the code bc it's only two lines?
fuse/readonly/readonly_unix.go
Outdated
@@ -6,20 +6,21 @@ package readonly | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/ipfs/go-cid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's group the dependencies here and have separate groupings for builtins, fuse, ipfs+ipld
// convert ipld-prime node to universal node | ||
blk, err := s.Ipfs.Blockstore.Get(cidLnk.Cid) | ||
if err != nil { | ||
log.Debugf("fuse failed to retrieve block: %v: %s", cidLnk, err) | ||
return nil, fuse.ENOENT | ||
} | ||
|
||
var fnd ipld.Node | ||
switch cidLnk.Cid.Prefix().Codec { | ||
case cid.DagProtobuf: | ||
fnd, err = mdag.ProtoNodeConverter(blk, nd) | ||
case cid.Raw: | ||
fnd, err = mdag.RawNodeConverter(blk, nd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems confusing/bad in that it'll result in multiple blockstore fetches for the same data. Perhaps if the underlying datastore has caching this doesn't end up being so bad since we likely just fetched the data, but if this is a recurring pattern in the associated set of PRs here then we might need to make some changes.
I added some comments in the go-merkledag PR ipfs/go-merkledag#67
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aschmahmann I don't actually see those :( Can you point me to them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe you need to submit review or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of the more general question -- it's a bit tricky. In IPLD Prime land, we don't always have a block to go with a node, cause nodes don't always match block boundaries. In a future pure IPLD Prime world, this isn't a problem -- we wouldn't load the block here, cause we wouldn't try to produce a legacy merkledag node, cause UnixFS would already work with prime nodes natively. However to convert back to legacy node, we have to do this. Hopefully, it's just a temporary step till we make more progress on go-ipld-prime conversion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of my comments seem to have disappeared, but this is the one I was thinking of ipfs/go-merkledag#67 (comment)
return nil, fuse.ENOENT | ||
} | ||
if err != nil { | ||
log.Error("could not convert protobuf node") | ||
return nil, fuse.ENOENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we switch these from fuse.ENOTSUP
to fuse.ENOENT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a great question -- I didn't actually write this bit of code here (Alex C did but he's not working on PL stuff any more). Seems odd. I can change it back.
core/node/core.go
Outdated
rs := resolver.NewBasicResolver(bs) | ||
rs.FetchConfig.NodeReifier = unixfsnode.Reify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern of initialization seems a little weird. I'll make some comments as I get to that part of the stack when reviewing 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I think we should have a FetchConfig top level dependency in the DI stack, and pass it to NewBasicResolver rather than the block service. I think I've said this elsewhere as well.
cidLnk, ok := ndLnk.(cidlink.Link) | ||
if !ok { | ||
log.Debugf("non-cidlink returned from ResolvePath: %v", ndLnk) | ||
return nil, fuse.ENOENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fuse.ENOSUP
might be more appropriate here. The thing exists we just don't know what to do with it.
License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
License: MIT Signed-off-by: hannahhoward <hannah@hannahhoward.net>
Add fetcher config top level dependency
Motivation
We are integrating ipld-prime into IPFS starting with many of its dependencies. go-path has now been converted. This PR updates go-path to the ipld-prime (linksystem) version and makes a few modifications to accommodate that upgrade.
This PR depends on branches that are also in peer review and should not be merged until those upstream changes have been accepted, tag, and the dependencies in this PR are updated