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

handle retrieval deals with zero price per byte #477

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

dirkmc
Copy link
Contributor

@dirkmc dirkmc commented Jan 27, 2021

Prevent a crash when retrieval deal price per byte is zero.

Addresses filecoin-project/lotus#5140 filecoin-project/lotus#5409 (comment)

Improvements

Currently the flow is

  • client sets up payment channel
  • client sends a payment channel voucher
  • provider sends some data
  • client sends a payment channel voucher
  • provider sends some data
  • ...
  • provider finishes sending data and requests final voucher
  • client sends voucher
  • provider sends "complete"
  • client marks channel as complete

This PR handles the case that the retrieval deal price per byte is zero:
When the data has completed transferring

  • provider doesn't request a final voucher
  • provider immediately sends "complete"
  • client waits for final data to arrive
  • client marks channel as complete

Out of scope

In a future PR we should make more comprehensive changes for free retrievals:

  • Avoid creating/funding a payment channel entirely
  • Skip all the pause resume logic

@dirkmc dirkmc force-pushed the feat/rtrvl-zero-price-byte branch from e9aa5f5 to befa8fd Compare January 28, 2021 10:35
@dirkmc dirkmc marked this pull request as ready for review January 28, 2021 10:36
@dirkmc dirkmc merged commit e061bc5 into master Feb 1, 2021
@dirkmc dirkmc deleted the feat/rtrvl-zero-price-byte branch February 1, 2021 13:42
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.

2 participants