-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addrmgr: Track network types and remove TorV2 support #3406
Conversation
c338f5e
to
42b8952
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the submission. I've reviewed the first commit and it looks pretty good overall. I pointed out a few minor things inline.
I'll finish the remaining commits tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I've finished reviewing. I discussed it more inline, but this seems to be incorrectly presuming hosts are IPs and that is not necessarily the case at all.
This commit adds support for determining and tracking the type of a network address when constructed. While here, several functions are refactored for easier reading and interpretability. The types are first defined in network.go, and then constructed in netaddress.go. The rest of the changes propagate outward from there. Minimal changes were made to anything related to TorV2, because it will be removed in a future commit.
6ccac1f
to
9e40429
Compare
This commit creates two new functions: EncodeHost and NewNetAddressFromParams. The goal is to allow easier creation of net addresses without needing to resort to DNS lookups. DNS lookups will be removed from addrmgr.
9e40429
to
b085d66
Compare
This heavily references the work started in #2627. However, the work will be broken out into smaller chunks. Ultimately, the goal in the near future is to refactor Addrmgr to remove TorV2 support, and add support for TorV3. However, this PR doesn't include any TorV3 work yet.
The first commit enables tracking of address types, and includes several function refactors to improve readability. The new types are defined in
network.go
, and then constructed innetaddress.go
. The rest of the changes propagate outward from there.The second commit removes TorV2 support.
The third commit adds new functions:
ParseHost
andNewNetAddressFromParams
. These functions will eventually enable two desirable features: