This is a summary of the current (Dec 2021) interactions and other coupling between the storage miner and storage market actors.
For Filecoin storage/data programmability, we probably want to remove all instances of the miner actor storing market state, or calling the market actor.
Plain language summary
Before publishing any deals, the miner operator posts funds to the market which will be used for collateral. This doesn't involve the miner actor ✅.
The miner operator publishes deals to the market. This triggers lock-up of funds from both the client and provider. The provider's collateral will be slashed if it does not prove the deal in a sector before the deal activation deadline. This triggers locking of the client's verified data cap for verified deals (which will be restored if the provider doesn't follow through). This call doesn't involve the miner actor either ✅.
Prior to committing a sector the miner actor records the deal IDs contained in the sector, and asks the market actor to (a) compute the deal weight from deal size and verified status, and (b) compute the data commitment from the deal piece commitments (and assumed zero elsewhere). The deal weight is an input to sector power.
Upon proving a sector, the miner calls the market to activate the deals, signalling that the sector has been sealed and triggering the beginning of payments.
When updating a CC sector with deals, the miner actor calls the market actor to (a) compute deal weight, (b) compute CommD from the deals' pieces, and (c) activate the deals.
When terminating a sector early (manually or by cron for a continued fault), the miner actor calls the market to terminate the deals in that sector.
The market actor never calls the miner actor.
Details
Message parameters
SectorPreCommitInfo.DealIDs
- Miner commits to deals before committing sector
SectorPreCommitInfo.ReplaceCapacity
,ReplaceSectorDeadline
,ReplaceSectorPartition
,ReplaceSectorNumber
- Obsolete after SnapDeals
ReplicaUpdate.Deals
- Miner commits to new deals
State
MinerInfo.PeerId
andMultiaddrs
- Are both these used in consensus, or only deal-making?
- Mostly harmless
SectorPreCommitOnChainInfo.DealWeight
andVerifiedDealWeight
- For quality-adjusted power
SectorOnChainInfo.DealIDs
,DealWeight
,VerifiedDealWeight
- Deal ids to notify of sector termination
- Weights are for QA power
SectorOnChainInfo.ReplacedSectorAge
,ReplacedDayReward
- For CC-upgrade, because deals affect power, which affects penalties
- Obsolete in new sectors since SnapDeals
Interactions
- PreCommitSectorBatch calls
VerifyDealsForActivation
to compute deal weights- ProveCommitSector calls
ComputeDataCommitment
to compute CommD for verification- ConfirmSectorProofsValid calls
ActivateDeals
to activate in the storage market- ProveCommitAggregate calls
ActivateDeals
to activate in the storage marketComputeDataCommitment
to compute CommD for verification- ProveReplicaUpdates calls
ActivateDeals
to activate in the storage marketVerifyDealsForActivation
to compute deal weightsComputeDataCommitment
to compute CommD for verification- TerminateSectors calls
OnMinerSectorsTerminate
- Cron
OnMinerSectorsTerminate