Uh oh!
There was an error while loading. Please reload this page.
Relationship with Protocol Buffers legacy IPFS node format - #59
Conversation
mildred
commented
Jan 7, 2016
What is added: Relationship with Protocol Buffers legacy IPFS node formatIPLD has a known conversion with the legacy Protocol Buffers format. This format is defined with the Protocol Buffers syntax as: The conversion to the IPLD data model must have the following properties:
There are multiple ways to do that that will be described next. Current encoding in go-ipldgo-ipld implements the following conversion: Notes :
Other proposition that does away with escapingWe can imagine another transformation where the link names are not escaped. For example: Notes:
Other encodingsSpeak up in comments if you have other encoding suggestions, or you have another implementation with another encoding. |
There was a problem hiding this comment.
i dont like this one (using .) as much. i prefer the @attrs with escaping
There was a problem hiding this comment.
Even considering there is no escaping?
jbenet
commented
Jan 7, 2016
i think this should go in a separate doc that extends the spec, or as an example of a special case format. we can have it inform (and modify) the proper spec, but i think including this format in the main document will confuse people? we could link to another doc. |
jbenet
commented
Jan 7, 2016
@mildred thanks for this!! 👍 |
mildred
commented
Jan 8, 2016
In case we go the route of escaping, this needs to be linked in other parts of the spec as it has impact on it. |
mildred
commented
Jan 8, 2016
Added considerations about escaping in the path section. See also PR #60 for similar changes. |
the8472
commented
Jan 8, 2016
Based on IRC discussion and reading #60 it seems to me that traversing the IPLD structure should not be shoehorned into IP*S paths. It's more of a reflection / metadata thing for the paths themselves. Equivalent to Putting arbitrary keys at the top level of an associative array (hash) also scratches me the wrong way. The metadata could look like this |
mildred
commented
Jan 10, 2016
Especially considering that unixfs paths are separate from IPLD paths according to last state of PR #62. There is nothing preventing the data to look like this as @the8472 told us: Is there a reason why we couldn't do this way. @jbenet? |
Links needs not to be present at the top level. having them in a separate map removes all complexity of key escaping.
mildred
commented
Jan 10, 2016
Updated the conversion format. |
There was a problem hiding this comment.
I believe I am wrong here. The multicodec header length is not limited to one byte, but can be encoded in multiple bytes if it is above 127. Setting the MSB to 1 is just the way varint works.
I also assumed that protocol buffers always started with a byte with MSB set to 1, but I don't know if that true. Probably not.
So, it's probably not possible to detect in a such easy way if we are transmitting a multicodec header or a protocol buffer message. I'm currently rewriting this part (as I am implementing it in go-ipld).
Fix the paragraph about the first byte that is able to determine if the data in prefixed by a multicodec or is a protocol buffer object.
| The conversion to the IPLD data model must have the following properties: | ||
| - It should be convertible back to protocol buffers, resulting in an identical byte stream (so the hash corresponds). This implies that ordering and duplicate links must be preserved in some way. |
jbenet
commented
Feb 11, 2016
minor things, otherwise LGTM |
mildred
commented
Feb 12, 2016
@jbenet I pushed some fixes, also, what do you think of the ordered-links vs named-links issue ? |
jbenet
commented
Feb 12, 2016
mildred
commented
Feb 12, 2016
@jbenet I removed the named links section and made it an option for the implementations as it is not an important part of the spec. |
jbenet
commented
Feb 12, 2016
SGTM! 👍 thanks |
Relationship with Protocol Buffers legacy IPFS node format
In PR #37, we left out an important part of the spec aside: the relationship with protocol buffer serialization. This ought to be described as it has effects that may be far reaching.
TODO items:
@attrsin one proposition, with@escaping,.in the other proposition): not needed