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

Flush out & fix retrieval bugs #525

Merged
merged 11 commits into from
Apr 2, 2021
Merged

Flush out & fix retrieval bugs #525

merged 11 commits into from
Apr 2, 2021

Conversation

aarshkshah1992
Copy link
Collaborator

@aarshkshah1992 aarshkshah1992 commented Mar 31, 2021

Depends On filecoin-project/go-data-transfer#186.

Closes filecoin-project/lotus#5895.
Closes #528.
Closes #527.

TODO

Testing Proof

go test -count=100 -run TestStorageRetrieval
PASS
ok  	github.com/filecoin-project/go-fil-markets/retrievalmarket	95.965s

@aarshkshah1992 aarshkshah1992 changed the title Only account for unsealing payments when price per bytes is zero Account only for unsealing payments when price per bytes is zero Mar 31, 2021
@dirkmc
Copy link
Contributor

dirkmc commented Mar 31, 2021

Looks great 👍

Could we also add an integration test for this scenario where the unseal price is non-zero but the price per byte is zero 🙏

@aarshkshah1992 aarshkshah1992 changed the title Account only for unsealing payments when price per bytes is zero Flush out & fix retrieval bugs Apr 1, 2021
DealProposal: *proposal,
Receiver: receiver,
LegacyProtocol: legacyProtocol,
CurrentInterval: proposal.PaymentInterval,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not setting the CurrentInterval here creates issues when we have a non zero price for Unsealing & bytes because we don't initialize this value correctly in the FSM when we jump directly to the Give me money for the unsealing state via the RequestPayment event instead of going via the ProviderOpen event .

Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

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

Great work Aarsh! 🎉

@@ -81,7 +81,11 @@ var ProviderEvents = fsm.Events{
From(rm.DealStatusFundsNeededUnseal).To(rm.DealStatusUnsealing).
Action(func(deal *rm.ProviderDealState, fundsReceived abi.TokenAmount) error {
deal.FundsReceived = big.Add(deal.FundsReceived, fundsReceived)
deal.CurrentInterval += deal.PaymentIntervalIncrease

// only update interval if the payment is for bytes and not for unsealing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch 🎣

retrievalmarket/impl/requestvalidation/revalidator.go Outdated Show resolved Hide resolved
@dirkmc
Copy link
Contributor

dirkmc commented Apr 1, 2021

Note: I'm going to test this out on a live client / miner before merging

@dirkmc dirkmc merged commit dd9b0da into master Apr 2, 2021
@dirkmc dirkmc deleted the feat/5895 branch April 2, 2021 07:50
This was referenced Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants