SiaFoundation / renterd

A renter for Sia
https://sia.tech/software/renterd
MIT License
68 stars 20 forks source link

Add support for v2 host announcements #1669

Open ChrisSchinnerl opened 6 days ago

ChrisSchinnerl commented 6 days ago

This PR adds. v2 host announcements via the host_addresses table. Up to 5 addresses per protocol per announcement will be stored for each host. The IP validation remains similar to what it was before. All addresses of a host are resolved and then we make sure there are only up to 2 addresses associated with a host.

This PR also gets rid of the persisted resolved addresses instead of doing the same for v2 addresses. In exchange, we don't consider host's for which we fail to resolve addresses as "redundant" anymore assuming that every host that fails to resolve either does so because it's our own fault, or because it is offline/misconfigured which means the host scans will eventually treat it as offline.

NOTE: I verified that v2 hosts are picked up and added to the database for the v2 tests but the tests won't pass before all parts of the renter are migrated to support v2. The f/u PR continues the work by implementing scanning.

Closes https://github.com/SiaFoundation/renterd/issues/1668