-
Notifications
You must be signed in to change notification settings - Fork 663
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
Added peer store information to network page #7761
Conversation
}) | ||
.collect::<Vec<_>>(); | ||
|
||
peer_states_view.sort_by(|a, b| { |
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.
sort by key?
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.
done.
chain/network/Cargo.toml
Outdated
@@ -50,6 +50,7 @@ time.workspace = true | |||
delay-detector = { path = "../../tools/delay-detector" } | |||
near-o11y = { path = "../../core/o11y" } | |||
near-crypto = { path = "../../core/crypto" } | |||
near-client-primitives = {path = "../client-primitives"} |
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 we avoid this deps? This adds chain&client stuff to the transitive closure of network deps
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.
+1, you can add a new public type to near-network, and then translate it to an isomorphic type in client, like here:
nearcore/chain/client/src/client_actor.rs
Line 779 in 017b433
fn make_peer_info(from: near_network::types::PeerInfo) -> near_client_primitives::types::PeerInfo { |
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.
done.
@@ -1722,3 +1727,34 @@ impl Handler<PeerManagerMessageRequest> for PeerManagerActor { | |||
self.handle_peer_manager_message(msg, ctx) | |||
} | |||
} | |||
|
|||
impl Handler<NetworkDebugStatus> for PeerManagerActor { |
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.
Once you remove the dependency on client_primitives, rename "NetworkDebugStatus, DebugStatusResponse" to
"GetDebugStatus, DebugStatus":
- "Network" is implied by the package name
- the request name should be either a verb, or end with "Request"
- "Response" suffix is redundant as long as the response type can be interpreted on its own (i.e. without the request).
@@ -1722,3 +1727,34 @@ impl Handler<PeerManagerMessageRequest> for PeerManagerActor { | |||
self.handle_peer_manager_message(msg, ctx) | |||
} | |||
} | |||
|
|||
impl Handler<NetworkDebugStatus> for PeerManagerActor { | |||
type Result = Result<DebugStatusResponse, StatusError>; |
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.
It seems to me that "type Result = DebugStatusResponse" would be enough here, since this call never returns an error.
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.
done.
Display a list of peers stored in peer store - together with information on when we attempted to connect to them. You can see it working in: http://34.147.53.32:3030/debug/pages/network_info This is at the bottom of the page - and you have to click the button to fetch this info (as this is often over 10k peers - and loading takes a while).
Display a list of peers stored in peer store - together with information on when we attempted to connect to them. You can see it working in: http://34.147.53.32:3030/debug/pages/network_info This is at the bottom of the page - and you have to click the button to fetch this info (as this is often over 10k peers - and loading takes a while).
Display a list of peers stored in peer store - together with information on when we attempted to connect to them. You can see it working in: http://34.147.53.32:3030/debug/pages/network_info This is at the bottom of the page - and you have to click the button to fetch this info (as this is often over 10k peers - and loading takes a while).
Display a list of peers stored in peer store - together with information on when we attempted to connect to them.
You can see it working in: http://34.147.53.32:3030/debug/pages/network_info
This is at the bottom of the page - and you have to click the button to fetch this info (as this is often over 10k peers - and loading takes a while).