-
Notifications
You must be signed in to change notification settings - Fork 36
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
Missing support for Filecoin codecs #64
Comments
@mikeal ^^ this goes to the previously discussed question "where do PL-provided tools stop". One could |
So, some context is important here re Filecoin, sorry for some of the weeds here, will try and get to the big picture: CIDs with Sectors in Filecoin are just a bunch of "pieces" together filling out whatever sector size is being used (64Gb?), and because they all form a binary merkle tree together, the tip of that sector of unsealed data also ends up having a CID with Then we have sealed data, "CommR" (replica commitment), which comes out as So the CIDs with these If anyone reading this wants more gory details on this you can read the discussion at multiformats/multicodec#161 and multiformats/multicodec#172 and the other issues linked from there. ImplicationsSo what to do with these codecs in the IPLD explorer? I don't think there's too much we can do for now with them other than simply say what they are: "Filecoin Unsealed Commitment" and "Filecoin Sealed Commitment". Perhaps there will be (or is?) an API to query a miner or client about these at some point to get more information that we could display, but we can't derive anything very interesting from them on their own. I think we're still yet to see exactly how these CIDs will be thrown around publicly, if at all. Perhaps @travisperson could suggest whether there's interesting information to be queried and then we could figure out if we want to go to the trouble of building "query a miner" functionality into the IPLD explorer. Filecoin chain dataSo the other question that's related is the Filecoin chain data, like https://explore.ipld.io/#/explore/bafy2bzaceb72fu7v56lsi2l45624kgag4cw2shnbweiqndv47p7tgaw5rqox2 that @travisperson shared.
The Filecoin chain is all in DAG-CBOR, so the explorer can read it natively as it is. But without additional context it's difficult to know whether this information is from Filecoin or just some random thing that someone put into IPFS, it's just @olizilla says that we're already doing some funky shape-checking for DAG-PB nodes, so that raises the possibility that we could do the same with DAG-CBOR. We happen to have been building a tool just for this kind of purpose: IPLD Schemas. One of the strict goals of IPLD Schemas is that they be fast to validate, the kind of fast that you'd want if you were using them for a protocol, "does this chunk of data match without needing anything other than the schema and data?". So they have nothing that requires that links be followed, we have no dependent types or logic, just shape information (and some hints about what you're likely to find if you follow a link, but they are advisory). There's some discussion in filecoin-project/specs#998 about bringing back IPLD Schemas to the Filecoin specs (there was a form of IPLD Schemas in an earlier iteration of these docs but it was ditched for plain Go structs). If we had all the schemas for the various blocks we could build a library in the IPLD Explorer and do quick validation as DAG-CBOR blocks are loaded to check whether they match the right shape or not. Of course there's a risk that a shape happens to also match someone else's data so we'd want to be careful about including ones that are too generic. Hopefully there are enough cases for the more complex blocks in the chain (🤞 the headers at least) that we could say with some high probability "this is a chunk of the Filecoin chain". If we also had a client, or a catalogue of the chain we may even be able to cross-reference and get information about where in the chain it is (height isn't encoded). I started work on a validator with the JS IPLD Schema library but didn't get far enough for it to be useful. @mikeal made one too but I don't think it's complete enough to be useful yet either. But this might be the perfect use-case to get it all wired up and working, as long as we can get some solid IPLD Schemas written for Filecoin chain blocks. |
Fwiw commD/commR show up in the status of a sector
And commP of course shows up in deals:
|
Thank you for the context @rvagg and @ribasushi ! Namely, I agree with:
@jessicaschilling @rafaelramalho19 In situation where we are unable to traverse the DAG atm (like for codecs mentioned above), we could add a second, simpler visualization mode, where instead of object explorer and DAG visualization there is just human-readable name, maybe a one-paragraph description and clickable link to learn more. If we do that, there should be a static map where people can PR name+url mapping for custom codecs. That way people are pointed at codec-specific explorer such as , decreasing the scope of what we need to support in IPLD Explorer while also making it more useful to users. Thoughts? |
@lidel If I follow correctly, something like this? |
@jessicaschilling Yes, exactly what I had in mind! 👌 @rvagg @ribasushi |
@lidel honestly the best doc I've seen about this is https://proto.school/verifying-storage-on-filecoin/03 |
Quick note on color - for sealed commitments let's use official Filecoin blue #0090FF, for unsealed #39C1CB (the light stop on the official gradient; at present there's no secondary colors in the Filecoin brand guide). |
@ribasushi Are you still able to provide a replacement for that lipsum text? 😊 Thanks! |
ps - fwiw in the sketch above, I was reading "Filecoin explorer" as going to the filscout.io page @lidel linked to in his comment earlier. |
Problem
Even when we update to latest
cids
library, when user enters a CID with Filecoin-related codec, they get error becauseipld-filecoin
decoder does not exist:Test CIDs from multiformats/multihash#129 (comment):
Solution
IPLD Explorer already supports Bitcoin and Ethereum (but we dont provide examples – see #62):
I believe IPLD Explorer (included in IPFS WebUI/Desktop and on https://explore.ipld.io) should support Filecoin CIDs .. somehow. Even if it's one sentence with a link to Filecoin-specific tool.
Ref. https://specs.ipld.io/data-structures/filecoin/
@ribasushi @vmx @rvagg – were there any prior/ongoing discussions regarding creating
ipld-filecoin
?The text was updated successfully, but these errors were encountered: