You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a retrieval provider, I want to be able to set an unseal price for my retrieval deals, so that I am paid for the CPU power required to unseal a sector.
Suggested Steps (not required-- just one path that will work:
Add to QueryResponse:
UnsealPrice = abi.TokenAmount
Add to Params & NewParamsV1:
UnsealPrice = abi.TokenAmount
Implement retrievalprovider.SetPricePerUnseal (can just save instance var)
Add UnsealPrice from params to providerValidationEnvironment.CheckDealParams
On Provider:
In ProviderValidator if UnsealPrice > 0, rather than returning status of rm.DealStatusAccepted, return new rm.DealStatusFundsNeededUnseal status. Return UnsealPrice for PaymentOwed
-- Make sure to dispatch ProviderEventPaymentRequested to put you in a rm.DealStatusFundsNeededUnseal state rather than a rm.DealStatusUnsealing state on Provider
(recommend modifying BeginTracking for providerValidationEnvironment in provider_environment.go, if UnsealPrice > 0, dispatch ProviderEventPaymentRequested rather than ProviderEventOpen, add transition on ProviderEventPaymentRequested to go from DealStatusNew to DealStatusFundsNeededUnseal)
On client
Make sure to dispatch an rm.ClientEventPaymentRequested event with PaymentOwed
Let client payment channel creation proceed as normal
Add UnsealFundsPaid abi.TokenAmount to client deal
In handler clientstates.ProcessPaymentRequested for client_states, add check to determine if unseal payments are owed (deal.UnsealPrice > deal.UnsealFundsPaid as additional OR condition on the if check)
In SendFunds state handler, augment the payment requested check. Currently, its essentially:
paymentRequested <= (totalReceived - bytesPaidFor) * pricePerByte
Now it should be:
paymentRequested <= ((totalReceived - bytesPaidFor) * pricePerByte)+ (UnsealPrice -UnsealFundsPaid))
In state handler for ClientEventPaymentSent,
currently we do:
* WIP
* Make selector required for retrieval deal params V1
* Add provider states for unsealing funds
* Fix up channel tracking and payment flow for unsealing
As a retrieval provider, I want to be able to set an unseal price for my retrieval deals, so that I am paid for the CPU power required to unseal a sector.
Suggested Steps (not required-- just one path that will work:
On Provider:
-- Make sure to dispatch ProviderEventPaymentRequested to put you in a rm.DealStatusFundsNeededUnseal state rather than a rm.DealStatusUnsealing state on Provider
(recommend modifying BeginTracking for providerValidationEnvironment in provider_environment.go, if UnsealPrice > 0, dispatch ProviderEventPaymentRequested rather than ProviderEventOpen, add transition on ProviderEventPaymentRequested to go from DealStatusNew to DealStatusFundsNeededUnseal)
On client
paymentRequested <= (totalReceived - bytesPaidFor) * pricePerByte
Now it should be:
paymentRequested <= ((totalReceived - bytesPaidFor) * pricePerByte)+ (UnsealPrice -UnsealFundsPaid))
currently we do:
Now we should probably first pay the unseal funds
(or something like that)
to
to
The text was updated successfully, but these errors were encountered: