Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to limit contracts by size #381

Closed
PiotrZSL opened this issue May 5, 2024 · 3 comments
Closed

Add ability to limit contracts by size #381

PiotrZSL opened this issue May 5, 2024 · 3 comments
Labels
feature A new feature request or enhancement

Comments

@PiotrZSL
Copy link

PiotrZSL commented May 5, 2024

Description

As a user, I want to set maximum contract size in GB regardless of other settings.

Problem:
Let say that I want to have max 2TB contracts, my storage price is 200 SC. This mean that it would require collateral around 800SC per month. Then I can set max 3 month contracts, and this will be 2400SC max collateral. And thats the only way for me to limit contract size.

BUT now when prices change to 300SC, same contract would require 3600SC max collateral. This mean that if I don't change max collateral, then renter would need to renew contract for shorter duration. And in this case renter can do also single month 6TB contracts. At the end due to price changes enter may no longer be able to renew contracts.

Right now I got 8TB contracts and I would like to prevent that in future without risking contracts to not be renewed due to for example "to short" contract duration needed in new prices.

In such situation I want to set maxContractSize to 2TB, and maxCollateral for example to 5KSC, and then both those would be ued in calculation of contract size/duration to make sure that contract will never exeed that 2TB regardless of duration.

This feature may require also some changes on renter side.

Version

No response

What operating system are you running (e.g. Ubuntu 22.04, macOS, Windows 11)?

No response

Anything else?

No response

@PiotrZSL PiotrZSL added the feature A new feature request or enhancement label May 5, 2024
@n8maninger
Copy link
Member

n8maninger commented May 5, 2024

I’m not sure a setting like that makes sense. Why would a host ever want to limit a contract's maximum size? That seems counterproductive. If a renter wants to store data and the host has space, that means more revenue for the host. If you raise your storage price significantly, you should also increase your max collateral.

@PiotrZSL
Copy link
Author

PiotrZSL commented May 5, 2024

Renter could create multiple contracts.
Avoiding big contracts helps reducing risk in case of data coruption or other issues that prevent renter renewing contract.
Simply not putting all eggs into single basket. Other reason is to reduce amout of locked collateral, when contracts are renewed multiple times for such big contracts.

In last months I seen on number of ocasions where big contracts are not being renewed:
51cd2f3cfc2ac7fe4e642d72f669ffa6535d5ef4a6536385e19e381deda223a4
c32927c1be54c95f7a185a0ef4e73463cc73a571ab7514052a868c886d608aae
b08a46fbc3cb4f01f04f7ff33c5366ea46cfa2e4285e4f464151d382e43605b7
21898a0e4d2b8c6e30ede6e2a878d26f51c7d5843d1784bc67e3902c8f00c6e1

Simply better would be to avoid situation when half of data that you store is getting deleted at once.

@ChrisSchinnerl
Copy link
Member

Setting the MaxCollateral accordingly should give you exactly what you need. It will cause multiple renters to upload data instead of a single large one which spreads out the risk of losing a lot of data.

A renter isn't going to form multiple contracts with a host for various reasons. Even if it did, it would treat all the contracts for a host as a unit and either renew all of them or let all of them expire, essentially not fixing your core issue.

@n8maninger n8maninger closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants