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

fix: incorrect computing price-per-bytes in retrieval client #186

Merged

Conversation

zl03jsj
Copy link
Contributor

@zl03jsj zl03jsj commented Aug 26, 2022

关联的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 is size * 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 causes price per byte(ppb) larger than it's actual amount..
this would finally cause retrieval deal failed with ClientEventVoucherShortfall

following is the Fragment of this issue:

Recv 30.01 MiB, Paid 0.0000001 FIL, VoucherShortfall (CheckFunds), 1m48.883s
Recv 30.01 MiB, Paid 0.0000001 FIL, FundsExpended (InsufficientFunds), 1m49.065s

自查清单 (Checklist)

在你认为本 PR 满足被审阅的标准之前,需要确保 / Before you mark the PR ready for review, please make sure that:

  • 符合Venus项目管理规范中关于PR的相关标准 / The PR follows the PR standards set out in the Venus project management guidelines
  • 具有清晰明确的commit message / All commits have a clear commit message.
  • 包含相关的的测试用例或者不需要新增测试用例 / This PR has tests for new functionality or change in behaviour or not need to add new tests.
  • 包含相关的的指南以及文档或者不需要新增文档 / This PR has updated usage guidelines and documentation or not need
  • 通过必要的检查项 / All checks are green

@zl03jsj zl03jsj requested a review from hunjixin August 26, 2022 09:33
@zl03jsj zl03jsj self-assigned this Aug 26, 2022
@zl03jsj zl03jsj requested a review from diwufeiwen August 26, 2022 09:41
Copy link
Contributor

@diwufeiwen diwufeiwen left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@hunjixin hunjixin left a comment

Choose a reason for hiding this comment

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

LGTM

@hunjixin hunjixin merged commit f875083 into master Aug 26, 2022
@hunjixin hunjixin deleted the fix/incorrect-computing-price-per-byte-in-retrivel-client branch August 26, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

marketclient检索时unseal-price的金额存在BUG
3 participants