-
Notifications
You must be signed in to change notification settings - Fork 77
feat(node): implement the reachability check module #3270
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
base: reachability
Are you sure you want to change the base?
feat(node): implement the reachability check module #3270
Conversation
7c3836c to
12fa5fb
Compare
| use futures::channel::oneshot; | ||
| use igd_next::SearchOptions; | ||
| use std::error::Error; | ||
| use std::net::IpAddr; |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
| fn test_reachability_status_not_reachable_without_upnp() { | ||
| let mut reason_map = std::collections::HashMap::new(); | ||
| let _ = reason_map.insert( | ||
| ("127.0.0.1:8080".parse().unwrap(), false), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
| fn test_reachability_status_not_reachable_with_upnp() { | ||
| let mut reason_map = std::collections::HashMap::new(); | ||
| let _ = reason_map.insert( | ||
| ("127.0.0.1:8080".parse().unwrap(), true), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
|
|
||
| let mut reason_map1 = std::collections::HashMap::new(); | ||
| let _ = reason_map1.insert( | ||
| ("127.0.0.1:8080".parse().unwrap(), true), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
| ); | ||
| let mut reason_map2 = std::collections::HashMap::new(); | ||
| let _ = reason_map2.insert( | ||
| ("127.0.0.1:8080".parse().unwrap(), false), |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
integration - Split the `async fn Bootstrap::new` method into two methods, where the `new` is made a "sync" method and `async fn new_with_preloaded_addrs` retains the same functionality as the old new method. - The `new_with_preloaded_addrs` method is only required inside clients which tries to pre-populate its RT before starting the libp2p driver. - Introduces `is_addr_queue_empty`, as it will be used by the reachability check implementation - Deprecate `try_next_dial_addr` as it is just a copy of `next_addr`
12fa5fb to
9032fca
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.
devskim found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Ontop of #3268. This PR is just the implementation of the reachability module. The actual integration with antctl, antnode and launchpad will be done as separate PRs.
This workflow checks if a node can receive direct inbound connections from other peers on the network. If a node can't receive connections, it won't be able to participate in the network properly, so we prevent it from starting.
The workflow tries one network listener at a time, with up to 3 attempts per listener: