-
Notifications
You must be signed in to change notification settings - Fork 11
Eth blocks missing IPLD links #25
Comments
Seems like part of the problem is that the CBOR resolver returns an IPLD-friendly representation when you call its …but here in js-ipld-ethereum/util/createUtil.js Lines 6 to 8 in 0e4e0be
…and the transformation to an IPLD-friendly representation only happens during path traversal when reading into the object. Actual mapping: js-ipld-ethereum/eth-block/index.js Lines 9 to 32 in 0e4e0be
Where it’s called during traversal ( js-ipld-ethereum/util/createResolver.js Lines 59 to 74 in 0e4e0be
So that means what you get with It seems like this library would have to be restructured in a pretty big way to change that so |
(Also, apologies if any of the above was just restating the obvious for folks here. I was surprised that a JS |
That is super useful info for me @Mr0grog ! |
Minor update: it looks like the So the disconnect between those exists in the resolvers for Ethereum, Bitcoin, and ZCash, but not in PB, CBOR, and Git. |
Thanks @olizilla and @Mr0grog for digging into this. It should indeed return a proper link. Please note that what "proper link" means is currently in flux. @mikeal come up with the idea of making the resolvers return JavaScript Objects and not JSON, i.e. it won't be Update: Reference to the CID discussions: ipld/ipld#44 |
See also ipld/js-ipld#141, based on follow-on discussions about this on Friday, 2018-08-03. |
OK, to bring this around to concrete, actionable issues, IPLD Explorer is actually doing the right thing here, but there are several bugs in js-ipld and the various resolver modules:
@olizilla all that adds up to:
@vmx should we treat this issue as a tracking bug for this module’s side of ipld/interface-ipld-format#34 or should we close it? |
I'm happy to leave this issue open until the IPLD side (most notable ipld/interface-ipld-format#34) is fixed. |
When we transform Eth blocks to objects, it's links aren't expanded out to
'/': Buffer
style IPLD links, they are just properties that point to Buffers, so when they are run through the IPLD explorer, it can't show any of their linked nodes.Currently:
If the IPLD stucture was the same as that suggested here in
go-ipld-eth
https://github.com/ipfs/go-ipld-eth/blob/4199044661a07667f13ec1ca4d228b3741b75b09/plugin/README.md#usage-and-examples...where the props are expanded out to IPLD links, we get all the auto linking magic for free
The text was updated successfully, but these errors were encountered: