-
Notifications
You must be signed in to change notification settings - Fork 313
addrmgr: Decouple address manager from wire.NetAddress #2596
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
Conversation
6e4af32 to
fb75e54
Compare
fb75e54 to
4c04c7b
Compare
dnldd
left a comment
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.
Nice, looks good overall.
rstaudt2
left a comment
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.
Great to see more test coverage being added as part of this decoupling!
4c04c7b to
af86580
Compare
|
Since there are changes in this PR that were not in the initial commits, I want to call out some high-level differences although most of the functional changes are the same plus a little more to fully decouple the addrmgr module. The aim was to help make reviewing it easier since a lot of changes were squashed into a single commit prevoiously
|
rstaudt2
left a comment
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.
Updates look good to me! I also ran ./run_tests.sh on each commit and tested various scenarios manually and did not see any issues.
e3378ea to
c2034bf
Compare
davecgh
left a comment
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 taking this on! I'll be reviewing this in stages. First round of comments inline.
36187b2 to
48de119
Compare
48de119 to
1a398c5
Compare
dnldd
left a comment
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.
Minor comment related issues to fix but overall I think this is good to go.
51404cf to
edd4cea
Compare
davecgh
left a comment
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.
I've finished reviewing the remaining pieces. Very nice job overall! I've called out a few minor things inline, but overall the changes make sense and the increased test coverage is a welcome change. I also like how various methods like GroupKey are now defined on the new address type itself instead of being standalone funcs.
The only remaining thing that I think really isn't correct is the addition of the ServiceFlag type as called out inline.
Once these last bits are resolved, I'll do some live testing and barring any issues found there, this will be good to go from my viewpoint. Thanks for your work on this and to everyone who helped review.
edd4cea to
7bf736c
Compare
This change increases test coverage within the address manager in addition to improving comments throughout related code. - Add tests for method ValidatePeerNa. - Add tests for method HostToNetAddress. - Add additional tests for methods Connected, Attempt, and Good. - Improve coverage around local address handling. - Improve coverage for internal behavior between tried and new buckets.
This commit removes unnecessary tests cases around the test helper addAddressByIP. Since the values passed to this method are always valid, there is no need for the error handling around it since that results in code that serves to test a test helper.
This commit modifies the IP network checks to accept a net.IP rather than a wire.NetAddress.
This commit renames the address manager's type NetworkAddress to NetAddressType and also introduces a new NetAddressReach type.
7bf736c to
e121d36
Compare
This change removes the wire NetAddress type as a dependency of the address manager module by introducing a new NetAddress type owned by the address manager, in preparation for upcoming changes to the wire protocol. - Introduce a new NetAddress type in the address manager. - Modify KnownAddress struct to use address manager NetAddress. - Replace DeserializeNetAddress with newNetAddressFromString.
e121d36 to
d11fb35
Compare
davecgh
left a comment
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.
I've reviewed all the updates. This looks good to go!
This change decouples the address manager's internal handling of network addresses to use a type owned by the address manager.