-
Notifications
You must be signed in to change notification settings - Fork 18
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: various traversal and verifier fixes #338
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
==========================================
+ Coverage 75.94% 76.37% +0.42%
==========================================
Files 85 85
Lines 6323 6378 +55
==========================================
+ Hits 4802 4871 +69
+ Misses 1248 1239 -9
+ Partials 273 268 -5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks reasonable. Couple suggestions. Curious why we can ignore context cancelled in the error func.
pkg/verifiedcar/verifiedcar.go
Outdated
} | ||
} | ||
|
||
func (nbro *NextBlockReadOpener) StorageReadOpener(lc linking.LinkContext, l datamodel.Link) (io.Reader, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: make an internal function that just loads the block, wrap inside this function that just adds to count & sets the error if present. Will remove some repeated sets of the error and I think simplify
pkg/verifiedcar/verifiedcar.go
Outdated
// make sure we don't have any extraneous data beyond what the traversal needs | ||
_, err = cbr.Next() | ||
if !errors.Is(err, io.EOF) { | ||
if ctx.Err() == nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.EOF) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we also need to return a seperate error for context cancelled? it's not a success no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking this LGTM but I'll leave merge up to you so you can address suggestions if you want.
6ab45e5
to
0958b2b
Compare
I've reworked that A few other tweaks. PTAL @hannahhoward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thumbs up on refactor, good strategy. I like this.
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
0958b2b
to
59c5880
Compare
Closes: #336
The flaky one is really interesting, it became more flaky once we started properly and consistently reporting errors from the traversal, then it would flip between two error types. The fix was to ensure that the fixture data had a particular shape because certain forms produce certain errors. Fun fun.