Replies: 4 comments 12 replies
-
Just to be clear, in approach 1 and 2, no upfront collateral is required to be submitted by the provider before getting a slot index assigned, but collateral will still need to be submitted along with a proof to fill the slot, correct? Otherwise, we don't have a way of keeping the providers honest. In approach 2, the race will no longer be who provides data and proof fastest, but will instead be won by whoever calls the contract and gets assigned a slot the fastest. The expanding window mechanism is mentioned, but it's not clear if this will be used in approach 2, which would reduce the number of providers that can enter the race. Adding the expanding window mechanism to the contract start (it was originally intended to be used in repair situations only) would have the potential side effect of reducing the speed in which contracts could start (bad UX point 1). |
Beta Was this translation helpful? Give feedback.
-
I am not so convinced about approach 2. Having the possibility to make "free" reservations really invites squatting. And @markspanbroek 's two deterrents mentioned on the PR (gas-fees and expanding window) are not strong enough IMHO. Firstly, gas fees, if we are talking about going to L2 then they might be small enough for somebody with "$100 credit" to do quite some damage (of course, I don't have it quantified, but that is my gut feeling). Especially since I expect the reservation contract call to be quite cheap. Secondly, the expanding window mechanism. From what I understood, it is still unclear if we gonna use this mechanism, right? If so, then I would not base any reasoning on it as it might be rejected later on, and we will have to go back to the "drawing board". But let's say we will use it. IMHO, It solves only one type of an attack - trying to squat specific Request/Slot. If the attacker just wants to disrupt the Codex network as a whole, then he can have a few accounts that are "spread" enough to cover the most space and voila no slots will be filled... |
Beta Was this translation helpful? Give feedback.
-
We could disincentivise client withholding attacks by forcing them to provide proofs of the data between the time they request storage and contract start. After that, they don't need to "seed" the data to the network anymore, and repairers can download the data from the other providers. The client would need to provide some extra collateral at the start of the contract, which can be withdrawn once the contract has started. The validators would check that clients are providing proofs and slash some of their collateral if they missed proofs (same as providers). By disincentivising client withholding attacks, providers could be required to submit collateral before being assigned a slot (approach 3) without the worry of clients being able to do damage to the providers for squatting. Approach 3 becomes more attractive here. |
Beta Was this translation helpful? Give feedback.
-
Here's my attempt at mapping out the design space for slot reservations. Design parametersThese are the choices that we can make in designing slot reservations, as far as I can tell:
AttacksThese are the possible attacks around slot reservations, as far as I can tell:
User experience with accidentsAccidents happen, nodes can go offline before all slots are filled. This either leads to:
Design optionsPutting this all together in a table yields:
Note: attacks between braces () are somewhat mitigated |
Beta Was this translation helpful? Give feedback.
-
Contract start analysis
Background
During contract creation, there are several scenarios and interactions that can lead to suboptimal results - leading to bad UX; vulnerabilities for clients and providers; or both. This writeup attempts to explore this scenarios in more detail and provide some potential solutions.
High level requirements
The initial interaction has to present overall good UX and avoid potential attack vectors on the client and the providers. The overall constraints are as follows:
In other words, the starting a contract should have good UX and prevent either party from incurring the other in any sort of loss.
High level contract start flow
At a high level, the request for storage and contract start flow looks roughly as follows:
Actors and adversarial behaviors
There are two actors in this particular interaction, the client and the hosts. Both can present adversarial or lazy behaviour.
Thus, the two most obvious scenarios are that both the client and the hosts can prevent the contract from starting. There could be other potential attacks, but we're focusing on these two in this analysis.
Bellow are a list of approaches, the problems they address and what potential issues they present.
Approach 1
Precondition:
Mechanism:
Issues:
Avoids/Fixes:
Approach 2
Precondition:
Mechanism:
Issues:
Avoids/Fixes:
Approach 3
Precondition:
Mechanism:
Issues:
Avoids/Fixes:
Discussion
Approach 1
This approach has significant UX drawbacks, for both the client and the providers, but avoids most of the issues that would lead to significant loss. Even through there is some resource related loss and potential opportunity loss for both the providers and the client, it avoids most of the serious drawbacks of approach 3.
This is the currently implemented approach.
Approach 2
This approach fixes some of the UX related issues of approach 1 and largely avoids the potential large collateral losses incurrend by the provider in approach 3. However, it still suffer from the same drawback that both approach 1 and 3, which is a host's ability of stalling the entire contract by squating a slot.
However, it's shortcomings can be potentially aleviated by extending the contract start time and shortening the deadline occupy a slot, thus giving the ability to other providers to step in, before the request deadline expires.
Approach 3
This approach addresses some of the UX issues from 1 and 2, as well as the issue of slot squatting. However, it shifts too much power to the client and exposes providers not only to malicious, but also to lazy behavior.
Summary
Approach 2 with some adjustments, such as extending the contract deadline to at least twice the required time to download the slot can both fix the previous UX issues as well as prevent the squatting attack vectors. Overall, this seems to be the simplest to reason about and most flexible approach.
A high level flow can look something like the following:
assigned
tooccupied
Footnotes
The expanding window mechanism aims to randomize participation and prevent powerfull actors from monopolizing the entirety of the network. It relies on initially limiting participation to a subset of the network and gradually expanding the limit to allow more participants. However, this is in direct conflict with the first come first serve mechanism, which implies that the longer the contract has been open the less chances there are to occupy a slot. ↩
Beta Was this translation helpful? Give feedback.
All reactions