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

Retrievals work when last block lands on payment interval #388

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

hannahhoward
Copy link
Collaborator

Goals

Handle the case when the last block sent lands on a payment interval, removing the need for a final payment.

Previously, if the last block corresponded with a payment interval, a cascading set of failures occurred preventing the deal from completing.

Implementation

Client Side:

  • Record the "ClientEventAllBlocksReceived" event when status is "DealStatusFundsNeeded" or "DealStatusSendFunds" (sets AllBlocksReceived = true)
  • When receiving the "ClientEventComplete" event, if we are in "DealStatusOngoing" rather than "DealStatusFinalizing", put deal in "DealStatusCheckComplete" which runs a state handler to make sure AllBlocksReceived = true before moving to DealStatusComplete (or error otherwise)

Provider Side:

  • In revalidator, in OnComplete, if we have no additional payment needed, just send DealStatusComplete back in the voucher result, and return nil error status which will cause data transfer to finish
  • Allow DealStatusComplete (triggered by data transfer completing) to run from DealStatusBlocksComplete as well as DealStatusFinalizing

Handle the case when the last block sent lands on a payment interval,
removing the need for a final payment.

Previously, if the last block corresponded with a payment interval, a
cascading set of failures occurred preventing the deal from completing.
Copy link
Contributor

@ingar ingar left a comment

Choose a reason for hiding this comment

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

👍

The state diagrams are getting hairy!

@hannahhoward hannahhoward merged commit 0b14443 into master Sep 2, 2020
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