Direct Storage Deal Dispute for user-defined markets #760
Replies: 2 comments 10 replies
-
This is an excellent idea. The interface should include space for a proof in the parameters: type ProvePieceInSectorParams struct {
pieceCID pieceCID
sectorID int
proof []byte
}
/*
Check if a given pieceCID is stored in the sector
*/
IsPieceInSector(pieceCID, sectorID, proof) return bool; This is required because the miner actor will not have access to pieceCIDs in its state. Exposing sector states to user contracts is clearly useful but potentially problematic. We want to design very stable interfaces for contracts so we don't break user code. Since scaling the miner actor involves keeping less information on chain it is useful to imagine a the limiting case where all miner actor state is kept offchain in something like a zk rollup. An interface that works in this limiting case is:
Basically the miner actor can safely be assumed to be able to verify a statement given a proof and a witness but not provide availability for its own data. The tweak I'm proposing above to GetSectorStatesParams follows exactly this pattern because miner actors don't have data availability on the many CommPs composing a CommD The clearest path forward to achieve what's proposed here is to optionally allow saving CommD to the miner actor's state upon prove commit. This is required for this approach to work at all. This is a change I've been planning to propose in the coming weeks and is feasible to land in the next upgrade alongside direct data onboarding. If you're interested in joining in I'd be happy to work with you on the FIP. |
Beta Was this translation helpful? Give feedback.
-
While a sector ID is sufficient to address a sector's content (CommR/D), it's not enough to address its workflow status, like faults. Sector fault status is not indexed by sector ID on chain, but by deadline and partition. A method like Taking this with @ZenGround0's points about future data availability, a similar pattern would be necessary but could work for determining fault status. The method would be something like This would still introduce coupling that would make it very hard to change these internals in the future. However I'm now weakly of the opinion that it's worth it. We would then face the prospect of implementing an all-new miner actor if we ever wanted to change this internals. |
Beta Was this translation helpful? Give feedback.
-
Simple Summary
Add an interface(s) to miner actor which allows user-defined storage market to dispute storage deal(s) directly.
Abstract
Disclaimer: Ideas borrowed from Venus dev team
In order to enable a variety of new innovations on L2 and more flexible storage deal terms between clients and SPs, we propose to add the following protocol API to miner. Note that this FIP separating sector from commD might be pre-requisite for this proposal?
Get states of the sector that stores requested pieceCID(s).
Change Motivation
The two pillars of Filecoin's proof of storage system, PoRep and Post, have been enabling SPs to cryptographically prove its commitment to a storage deal. More specifically, PoRep is a one-time proof that guarantees client's data (pieces) get sealed into a sector, while PoST proof is required to be done by SPs everyday to demonstrate to the network that client's data stored in the sector is still there.
After the introduction of F(E)VM, programable data storage on top of the Filecoin core protocol is now possible. This is an especially important step towards a decentralized storage network for both private and enterprise data storage on the user layer of Filecoin protocol. Developers can build their own storage market and shape custom deal terms according to their unique data storage use case. To unleash a new wave of innovation on data storage incentives and deal terms, smart contracts on F(E)VM need to be able to query chain states on whether SPs are still actively tending to the storage deal data they claim to store.
By exposing
GetSectorStates
API from core protocol to above L2 applications, smart contracts will be able to enforce the storage deal terms agreed by both clients and SPs, releasing token rewards or slashing pledges accordingly.Specification
Method 1
GetSectorStatesParams is defined as the following...
GetSectorStatesReturn is defined as the following...
Method 2
If the gas cost associated with method 1 is much higher than expected, we might consider more direct APIs to achieve direct storage deal dispute. For example...
Method 3
Or we could have a more generic
GetStatebyHead
to get the root of the actor and leave the burden of finding and calling each methods within the actor to SDKs or Dapp developers.Method 4
Elaborated by @ZenGround0 here.
Method 5?
We are very much open to ideas on how to achieve Direct storage deal dispute (DSDD) if there is more elegant way of doing so.
Design Rationale
Note: storage deals in this context means the mapping of deals and SPs within a user-defined storage market (smart contract).
Right now, Filecoin built-in market put on massive limitations on how storage clients and storage provider could interact with each other. For example, pledge is arbitrarily determined by the network core protocol regardless how the storage client values its data and how much skin the client would like the provider to have in the storage deal. When we carefully examine the current storage deal workflow, there is no easy way for a Dapp to check if a storage provider is still actively honoring a deal in a decentralized way. We then deducted that by simply allowing user-defined contracts to dispute/enforce a storage deal between client and provider we can circumvent the built-in storage market completely and build more flexible storage deal terms on L2.
The actual dispute would work much like optimistic windowPost. An entity (could be storage market deployer or the client) could run off-chain analytics on sector states. Once a breach of contract is detected, the entity could then use
GetSectorStates
to verify and trigger dispute to either slash or follow some other user-defined contract logic.The proposed design would also allow easy transfer of storage deal from one SP to another as you would just need to make changes to the internal mapping of the deal to a SP in a contract instead of FIPing a core protocol change. For example, SP A could propose to a contract to take over the deal terms, and SP B could approve and allow SP A to take over the deal from then on.
Product Considerations
Direct storage deal dispute (DSDD) will allow many innovative user-defined storage terms use cases...
A storage client wants to use Filecoin as their cold storage solution to store some archived data. The client would like to store 10 copies of each data piece (pieceCID). The client wants free storage from SP for a year as they have obtained Datacap from its LDN application themselves. A 5 fil/TiB pledge and a 0.1fil/TiB/day sector fault fee term, for example, could be negotiated between the parties to proceed with the storage deals.
Again, a storage client wants to use Filecoin as their cold storage solution to store some archived data, but they don't have either DataCap or Fil. A 3 USDT/TiB/Month fee and 0.1 USDT/TiB/day sector fault fee term, for example, could be negotiated between the parties to proceed with the storage deals.
A DataDao organization wants to mimic f+ program to incentivize valuable data on-boarding to Filecoin network using their own coin, FilStar. The DataDao would have its own notaries to approve datasets and the value of the Dao would be reflected by the market cap of FilStar.
There could also be many opportunities for perpetual storage use cases because of easier deal ownership transfer as mentioned in the design rationale. If properly incentivized, a SP would be always willing to pick up a perpetual storage deal from another SP.
Beta Was this translation helpful? Give feedback.
All reactions