renterd
renterd copied to clipboard
Update renew/refresh collateral estimates to be more efficient
Right now renewals and refreshes do the following:
- renewals: estimate funding from past contract usage and add collateral proportionally to funding
- refreshes when out of funds: double the funding and add collateral proportionally to funding
- refreshes when out of collateral: don't increase the funding and add collateral proportionally to funding
After RHPv4 we can change this to do the following
- renewals: only cover base cost of data in contract + restore funding/collateral the contract had before renewal
- refreshes: only cover base cost of data and add x% margin to funding or collateral
This means we get rid of complicated estimates and instead rely on a fixed percentage margin. e.g. Initial renter funds / collateral is 100SC, we use up 95SC which triggers a refresh -> refill to 100SC + 20%