-
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 CAR and padding for piece data #27
Conversation
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.
See comment about how OnDealComplete is called.
Otherwise LGTM
@@ -153,6 +169,7 @@ func (p *Provider) staged(ctx context.Context, deal MinerDeal) (func(*MinerDeal) | |||
|
|||
return func(deal *MinerDeal) { | |||
deal.SectorID = sectorID | |||
deal.PiecePath = file.Path() |
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 believe (could be wrong) that in order for this to work, PiecePath also needs to be passed into OnDealComplete
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.
Also also, I forgot that OnDealComplete has a third parameter for the piece path, and given that, I wonder if we need to retain it in the miner deal. (this part is non-blocking, the above is blocking)
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.
Also, also, also, you should check with @laser, but I believe the miner implementation is not gonna be able to return us the SectorID, and we have an alternate mechanism for that, and, we should probably change that signature (though, no need to do that just yet)
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.
Oh yeah, this makes sense. I think we do need to store the piece path between deal states, as (upcoming) we will have a few states between writing the piece to the FileStore and when we call OnDealComplete()
.
Codecov Report
@@ Coverage Diff @@
## master #27 +/- ##
==========================================
- Coverage 14.7% 14.62% -0.07%
==========================================
Files 26 26
Lines 1756 1765 +9
==========================================
Hits 258 258
- Misses 1448 1457 +9
Partials 50 50
Continue to review full report at Codecov.
|
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.
Looks like this needs a rebase on master but LGTM whenever that happens.
Summary
The Provider now writes out a padded CAR file of the graph fetched from the client. It uses this file to calculate
CommP
and verify that it matches theCommP
in the proposal. It then saves the path to this file in theMinerDeal
, so the node can pass this information on to the mining/binpacking module.Resolves https://github.com/filecoin-project/go-storage-market/issues/15