fix: incorrect computing price-per-bytes in retrieval client #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
关联的Issues (Related Issues)
close filecoin-project/venus#4908
改动 (Proposed Changes)
The approach of computing
price per byte
in retrieval client is incorrect,the
order.Total
is the total price to retrieve the piece, its value issize * MinPricePerByte + UnsealedPrice
https://github.com/filecoin-project/go-fil-markets/blob/master/retrievalmarket/types.go#L216
with following approach to compute
price per byte
:https://github.com/filecoin-project/venus-market/blob/ab7c180f5a65a1c7ab549cfca78463f2a9329fbc/client/client.go#L803
if
order.UnsealPrice
is not 0, this causesprice per byte
(ppb) larger than it's actual amount..this would finally cause
retrieval deal
failed withClientEventVoucherShortfall
following is the Fragment of this issue:
自查清单 (Checklist)
在你认为本 PR 满足被审阅的标准之前,需要确保 / Before you mark the PR ready for review, please make sure that: