Contract as a Deal Client Standard #604
Replies: 15 comments 35 replies
-
I like how this is defined as an FRC in user-land. One question I have is why the solidity/event interface uses CBOR encoding. Would it not make it more consumable by ethereum toolchains and existing methodologies to not use CBOR for ethereum events? Are there interactings with other lotus APIS that makes this either desired or required? Security: imagine a contract is malicious, and the event data is garbage, wrong, or points to unscrupulous miner IDs, clients, etc. Are there any open attack vectors by interacting with the DealProposal struct that would phish, scam, or mislead someone interacting with it? I need to look more closely at how SPs would use this information - but I'm thinking about a miner participating in a deal proposal where the client collateral or the deal verification is spoofed in some way. Are there additional interfaces or interactions that we might need to expose as part of this standard to enable some level of notarization on these events? If the other APIs the SP would use to further broker a deal are secure enough to say, not trick an SP into taking a mis-represented deal, then maybe that isn't needed. Having a user-space standard protocol for pub/subbing deal marketplace activity seems critical. The general direction of the proposal is valuable and fit for purpose. |
Beta Was this translation helpful? Give feedback.
-
Thank you for getting this started.
This name may be easily misleading to newer developers as it sounds like "Submit a deal proposal to the market" If you were going to store the deal proposal in the contra, then I think we do not have to emit the event and just have a getAllDealProposals method, and make the get deals and their indexing + process off chain. Some of the deal proposal variable should be optional and can be generated by the SP on the fly, as they get the data and construct the PSD message. This is also limiting DataDAOs to filecoin built in storage market structures and may prevent future user programmable storage market flexibility. One thing might worth considering is to add piece CID and exposing a metadata field. and the metadata can be defined by datadao operators and store info like: where the data is, how the SP will get the data, and others. |
Beta Was this translation helpful? Give feedback.
-
At the moment the deal proposal libp2p protocol I think we should probably include a In any case having the data available at multiple locations is going to make it easier for SPs to fetch it. If no location reference is specified, how are SPs supposed to find the data? It pushes a lot of extra work onto them. |
Beta Was this translation helpful? Give feedback.
-
@raulk @jennijuju I wanted to flag a potential idea for an escrow deposit somewhere in this deal flow. Perhaps it is out of scope of this particular FRC, but perhaps not. We do need some way for a client contract to trustlessly pay an SP and for the SP to only receive payment once they have published the storage deal and sent a ProRep. Otherwise the client can ask for a deal they have no intention of paying for. An SP can also receive payment and take no action to publish the deal or submit proofs. What kinds of mechanics do we have to avoid this? |
Beta Was this translation helpful? Give feedback.
-
I suggest we drop the CBOR encoding, unless there is a very good reason to include it. It seems like the Deal Proposal submitted on chain and the one actually pushed with a PSD will be different - for example the In this case it doesn't make sense to introduce another encoding (namely CBOR). |
Beta Was this translation helpful? Give feedback.
-
Based on the output of conversations in filecoin-project/boost#1160 (comment) and #604 (comment), I propose we include the following inside the event signature. These are optional fields that don't have to be filled in but can allow SPs to better process deal proposals:
This would mean the event signature would look like this:
|
Beta Was this translation helpful? Give feedback.
-
The spec for this document is being iterated on here: https://www.notion.so/pl-strflt/Client-Contract-FRC-458e625f13b14c70bfdfe7ed64007b6c The scope of this FRC has expanded to include datacap, paid deals, and client verification. This prior thread and notion doc will be referred to in the subsequent FIP discussion and FRC draft that follows. |
Beta Was this translation helpful? Give feedback.
-
fyi im updating the discussion title and such according to the latest discussion. |
Beta Was this translation helpful? Give feedback.
-
This is a good discussion and I'm happy to see people attempting to align on some standards here.
It's not going to be easy to predict everything useful that clients, providers or markets will want in the future, so I think there's some risk of locking into something too narrow if the intended scope is large. That is, if the scope of this standard is narrow and focussed on what's possible today, it will be relatively easy and expected for new standards to emerge in the future that support more things. OTOH, if the scope here is large and it tries to be the standard for everything, the chance of getting that right is very low, but it might gain such wide adoption that the barrier to alternative standards arising is too high, and the ecosystem is locked into an unfit standard. As currently written, this proposal is entirely specific to the built-in market actor. That's currently the only way to get an SP to store data, but it will not be for too long. Motivation for this are in #241 and #298. I expect and hope the built-in market actor to become entirely redundant and unused in the future. Thus, I think this proposal should either:
In order to target the built-in market actor, the main thing that needs to change is the positioning and narrative. The proposal should explain that it's a standard for arranging deals on the particular terms that the built-in market understands, and no more. It should leave conceptual room for new standards to emerge later. In order to target a broader scope, I think this proposal would need to (at least):
I would recommend explicitly scoping this proposal to the built-in actor. The work to define a good standard for future user-programmed market actors is large, and the chances of getting it right are quite low. IMO it is premature to attempt to standardise anything more here before native actor developers have a chance to build things, experiment, and discover patterns that do and don't work. See some related comments about the Ask protocol. |
Beta Was this translation helpful? Give feedback.
-
There might be something I haven't seen about a standard conversion, but how does an event emitted by an EVM contract get converted into an event emitted at FVM level? As an FVM standard, I want to see what this looks like in FVM-native terms, as defined in FIP-0049. @raulk is there an obvious conversion that doesn't need to be stated here? |
Beta Was this translation helpful? Give feedback.
-
Adding a few comments here based on some observations from the nft.storage perpetual storage project. With 11 SPs participating taking 100 or so deals a day, we already see a lot of wasted bandwidth on both the client and SP side as many SPs attempt downloading data, but end up not successfully getting the deal since another SP already claimed + published. We need to have some plan to address the frontrunning problem as it's already surfaced and causing frustration. We should have some guidance on how to handle the basic use cases around SP selection so it's a bit more deterministic / not wasteful for client + SP resources with the competing for deals situation...
Ideally we have a solution for 3, which works for 1 and 2 as well. Based on some work done by @jennijuju and team, seems like soft acceptance + timeouts was what we landed on to solve this frontrunning problem. |
Beta Was this translation helpful? Give feedback.
-
hi everyone, |
Beta Was this translation helpful? Give feedback.
-
@aashidham |
Beta Was this translation helpful? Give feedback.
-
I have a question, at what point in the deal flow the client makes payment to store data, |
Beta Was this translation helpful? Give feedback.
-
The goal of this proposal is to align on a new FRC that will create a new interface upon which any Solidity contract deployed on FVM can issue deals to participating SPs.
The motivation of this comes from the great variety of ways in which deals can be created on the FVM today. We wanted to define a composable, extensible interface where a great many use cases for building deals can be supported.
Some examples of this include: deal replicator contracts, proxy contracts that can be leveraged by many DataDAOs, repair workers, and many more such services.
We are proposing an interface
DealProposer
to look like the following:Note that the
DealProposal
struct will be CBOR-encoded and look like the following:We expect DataDAOs, perp storage solutions, repair workers and other deal-issuing contracts on FVM to implement the
DealProposer
interface.We expect the flow to look like the following:
DealProposalCreate
event to the event log whenever they have aDealProposal
they want to send to an SP.DealProposalCreate
events.getDealProposal
function with the id stored in the event.DealProposal
payload associated with theDealProposalCreate
event.The overall flow looks like the following:
Here is an example
DataDAO
contract that inheritsDealProposer
:Notes:
Open questions:
DealProposalCreate
event only contains anid
. Is there more worth adding to the event signature? Keep in mind each additional topic needs to be 32 bytes at most. Having more descriptive events may allows SPs to filter events so that they can more selectively respond. Some ideas:(a)
MinerID
: to let a participating SP filter by its own ID. This is valuable for clients to emit events that are specifically for a constrained set of SPs.(b)
string
: a human readable string (of at most 32 characters) that describes the storage deal. Can be optionally filled by clients. Relevant strings can then be filtered by SPs. May lead to confusion / splintered topics since this is a freeform field. May need further standardization if included.(c)
pieceSize
: the size of the deal. SPs can then filter by the size of deals they want to store.(d)
verifiedDeal
: whether or not the deal is verified. SPs may not want to entertain unverified deals.More open questions and notes to be added, but thought I would kick off the conversation! :)
Beta Was this translation helpful? Give feedback.
All reactions