SiaFoundation / renterd

A renter for Sia
https://sia.tech/software/renterd
MIT License
68 stars 20 forks source link

Remove allowance from configuration #1619

Closed ChrisSchinnerl closed 3 weeks ago

ChrisSchinnerl commented 4 weeks ago

Closes https://github.com/SiaFoundation/renterd/issues/1623

This PR gets rid of the Allowance and instead allows users to set the amount of funds to put into new contracts. One side effect of this is the change to price scoring that now uses the gouging settings to determine the score of a host.

The closer the price goes towards the gouging settings, the worse the score gets. The score is 0.5 at 50% of the gouging settings and increases towards 1.0 below that. Above 50% it approaches 0. The score is also composed of 3 parts for upload, download and storage pricing. So a host can still have a reasonably good score if only the upload pricing is bad but the other pricing is fine as long as it is not gouging.

ChrisSchinnerl commented 3 weeks ago

Looks good to me, came as a bit of a surprise to me though, figured we wouldn't touch that since it allows the user to somewhat cap its spending.

Indeed but Nate made a good point. The gouging settings already cap the rate at which we are spending and it's better to continue spending at a capped rate to save data rather than lose files because we underestimated the spending for the period.

NOTE: A nice side effect is that the price score is now directly linked to the gouging settings. Possibly helping with host churn since we will avoid hosts too close to the gouging limits.