-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: return error on LookupBySegment failure #524
base: master
Are you sure you want to change the base?
Conversation
The problem here exists in the nuance between "I don't have that field" (jedi hand-wave) and "I have the field but there was an error loading it". We do have a mechanism for slicing this salami though, We could tackle this by doing an error inheritance, or custom |
@rvagg rather than try to ignore the errors when it's not a "loading error", I think what we want is to capture the specific errors that come from loading errors. I think that means wrapping the errors in go-ipld-prime/traversal/walk.go Line 421 in bc536b3
|
|
Some next steps here after a brief discussion:
Hannah says that graphsync already does something like (1) above and should be aware of bad blocks in a DAG already, regardless of what the traversal does. That means the blast radius of this problem is less than it might otherwise be. |
* don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Workaround in lassie for the two main traversal executions: filecoin-project/lassie#338 - watch for load errors on the linksystem and check for them after we've got no errors from the traversal. |
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Closes: #336 * don't treat context cancellation as an ErrExtraneousBlock in the CAR verifier * capture and properly handle block load errors that are missed by the go-ipld-prime traverser, ref: ipld/go-ipld-prime#524 * fix flaky case(s) in verifiedcar test suite where multi-level sharded directory is assumed but only a single block dir is produced
Not quite sure what to do with this yet. This probably isn't the "fix", but I need to get this up before I forget the details of how I landed here.
Testing out selectors for our Trusted Gateway walks, I happen to have a DAG where I know it's incomplete—the wikipedia
/wiki/
directory in fact, I don't have many of the pages and I'm expecting an error to be propagated out of the traversal through the sharded directory where it finds it can't load a block. The error occurs in go-unixfsnode/hamt/shardeddir.go'sLookupBySegment()
, and it's a not-found error from the blockstore, but it gets to here and there's acontinue
. i.e. the selector has an interest in this path segment, but it doesn't happen to be in the node in question.So, our current Trusted Gateway validator (in Lassie) doesn't even reject the malformed DAG because of this. Where I expect a 5 block DAG, but give it a 3, it'll still pass as if everything's fine.
This goes back to the code that started using
Interests()
here: 31c9bb7And it kind of aligns with the stated intention of
Interests()
as a hint, rather than a directive that it must be explored:go-ipld-prime/traversal/selector/selector.go
Lines 39 to 51 in f9fb3bd