Skip to content

Harden the proof verification in the worker's UpdateRegistry job

Christopher Schinnerl requested to merge chris/update-registry-improvements into master

MERGE REQUEST

MR Guidelines

Overview

This MR improves the UpdateRegistry workerjob.

  1. It enables the use of errors.Contains on the errors returned from UpdateRegistry jobs
  2. It adds more testing around the verification of the proof for ErrLowerRevNum and ErrSameRevNum and returned errors
  3. 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.
  4. ErrSameRevNum and ErrLowerRevNum 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.
  5. UpdateRegistry in the renter deduplicates multiple ErrSameRevNum and ErrLowerRevNum 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

Merge request reports