Problem
Main problem: Expensive Gas costs
A Storage Provider that wants to store client data must publish their deals on-chain via PublishStorageDeal
. The Storage Market actor which governs these interactions is unfortunately very gas expensive.
PublishStorageDeal
accounts for 40% of the total costs. As a bug, deal activation costs are currently paid by cron, but this must change.
Other problem: Max duration is up to 5 years
Secondary problems: The built-in storage market actor acts as the gatekeeper, designing new cheaper storage markets is not possible to do today (see
Goal
Create a cheaper and much simpler storage market, that has a similar flow (but not backward compatible) with the previous storage market.
FIL+ Storage Market
Step 1: FIL+ Direct
Goal:
- Make SPs directly create FIL+ allocations bypassing the storage market.
- Allow new storage market contracts to be built to offer storage markets (to build step 2).
Strategy
- Enable Free CommD as described in Direct FIL+ impacts & work outline
Limitations:
- SPs cannot receive payments
- No explicit strategy for deal flow
High level design:
Step 2: FIL+ Storage Market
This is a wrapper around FIL+ Direct that can handle payments to SPs.
WORK
General intuition
VerifiedRegistry.Claims
are treated storage of most of the deal information, the remaining deal information (e.g. payment) will be in the FIL+StorageMarketActor- A deal is “activated” when an allocation is claimed.
FIL+ Storage Market Actor
PublishStorageDeal
: it receives datacap allocationProveCommitAndActivateDeals
: The FIL+ Storage Market wrapsMiner.ProveCommit
andVerifiedRegistry.ClaimAllocation
- Read functions for reading deal information partially from its own state and partially from
VerifiedRegistry.Claims
Handling of payments TODO
- PublishStorageDeal
sequenceDiagram
actor Client
actor SP as Storage Provider
participant M as Miner
participant MK as FIL+ Storage Market
participant DC as DataCap
participant VR as Verified Registry
Client --) SP: Send deal proposal off-chain
Note over SP,M: SP fetches data from client
SP ->>+ MK: PublishStorageDeals
MK ->>+ DC: BalanceOf
DC -->>- MK: Client's balance
MK ->>+ DC: TransferFrom(Allocations)
DC ->>+ VR: Receive(Allocations)
VR -->>- DC: Allocation IDs
DC -->>- MK: Allocation IDs
MK -->>- SP: Deal IDs
Note over SP,M: SP packs and seals sector
SP ->>+ M: PreCommitSector(Deal IDs, Sector Number)
M -->- SP: OK
SP ->>+ MK: ProveCommitAndActivateDeals(Sector Number)
MK ->>+ M: ProveCommitSector(Sector Number)
MK ->>+ VR: ClaimAllocations(Allocation IDs)
VR -->>- M: Verified space
M -->>- SP: Ok
Relevant docs
- Free CommD: Unconstrained data applications on Filecoin
- Deal onboarding actor interactions
- Direct FIL+ impacts & work outline
- Data termination penalty—design sketch