Skip to content

Renewing

Luke Champine requested to merge renter into master

Files are now renewed before their contracts are set to expire. An offline check was implemented, but not used, since I think it'll be tricky to get right due to latency, and at this stage it may be overly aggressive anyway.

I also removed the bytesUploaded and chunksUploaded fields from the file object, since these can be calculated from the contract set. Unfortunately this meant adding a mutex, since the contracts are updated during the upload process. But then I realized I needed to add a mutex anyway, since the repair loop can now modify contracts in the background at any time. I worry about how much complexity this has introduced though. The renter does not feel very solid to me, and I take responsibility for that. A lot of the difficulty is tied to persistence; in-memory data structures have to be kept in sync with on-disk files. I hope that we can steadily improve the renter until it feels sturdy again.

This stuff hasn't been adequately tested. I'll be doing that tomorrow. I will also be enabling "lazy" contract formation, so that you can request as many hosts from the hostdb as you need, and you'll only form contracts with them once you actually start uploading data. The current upload algorithm doesn't ask for enough hosts, so I think this will result in fewer upload failures.

Merge request reports