Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • Sia Sia
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 534
    • Issues 534
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • NebulousLabsNebulousLabs
  • SiaSia
  • Merge requests
  • !3250

Host whitelist blacklist

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Matthew Sevey requested to merge host-whitelist-blacklist into master Sep 28, 2018
  • Overview 82
  • Commits 11
  • Pipelines 33
  • Changes 24

NEW FEATURE

Description of Feature
Add white and black list to hostdb so renter can have more control over the hosts it uses.

Description of Work Flow
The white and black lists are maps that belong to the hostdb, they are accompanied by two boolean fields useBlackList and useWhiteList. The renter can enable either mode by submitting a call to the api endpoint /hostdb/listmode with a list of host pubkeys and true for blacklist mode or false for whitelist mode. To disable, the renter just needs to submit an empty list to the same end point with the appropriate true or false. When either mode is enabled, the hostdb will enforce the mode by filtering the hosts that are returned from the hosttree. This allows the hosttree to continue to be maintained with all the hosts on the network, so when a mode is disabled the hostdb doesn't need to re-scan the blockchain to find all the hosts again. Additionally when either mode is enabled, any active contracts with unwanted hosts are cancelled. There are no updates to threadedContractMaintenace as even if something goes wrong with cancelling the contracts when a mode is enabled, any contract with an unwanted host will not be renewed nor will a new contract be created with an unwanted host due to the filtering of the hosttree.

Testing Added
Siatest added that tests:

  • Enable Blacklist: confirm contracts form as expected, confirm hostdb is filtered as expected
  • Disable Blacklist: confirm contracts are reformed with blacklisted hosts
  • Try to enable whitelist without enough hosts
  • Enable Whitelist: confirm contracts form as expected, confirm hostdb is filtered as expected
  • Disable Whitelist: confirm contracts are reformed with non whitelisted hosts

Modules and Packages Impacted
renter, hostdb, api

Closes #3216 (closed)

Edited Oct 22, 2018 by Matthew Sevey
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: host-whitelist-blacklist