Skip to content

Make Expiry on the PriceTable a duration

Peter-Jan Brone requested to merge pt-duration into master

MERGE REQUEST

MR Guidelines

Overview

This MR renames Expiry to Validity on the price table and makes it a duration instead of a time.
This is necessary because the renter and the host's clock might not be in sync.

I had to add another field Timestamp which is the time at which the price table was created. This is a requirement for both pruning and validation of the expiry when the renter makes an RPC request. I thought about solving it differently but adding this field seemed harmless as it solves both the pruning case and the expiry validation case.

^ edit: Chris advised against the Timestamp field and I agree, so I added hostRPCPriceTable and updated the implementation of the heap and the guaranteed map on the host.

Example for Visual Changes

N/A

Checklist

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

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Any new packages are added to Makefile and .gitlab-ci.yml
  • API documentation updated for API updates
  • Module README.md updated for changes to workflow
  • Issue added to Sia-UI repo for new supporting features
  • Changelog File Created

Issues Closed

Closes #4201 (closed)

Edited by Peter-Jan Brone

Merge request reports