-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 retries to DNS lookup for enode hostnames #8358
Add retries to DNS lookup for enode hostnames #8358
Conversation
66ee0ee
to
2777af1
Compare
@Rjected the retry impl is in place here with some tests. Next I am thinking of adding the relevant retry params to the Please let me know if that approach does / doesn't make sense. Also do you know why I am getting those lint failures? I can't recreate them locally with the same commands. Fixing them crate by crate is slow because of this. |
We're fixing some nightly clippy lints this morning, once that's merged it would probably be good to rebase |
changes are merged, I'll rebase my branch on main |
3510f0f
to
cdfdaff
Compare
just rebased, so feel free to rebase on top of my updated branch |
2777af1
to
9485ba5
Compare
9485ba5
to
03bd94c
Compare
d8cc0c3
to
bec9db0
Compare
3b68660
to
65c8678
Compare
65c8678
to
930d982
Compare
@Rjected the code for retries and CLI args is in place. I moved the dns resolve fn into DNSNodeRecord scope also. The |
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 start!
E.G. perhaps --retry-count 10 and --retry-ms 500 instead
yeah I think this would be better, see comment
Flags updated, parsing logic removed 👍 |
@Rjected are we planning on adding pub struct Config {
// ...
/// Configuration for the discovery service.
pub peers: PeersConfig,
// ...
}
// ...
pub struct PeersConfig {
// ...
pub trusted_nodes: HashSet<NodeRecord>,
// ...
pub basic_nodes: HashSet<NodeRecord>,
// ...
} EDIT: We might prefer to consolidate the DNSNodeRecord type into NodeRecord instead. I believe its possible if we update these getter fns (alongside a few other changes) to resolve the hostname to an IP if it hasn't been done yet: impl NodeRecord {
// ...
/// The TCP socket address of this node
#[must_use]
pub fn tcp_addr(&self) -> SocketAddr {
SocketAddr::new(self.address, self.tcp_port)
}
/// The UDP socket address of this node
#[must_use]
pub fn udp_addr(&self) -> SocketAddr {
SocketAddr::new(self.address, self.udp_port)
}
} |
While having less node record types is desirable, if we do this we need to make sure that we do not accept domain node records from discovery - these domain records should really only be used for trusted peers.
That would make sense, although I can probably just do that in #8188 |
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.
lgtm, thanks!
077f686
into
paradigmxyz:dan/dns-resolution-on-enodes
Relates to #8188
DNSNodeRecord::