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

What if you can't derefence a CID? #142

Closed
Tracked by #132
bumblefudge opened this issue Jan 20, 2023 · 4 comments
Closed
Tracked by #132

What if you can't derefence a CID? #142

bumblefudge opened this issue Jan 20, 2023 · 4 comments

Comments

@bumblefudge
Copy link

One thing that I couldn't quite figure out on slow readthrough was what happens if CIDs aren't resolved/fetchable? what happens if the CID value in prf resolves to something other than the proof? I assume the whole invocation is invalid if any proof it relies on can't be fetched or if anything in the graph is malformed, but maybe making more explicit if an invocation that has an invalid link in its chain is different from an invocation with a malformed link in its chain and from an invocation with an expired link in its chain CAN be or MUST be treated differently, and if conforming implementations need to give different error messages in those three cases, etc?

@matheus23
Copy link
Member

I assume the whole invocation is invalid if any proof it relies on can't be fetched or if anything in the graph is malformed

That's a really good question. I think implementations don't handle this consistently.
In general, if there's some "path" through the DAG of UCAN delegations with valid attenuations, signatures, valid issuers and audiences, etc. then the invocation should be valid.

This is so that UCAN invocation checking can short-circuit once it found one way to "realize" the final capability needed.

If the whole UCAN DAG had to be valid, then you would have to fetch the whole DAG to check its correctness to be sure you didn't miss any incorrect formatting that would make the whole invocation fail.

I also agree that this should perhaps be added to the spec.

@bumblefudge
Copy link
Author

feel free to tag me for review when someone PRs in an "error handling" section and/or does an editorial pass to make these codepaths/logic points more explicit throughout the spec! i don't watch this repo as closely as I should

@expede
Copy link
Member

expede commented Mar 20, 2023

Good point @bumblefudge!

Now clarified in 0.10 PR. TL;DR if you can't dereference the CID, you can't prove your chain, and validation fails. You need to make sure that the validator has the requestite subgraph. There are many mechanisms for this, and it's left to the specific transport spec (e.g. UCAN-over-HTTP, IPFS UCAN, etc)

@expede expede mentioned this issue Mar 20, 2023
15 tasks
@expede expede changed the title Would it help to make failure states and/or error handling explicit and/or normative? What if you can't derefence a CID? Mar 20, 2023
@expede
Copy link
Member

expede commented Jul 12, 2023

Closed by #132

@expede expede closed this as completed Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants