-
Notifications
You must be signed in to change notification settings - Fork 108
Spec refining: Support of IPLD pointers as links #3
Comments
I am 👍 on adding this to the libraries and making it explicit in the spec. |
|
|
Perfect, it sounds like we are approving this! 🎉 I have called them pointers to have a consistent wording in this issue (I am trying to use this new term). The way I am seeing it is that a path is from after the CID onwards (I treat the CID like a sort of origin). Path is still a valid (and preferred name) |
We've used structures like "/ipfs//a/b/c" as IPFS Paths for a long I do not think we gain much from IPLD Pointers vs the existing notion of Every name we add causes friction and baggage for newcomers. Since they're
|
🎉 Let's call them IPLD paths then, I will update the rest of my writings soon |
Will this allow paths to traverse multiple objects? I.e. is this object valid:
This would add a lot of complexity because each of the path components could potentially also resolve multiple other objects. So essentially, path resolving is no longer a constant-time operation but may resolve a potentially infinite number of objects. So I think only links in their canonical format should be allowed within objects:
|
Hey, thanks for chipping in!
it would not be infinite (it can't!) I do see your concern in making IPLD slightly more complex than just pointing to simple hashes (or hashes + path of the attribute the hash itself) so avoiding having a path that works across object. However, I don't see why this could be a problem. The IPLD should abstract away the resolving of a hash, in that particular case, we'll need to resolve two hashes. However, I guess it would be equivalent to link to a hash that links to another hash and do the hop yourself. A great idea I had from thinking about this is that we could layer up different IPLD.
One of the purpose of the IPLD path was originally IPLD-level-2, imagine having a merkle tree, and we want to point to the first leaf, then I could just do hash/left/left. It would not be possible without level-2 to do this type of pointing. Although it is great to have this type of layers in mind, I think it would be rather complex to distinguish amongst them and the parsers are just slightly more complex, that it would be trivial. In this case however, we turn resolving into O(n) n being the number of hops across objects, however, if that is the amount of hops, there is little we can do (so, maybe for time-critical application it might be a great idea to structure your data as in IPLD-level-0/1) cc @jbenet |
Not in the matematical sense, but a simple-looking path like Example:
|
Thanks for noting this. However: Resolvers could have a resolution max. Nothing prevents infinite This is an implementation detail that's subject to the times. In 20 years, Also note that we could have a "resolve paths" operation that transforms a
|
So, someone has brought the fact that we haven't fixed this up and we really should. However, we'll have to decide how to encode these in CBOR. Option 1: Just append it. That is, we could just have @diasdavid ^^ |
👍 I vote for this one |
I’m trying to mentally rebase this against the current stack and I’m running into some problems.
I’m also lacking clarity on what the use case here is. I’m just not aware of any particular use case this solves or aware of any place where we can’t do something because we don’t have this. TBH, this throws a wrench in most of what we’ve built and the direction we’ve taken so I’m inclined to close it for now and return to the concept much later when we tackle some form of “mutable links.” |
I believe this is the same as #83.
I assume we'd just replace the
No.
Data model, I assume. We can resolve non-datamodel links when serializing the DAG. |
See, this sort of requires us to tear up everything we’ve build recently. We’ve already built quite a bit on top of the Data Model, so changing it now has much broader implications. And if this path stretches multiple blocks then it’s a much better fit for the Schema layer anyway. We could create a “Link Type” at the Schema layer that is much more flexible and could accomplish this as well as open the door for extensions down the road for IPNS based links. There’s actually a long list of “more things we need to be able to do with links,” similar to our long list of collections people need, so it’s probably better to do what we did with Maps and split between the simple “kind” that is in the Data Model and the “type” which is extensible and at the Schema layer. This would also make the implementations easier, since we would only need to implement these once in schemas rather than for every codec that supports the data model. |
It shouldn't make much of a difference at all. The issue is that "links" can currently only point to blocks. This issue is about allowing those links to point to nodes. This already came up: https://github.com/ipld/specs/blob/master/REQUIREMENTS.md#linked. |
Perhaps in your conceptual model this doesn’t break anything, but in the actual code we’ve written most things break. Just one example: every IPLD codec in JS returns instances of The number of assumptions in code that depends on current libraries that assume a “Link === CID” are also quite large. AFAIK every piece of code that even handles links makes this assumption. Changing the link kind definition is a substantial breaking change, even just adding this as another kind in the data model is a substantial amount of new code we’d have to write throughout the stack. By comparison, doing a Link Type in schemas can be done without breaking anything. Even if we had far more code written and dependent on schemas we would be able to add the type without breaking anything. And most importantly, we don’t need to get everything perfect in the first implementation because iterating in the Schema Layer is 100x easier than at the Data Model layer.
Nobody is arguing that this should not be supported, we just don’t want to support it at the Data Model layer for all the reasons we’ve already mentioned. |
I'm aware this is hard, but this is absolutely critical. The alternative is:
But that seems like even more work. |
I’ve got an early implementation of the multi-block type system which can support this. I should have a demo ready in a few days. We expect most people to “live” in this layer anyway, so implementing this above the data model should be fine. The reality is, any non-trivial use cases require features we just don’t have with only the data model, so user facing abstractions will always be a layer up.
My assumption has always been that once we actually write a spec for this that it would be for Layer 2 paths. Not just for use cases like (Link + Path) but so that it can support HAMT and other multi-block collections. Given that |
Closing due to staleness as per team agreement to clean up the issue tracker a bit (ipld/team-mgmt#28). This doesn't mean this issue is off the table entirely, it's just not on the current active stack but may be revisited in the near future. If you feel there is something pertinent here, please speak up, reopen, or open a new issue. [/boilerplate] |
I define the following terms:
IPLD pointers (HASH/path):
HASH
/friends/0/name
)IPLD links:
{'/': HASH}
As far as I remember, current implementations only support links that have hash pointers, however, IPLD links should support full IPLD pointers. So that these things can happen:
cc @jbenet, @mildred, @dignifiedquire
The text was updated successfully, but these errors were encountered: