Skip to content
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

Merged
merged 13 commits into from
Oct 20, 2022
Merged

Conversation

mm-near
Copy link
Contributor

@mm-near mm-near commented Oct 4, 2022

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).

@mm-near mm-near requested a review from a team as a code owner October 4, 2022 11:47
@mm-near mm-near requested review from mina86 and pompon0 October 4, 2022 11:47
})
.collect::<Vec<_>>();

peer_states_view.sort_by(|a, b| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sort by key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -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"}
Copy link
Contributor

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

Copy link
Contributor

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:

fn make_peer_info(from: near_network::types::PeerInfo) -> near_client_primitives::types::PeerInfo {

Copy link
Contributor Author

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 {
Copy link
Contributor

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>;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@near-bulldozer near-bulldozer bot merged commit d7626c0 into master Oct 20, 2022
@near-bulldozer near-bulldozer bot deleted the 0927_more_peers branch October 20, 2022 15:37
nikurt pushed a commit that referenced this pull request Oct 25, 2022
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).
nikurt pushed a commit that referenced this pull request Nov 7, 2022
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).
nikurt pushed a commit that referenced this pull request Nov 9, 2022
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants