Track
PeSto
DRI
IreneLuca
Status
Done
Target Date
January 21, 2023
tl'dr
Assume we have a method to create a storage deal for a CID list
createDealProposal(cid_list, ...) -> deal_id_list
(see Protocol research for a verified data bounty contract )
The repair(deal_id_list,...)
method will:
- for each deal_id in the list
- get the deal activation epoch
- at each epoch, if current epoch > activation epoch:
- get the deal status
- if deal status ≠ active, then use `createDealProposal' from bounty contract to create a new deal and replace deal_id in the list
- (there may be a check here about if enough funds/dacap available to do such operation)
- terminate the old deal
- ❓why do we need termination? (irene): I think that a deal in filecoin can be marked as non-active for a period and then show as active again, correct? If this is the case, this method will trigger activation of a new deal and we will end up with two deals (after the first goes back to be active). To avoid this we need to terminate the inactive deal after replacing it.
The renew(deal_id_list,...)
method will:
- for each deal_id in the list
- get the deal activation epoch
- at each epoch, if
current_epoch = deal_id_start_epoch + deal_duration
: check internal balance, if there is enough tokens then invokescreateDealProposal
from Bounty contract again.