I'm not 100% sure if this math makes sense but I'm pretty confident.
The comments were a bit misleading since it sounded like basePrice and baseCollateral are already covered by the last contract while they are actually the minimum amount of money that has to be put in the contract to cover the existing data on the host.
In my opinion the hostCollateral should also be the possible max collateral + the baseCollateral. That way we don't end up with a potential underflow later. It's also a bit more correct since baseCollateral is not a subset of the hostCollateral but rather the hostCollateral is the sum of the baseCollateral (collateral for existing data) plus the maxCollateral (the maximum additional collateral that will be put into the contract by the host if the renter spends all of the renterPayout for storage).
I'm not 100% sure if this math makes sense but I'm pretty confident. The comments were a bit misleading since it sounded like
basePrice
andbaseCollateral
are already covered by the last contract while they are actually the minimum amount of money that has to be put in the contract to cover the existing data on the host.In my opinion the
hostCollateral
should also be the possible max collateral + thebaseCollateral
. That way we don't end up with a potential underflow later. It's also a bit more correct sincebaseCollateral
is not a subset of thehostCollateral
but rather thehostCollateral
is the sum of thebaseCollateral
(collateral for existing data) plus themaxCollateral
(the maximum additional collateral that will be put into the contract by the host if the renter spends all of therenterPayout
for storage).