Adjust cost calc. when pruning contracts with old hosts. #1229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UPDATE: I updated the PR to always overpay and got rid of the response size as well. This just fixes all outstanding pruning errors and we can update it again when we either include the release in the host score or once we move to RHP4.
This PR fixes a pruning error I ran into on my node (2 hosts actually) where we would not transfer sufficient funds to the host when pruning the contract. The numbers didn't make sense, because calculating backwards I would have to be dealing with 40TiB contracts to arrive at the expected cost. I then realised we probably updated the logic at one point and found we did in host v0.2.1... So we're just dealing with very old hosts.
The fix is to simply retry and use the old cost calc. method, it's however slightly annoying to do because the host blows up the
transport
on error, and we need to run into the error once because hosts didn't have arelease
field... I tested this manually on theintegrity
node.