Skip to content
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

price specification by user should match what miner has in their ask #491

Merged
merged 1 commit into from
Feb 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion storagemarket/impl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ func (c *Client) ProposeStorageDeal(ctx context.Context, params storagemarket.Pr
return nil, xerrors.Errorf("computing commP failed: %w", err)
}

pricePerEpoch := big.Mul(big.NewInt(int64(pieceSize.Padded())), params.Price)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure params.Price is per GB here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on how this gets into the actors proposal object, i don't think it is.


if uint64(pieceSize.Padded()) > params.Info.SectorSize {
return nil, fmt.Errorf("cannot propose a deal whose piece size (%d) is greater than sector size (%d)", pieceSize.Padded(), params.Info.SectorSize)
}
Expand All @@ -363,7 +365,7 @@ func (c *Client) ProposeStorageDeal(ctx context.Context, params storagemarket.Pr
Label: label,
StartEpoch: params.StartEpoch,
EndEpoch: params.EndEpoch,
StoragePricePerEpoch: params.Price,
StoragePricePerEpoch: pricePerEpoch,
ProviderCollateral: pcMin,
ClientCollateral: big.Zero(),
VerifiedDeal: params.VerifiedDeal,
Expand Down