Storage Deal Flow
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow
Add Storage Deal and Power
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.add-storage-deal-and-power
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.add-storage-deal-and-power
StorageClientandStorageProvidercallStorageMarketActor.AddBalanceto deposit funds into Storage Market.StorageClientandStorageProvidercan callWithdrawBalancebefore any deal is made.
StorageClientandStorageProvidernegotiate a deal off chain.StorageClientsends aStorageDealProposalto aStorageProvider.StorageProviderverifies theStorageDealby checking: - the address and signature of theStorageClient, - the proposal’sStartEpochis after the current Epoch, - (tentative) theStorageClientdid not call withdraw in the last X epochs (WithdrawBalanceshould take at least X epochs) - X is currently set to 0, but the setting will be re-considered in the near future. - bothStorageProviderandStorageClienthave sufficient available balances inStorageMarketActor.
StorageProvidersigns theStorageDealProposalby constructing an on-chain message.StorageProvidercallsPublishStorageDealsinStorageMarketActorto publish this on-chain message which will generate aDealIDfor eachStorageDealand store a mapping fromDealIDtoStorageDeal. However, the deals are not active at this point.- As a backup,
StorageClientmay callPublishStorageDealswith theStorageDeal, to activate the deal if they can obtain the signed on-chain message fromStorageProvider. - It is possible for either
StorageProviderorStorageClientto try to enter into two deals simultaneously with funds available only for one. Only the first deal to commit to the chain will clear, the second will fail with errorerrorcode.InsufficientFunds.
- As a backup,
StorageProvidercallsHandleStorageDealinStorageMiningSubsystemwhich will then add theStorageDealinto aSector.
Sealing sectors
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sealing-sectors
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sealing-sectors
- Once a miner finishes packing a
Sector, it generates aSectorPreCommitInfoand callsPreCommitSectororPreCommitSectorBatchwith aPreCommitDeposit. It must callProveCommitSectororProveCommitAggregate withSectorProveCommitInfowithin some bound to recover the deposit. Initial pledge will then be required at time ofProveCommit. Initial Pledge is usually higher thanPreCommitDeposit. RecoveredPreCommitDepositwill count towards Initial Pledge and miners only need to top up additional funds atProveCommit. ExcessPreCommitDeposit, when it is greater than Initial Pledge, will be returned to the miner. An expiredPreCommitmessage will result inPreCommitDepositbeing burned. All Sectors have an explicit expiration epoch declared duringPreCommit. For sectors with deals, all deals must expire before sector expiration. The Miner gains power for this particular sector upon successfulProveCommit`. For more details on the Sectors and the different types of deals that can be included in a Sector refer to the Sector section.
Prove Storage
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.prove-storage
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.prove-storage
- Miners have to prove that they hold unique copies of Sectors by submitting proofs according to the Proof of SpaceTime algorithm. Miners have to prove all their Sectors in regular time intervals in order for the system to guarantee that they indeed store the data they committed to store in the deal phase.
Declare and Recover Faults
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.declare-and-recover-faults
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.declare-and-recover-faults
- Miners can call
DeclareFaultsto mark certain Sectors as faulty to avoid paying Sector Fault Detection Fee. Power associated with the sector will be removed at fault declaration. - Miners can call
DeclareFaultsRecoveredto mark previously faulty sector as recovered. Power will be restored when recovered sectors pass WindowPoSt checks successfully. - A sector pays a Sector Fault Fee for every proving period during which it is marked as faulty.
Skipped Faults
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.skipped-faults
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.skipped-faults
- After a WindowPoSt deadline opens, a miner can mark one of their sectors as faulty and exempted by WindowPoSt checks, hence Skipped Faults. This could avoid paying a Sector Fault Detection Fee on the whole partition.
Detected Faults
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.detected-faults
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.detected-faults
- If a partition misses a WindowPoSt submission deadline, all previously non-faulty sectors in the partition are detected as faulty and a Fault Detection Fee is charged.
Sector Expiration
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sector-expiration
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sector-expiration
- Sector expires when its expiration epoch is reached and sector expiration epoch must be greater than the expiration epoch of all its deals.
Sector Termination
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sector-termination
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.sector-termination
- Termination of a sector can be triggered in two ways. One when sector remains faulty for 42 consecutive days and the other when a miner initiates a termination by calling
TerminateSectors. In both cases, aTerminationFeeis penalized, which is in principle equivalent to how much the sector has earned so far. Miners are also penalized for theDealCollateralthat the sector contains and remainingDealPaymentwill be returned to clients.
Deal Payment and slashing
-
State
reliable
-
Theory Audit
wip
-
Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.deal-payment-and-slashing
-
State
reliable -
Theory Audit
wip - Edit this section
-
section-systems.filecoin_markets.onchain_storage_market.storage_deal_flow.deal-payment-and-slashing
- Deal payment and slashing are evaluated lazily through
updatePendingDealStatecalled atCronTick.