-
Notifications
You must be signed in to change notification settings - Fork 59
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
use PieceCID if provided in QueryParams #181
Conversation
Codecov Report
@@ Coverage Diff @@
## master #181 +/- ##
==========================================
+ Coverage 68.61% 68.62% +0.01%
==========================================
Files 37 37
Lines 1991 1998 +7
==========================================
+ Hits 1366 1371 +5
- Misses 528 529 +1
- Partials 97 98 +1
Continue to review full report at Codecov.
|
} | ||
lastErr = err | ||
} | ||
if lastErr == 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.
this happens if a payloadCID was found but pieceCID wasn't
@@ -277,7 +285,7 @@ func (p *provider) NextBlock(ctx context.Context, id retrievalmarket.ProviderDea | |||
} | |||
|
|||
func (p *provider) GetPieceSize(c cid.Cid) (uint64, error) { | |||
pieceInfo, err := getPieceInfoFromCid(p.pieceStore, c) | |||
pieceInfo, err := getPieceInfoFromCid(p.pieceStore, c, cid.Undef) |
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 is called by provider_states.ReceiveDeal, and DealProposal doesn't know anything about individual PieceCIDs. I'm assuming that client proposing a deal will always do a Query with the PieceCID first so unless PieceCID is added to DealProposal, we assume client has already determined the provider has what they want.
Status QueryResponseStatus | ||
//PayloadCIDFound QueryItemStatus // V1 - if a PayloadCid was requested, the result | ||
Status QueryResponseStatus | ||
PieceCIDFound QueryItemStatus // V1 - if a PieceCID was requested, the result |
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 seemed to be a typo/leftover from the old version when Piece/Payload CID weren't distinct
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.
originally PayloadCIDs were optional while PieceCIDs weren't. But this is still correct :)
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.
ah, right that was it.
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.
Please regenerate CBOR for the project, then fix the failing tests that appear when it is.
I think you will find that PieceCID will have to be a pointer cause cid.Undef does not serialize with cbor-gen.
Status QueryResponseStatus | ||
//PayloadCIDFound QueryItemStatus // V1 - if a PayloadCid was requested, the result | ||
Status QueryResponseStatus | ||
PieceCIDFound QueryItemStatus // V1 - if a PieceCID was requested, the result |
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.
originally PayloadCIDs were optional while PieceCIDs weren't. But this is still correct :)
1f76f9b
to
6da0933
Compare
6da0933
to
fb7c8ae
Compare
Closes #180
If QueryParams provides a PieceCID, use it and return whether the item is available.