renterd icon indicating copy to clipboard operation
renterd copied to clipboard

Remove contract sets

Open ChrisSchinnerl opened this issue 4 months ago • 1 comments

One thing that we have had for a while without ever being particularly useful, is contract sets. We always thought about what they could be used for without having any need for them. Leading to over-engineered code, extra table joins and a more complicated API. They are also very inconsistently used. e.g. downloads always use all contracts which makes sense too.

What we should do is add a column to the contracts table to indicate whether a contract is good for renewal. A contract that is good for renewal contributes positively to the health of a file and one that isn't causes the health to degrade.

If a contract becomes not good for renewal due to e.g. gouging and becomes good again afterwards it is fine to have more contracts than specified in the config. That will make sure temporary churn aborts unnecessary migration.

NOTE: this also means we should rename the Contracts setting to MinContracts to make it more clear that we no longer limit the number of contracts.

ChrisSchinnerl avatar Sep 29 '24 12:09 ChrisSchinnerl