Skip to content
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

resolve: use unixfs ResolveOnce #5484

Merged
merged 4 commits into from
Sep 19, 2018
Merged

resolve: use unixfs ResolveOnce #5484

merged 4 commits into from
Sep 19, 2018

Conversation

magik6k
Copy link
Member

@magik6k magik6k commented Sep 17, 2018

(This is assuming we want to make ipfs resolve operate on unixfs paths instead of ipld)

Fixes #5270 (comment)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@ghost ghost assigned magik6k Sep 17, 2018
@ghost ghost added the status/in-progress In progress label Sep 17, 2018
@Stebalien
Copy link
Member

Can we switch to to the CoreAPI? It should select the correct resolver based on the namespace.

@magik6k
Copy link
Member Author

magik6k commented Sep 18, 2018

Good point, I'll see how that works

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@magik6k
Copy link
Member Author

magik6k commented Sep 18, 2018

Done

@magik6k magik6k added the topic/core-api Topic core-api label Sep 18, 2018
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look good but I'd like to consider a few API options before we go with this.

// DhtRecordCount is an option for Name.Resolve which specifies how many records
// we want to validate before selecting the best one (newest). Note that setting
// this value too low will have security implications
func (nameOpts) DhtRecordCount(rc int) NameResolveOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have DHT specific options like this or a more general purpose way to pass routing options (that is, go-libp2p-routing/options.Option). That is:

func RoutingOption(r ropts.Option) NameResolveOption ...

Or is this leaking too much into this API?

My worry here is adding a ton of special-purpose options for each router we may implement.

Local: false,
Cache: true,

DhtRecordCount: 16,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should hard-code this. Can we use the value from the DHT (unless we go with the "resolve options" solution in which case this point is moot).

@Stebalien
Copy link
Member

Note: I'm fine keeping this as it is, I'd just like to consider a more generalized solution to adding more and more API options.

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@Stebalien Stebalien merged commit 370bd22 into master Sep 19, 2018
@ghost ghost removed the status/in-progress In progress label Sep 19, 2018
@Stebalien Stebalien deleted the fix/resolve-hamt branch September 19, 2018 18:43
@Stebalien
Copy link
Member

@magik6k This is wonderful. These issues have been plaguing us for ages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/core-api Topic core-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolving links in sharded directories does not seem to work
2 participants