Harden the proof verification in the worker's UpdateRegistry job
MERGE REQUEST
Overview
This MR improves the UpdateRegistry
workerjob.
- It enables the use of
errors.Contains
on the errors returned fromUpdateRegistry
jobs - It adds more testing around the verification of the proof for ErrLowerRevNum and ErrSameRevNum and returned errors
- A host can no longer use an old entry to fake a proof cause we check the entry provided for the proof against the sent revision number.
-
ErrSameRevNum
andErrLowerRevNum
are only returned via the job's response channel if the host was able to provide a proof for either error. That way we can simple check for those errors in the renter and be confident that they are correct. -
UpdateRegistry
in the renter deduplicates multipleErrSameRevNum
andErrLowerRevNum
which cleans up the API response a bit.
What this means is that we could now check for ErrLowerRevNum
and ErrSameRevNum
in the SDK and be confident that those errors only appear when a host was actually able to proof that they have a valid revision that satisfies those conditions.
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
Edited by Christopher Schinnerl