-
Notifications
You must be signed in to change notification settings - Fork 58
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: store identity CIDs in CARs for online deals #749
Conversation
5fb90f8
to
c0372f1
Compare
updated this to use the newly released go-car/v2@2.5.0 which has the necessary changes to handle identity CIDs like we want for this |
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.
Just one question, but otherwise LGTM 👍
There is quite a lot of code for handling pieces in provider.go
I wonder if we should move some of it into a separate file?
retrievalmarket/impl/provider.go
Outdated
// for each link, query the dagstore for pieces that contain it | ||
for i, link := range links { | ||
piecesWithThisCid, err := p.dagStore.GetPiecesContainingBlock(link) | ||
if len(piecesWithThisCid) == 0 { |
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.
Is it possible for GetPiecesContainingBlock
to return a zero-length piecesWithThisCid, and for err to also be 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.
Good call, I think it's probably unsafe to not explicitly deal with err
even though I believe zero-length should also ways be coupled with an error (comes out of GetShardsForMultihash
in the inverted index which requires an entry for that CID and an ErrNotFound otherwise). Addressed in #750
069f57e
to
a7c442f
Compare
This becomes considerably simpler with #747 merged, the big changes were in there. Rebased now so there's only two commits left. |
49ff77d
to
f559821
Compare
matches historical precedent, without doing this we get CommP failures where deals are made with intermediate inline CIDs and the client stores them in the CAR used to make CommP. car.SelectiveCar is the historical way of doing this. e.g. https://github.com/filecoin-project/lotus/blob/a843c52e38da13da489cbe6b290ea49b2660b3fb/node/impl/client/client.go#L1405-L1412 Ref: ipld/go-car#332
f559821
to
ee565ed
Compare
Builds on #747 and relies on ipld/go-car#332
This matches historical precedent, without doing this we get CommP failures where
deals are made with intermediate inline CIDs and the client stores them in
the CAR used to make CommP. car.SelectiveCar is the historical way of doing
this.
e.g. https://github.com/filecoin-project/lotus/blob/a843c52e38da13da489cbe6b290ea49b2660b3fb/node/impl/client/client.go#L1405-L1412
More discussion in ipld/go-car#332, and I'll also open a Lotus PR to bring this in and test it there and will link back here from that.