Accept configuration controlling the lease crawler scheduling and other behavior
To maintain stored data, ZKAPAuthorizer periodically crawls capabilities reachable from the rootcap (where directory nodes provide additional edges in the graph to crawl).
There are certain magic numbers involved in this process:
- How frequently does it crawl?
- How close must a lease be to expiration for the crawler to renew it?
At some point in the future there may also be a magic number for:
- How far into the future should leases be renewed?
Rather than have ZKAPAuthorizer make these decisions for all users, it should accept these as inputs which can then vary on a per-grid (perhaps even per-user, in some cases) basis.
ZKAPAuthorizer already takes some configuration from a custom section in tahoe.cfg so this seems like a reasonable place for this new configuration as well. Therefore, the configuration schema should be extended:
[storageclient.plugins.privatestorageio-zkapauthz-v1]
...
lease.crawl-interval.mean = <time string>
lease.crawl-interval.range = <time string>
lease.min-time-remaining = <time string>
lease.crawl-interval.mean
and map directly on to the interval_mean
and interval_range
parameters of _zkapauthorizer.lease_maintenance.lease_maintenance_service
. lease.min-time-remaining
maps directly on to the min_lease_remaining
parameter of maintain_leases_from_root
.