-
Notifications
You must be signed in to change notification settings - Fork 17
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
HTTP CAR validation #222
HTTP CAR validation #222
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/http #222 +/- ##
=============================================
+ Coverage 70.66% 71.17% +0.51%
=============================================
Files 64 65 +1
Lines 5543 5690 +147
=============================================
+ Hits 3917 4050 +133
- Misses 1413 1422 +9
- Partials 213 218 +5
|
8e426ef
to
bb13ff1
Compare
Promising (cc @olizilla):
and boost iirc:
|
Marking this as ready for review because I fleshed out the tests with what I want to cover, for now. There is one potential blocker though, there's a flake, a test called It could be a flaw in my fixture setup logic, but I'm a little concerned there's deeper stack problems here, maybe with unixfsnode. We also have occasional flakes in the integration tests that could be related, as might #185. I'll spend some more time this week seeing if I can work that out, we could make a call that it's not a blocker because it mostly works and this is a special edge that we won't encounter the majority of the time. Maybe not a P0, but pretty close if this isn't just bad test data. |
|
pkg/retriever/httpretriever.go
Outdated
if !t.first { | ||
t.first = true | ||
t.cb() | ||
} |
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.
this will file too early, right? you want the cb()
to fire after t.r.Read()
has returned, but before you return from this method, i think
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.
I agree with @willscott here. Read will get called almost immediately.
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.
if !t.first { | |
t.first = true | |
t.cb() | |
} | |
if !t.first { | |
t.first = true | |
defer t.cb() | |
} |
this should be a reasonable fix, 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.
Suggested refactor in #226
Also I think @willscott 's first byte concern is pertinent.
data []byte | ||
} | ||
|
||
func visitNoop(p traversal.Progress, n datamodel.Node, r traversal.VisitReason) error { return nil } |
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.
love this part of ipld prime :)
pkg/retriever/httpretriever.go
Outdated
if !t.first { | ||
t.first = true | ||
t.cb() | ||
} |
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.
I agree with @willscott here. Read will get called almost immediately.
Co-authored-by: Rod Vagg <rod@vagg.org>
Fixed the flaky test(s), it was indeed test data, in two ways. There's enough random chance that you end up with a directory structure of a particular form that it fails. One of the biggest no-nos that I built in to the fixture generation was having the in-memory representation of a directory structure (the Good to go now I think! |
* feat(verifiedcar): initial verifiedcar package * feat(verifiedcar): verify http retrievals * chore(verifiedcar): tests for basic error cases * fix(verifiedcar): coverage of more cases, handle known edges properly * fix(verifiedcar): remove extraneous go-routine (#226) Co-authored-by: Rod Vagg <rod@vagg.org> * fix(verifiedcar): address feedback * fix(verifiedcar): fix flaky tests --------- Co-authored-by: Hannah Howard <hannah@hannahhoward.net>
* First pass at adapting graphsync to http * fix(http): gracefully handle selector vs path requests * feat(http): extend graphsyncretriever so it can also do http * feat(http): refactor http & graphsync specific pieces to "TransportProtocol" iface * feat(prioritywaitqueue): add InitialPauseDone inspector * feat(http): single peer http retrieval unit test * fix(http): enable http everywhere gs & bs are * chore(http): framework for suite of http unit tests based on bitswap unit test framework * feat(http): remove parallel-request flow, make all serial for now * too-detailed http testing, will remove this in favour of graphsync style testing. * fix(http): better testing framework * fix(http): more test coverage, minor fixes * fix(http): clean up time handling in tests * HTTP CAR validation (#222) * feat(verifiedcar): initial verifiedcar package * feat(verifiedcar): verify http retrievals * chore(verifiedcar): tests for basic error cases * fix(verifiedcar): coverage of more cases, handle known edges properly * fix(verifiedcar): remove extraneous go-routine (#226) Co-authored-by: Rod Vagg <rod@vagg.org> * fix(verifiedcar): address feedback * fix(verifiedcar): fix flaky tests --------- Co-authored-by: Hannah Howard <hannah@hannahhoward.net> * fix(http): refactor MockRoundTripper (#229) * Add HTTP integegration tests (#227) * test: add itests for http * test: add peer http server, minor refactors and fixes * fix(itest): fix compile errors on rebase --------- Co-authored-by: Rod Vagg <rod@vagg.org> Co-authored-by: Hannah Howard <hannah@hannahhoward.net> Co-authored-by: Kyle Huntsman <3432646+kylehuntsman@users.noreply.github.com>
This is pretty close to final. It needs better test coverage for all the failure cases, but you can already see the failure adjustments in httpretriever_test.go to adapt to the new strictness.
Potentially pending further discussion @ ipfs/specs#402 (CARv1/CARv2, roots, etc. isn't resolved).
We discussed what to do with this after we get it right. I think it should either go into go-car (
v2/verified
?) or in a separate module (ipld/go-verifiedcar
?). I think it feels pretty CAR-focused so am leaning toward the former for now.There may be additional details. We could also consider putting the
CarScope
types into this package and the selector derivation stuff that's currently inRetrievalRequest#GetSelector
, because that's going to be common across users of this code.