Skip to content

Allowance Updates to Period and Renew Window

Matthew Sevey requested to merge 3599-allowance-updates into master

MERGE REQUEST

Overview

This MR updates how the allowance period and renew window are used. The main change being that the renew window is now an additional period of time vs being within the allowance period. The implication here being that the renew window can now be larger than the period. This creates the edge case that for large renew windows, the renter could be offline for multiple periods. When the renter comes back online we would expect only one contract revision to happen to avoid instant contract renewals and therefore wasteful spending.

Some key points:

  • Updated terminology from period to contract length for a number of methods. This is because those methods were using the period as the total length of the contract. Now that the renew window is outside the period it makes more sense to explicitly talk in terms of contract length to ensure the right value is being passed in.
  • Updated Default Allowances to have a period of 1 month and a renew window of 2 months

The contract testing in the siatest package was updated to run TestRenterContracts with the scenario where the renew window is less than the period and when the renew window is greater than the period.

Additionally a test was added to probe the case of a multiple periods passing while a renter is offline.

Example for Visual changes (ie Screenshot)

N/A

Issues Closed

Closes #3599 (closed)

Checklist

Review and complete the checklist to ensure that the MR is complete before assigned to an approver.

  • All new methods, or updating methods have clear docstrings
  • Testing added or updated for new methods
  • API documentation updated for API updates
  • Module README.md updated for changes to work flow
  • Issue added to Sia-UI repo for new supporting features
Edited by Matthew Sevey

Merge request reports