-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add external_addr to config (network section) #2035
Conversation
I think that diagram is a bit confusing, maybe we should say "Inbound Peer Connections to the zebrad listener port". |
#2036 might help here, I updated the docs. |
Looks like rustfmt doesn't like the space on one line, causing rustfmt job to fail |
address_from: (our_services, config.listen_addr), | ||
address_from: ( | ||
our_services, | ||
config.external_addr.unwrap_or(config.listen_addr), |
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.
Can you turn this into an external_addr()
method on Config
?
(And make Config.external_addr
private or pub(crate)
.)
That way, we'll always get the external address the right way.
(We'll also want to use the external address in #1892 and similar tickets.)
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 think we'll want to have separate IPv4 and IPv6 external addresses, and choose the external address based on the connection's IP version. (See #1890.)
We'll also want to:
- add the external address for the connection's IP version to Zebra's
Version
messages - add both external addresses to Zebra's
Peers
responses - fallback to the internal address if there is no external address
but that depends on #2033 merging:
https://github.com/ZcashFoundation/zebra/pull/2033/files#diff-3f14971a74a109913a4809bd1a77f4e0145e1edfa72aaded8f1fdcb2cc45f4f1R243-R244
As part of that change, we'll want to make the AddressBook
ignore any null addresses (0.0.0.0
or [::]
).
This comment has been minimized.
This comment has been minimized.
I'm going to mark this PR as draft until the Zebra team decides which changes we actually need here. |
We might merge this as part of ticket #3117 when we get to it. |
Motivation
Allow
zebrad
advertise address specified by user.Solution
Add
external_addr
to config (network section).listen_addr
added to AddressBook. Can you help with this?zebra/zebra-network/src/peer_set/candidate_set.rs
Line 46 in 2cecd52
The code in this pull request has:
Related Issues
#1890
Follow Up Work
Allow set only IP address in
listen_addr
(default port fromNetwork
enum).zebra/zebra-network/src/peer_set/initialize.rs
Lines 127 to 128 in 2cecd52