-
Notifications
You must be signed in to change notification settings - Fork 505
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
Refactor/make peer info match geth #7750
base: master
Are you sure you want to change the base?
Conversation
Need rebase |
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.
Pull Request Overview
This PR refactors the admin_peers response to better match geth by restructuring the PeerInfo response and adding protocol-related details.
- Introduces a new optional Enr property with JSON serialization handling.
- Adds properties for Caps, Network (with a new NetworkInfo class), and Protocols in PeerInfo.
- Makes minor adjustments in AdminRpcModule to update node info.
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Nethermind/Nethermind.JsonRpc/Modules/Admin/PeerInfo.cs | Refactored PeerInfo with additional protocol and network details and minor comment improvements |
src/Nethermind/Nethermind.JsonRpc/Modules/Admin/AdminRpcModule.cs | Removed a redundant blank line and added a comment about a repeated call in the constructor |
Files not reviewed (2)
- src/bench_precompiles: Language not supported
- src/tests: Language not supported
Comments suppressed due to low confidence (1)
src/Nethermind/Nethermind.JsonRpc/Modules/Admin/PeerInfo.cs:69
- Using the null-forgiving operator on peer.OutSession may cause a runtime exception if both InSession and OutSession are null. Consider explicitly handling the case where both sessions might be null.
LastSignal = (peer.InSession ?? peer.OutSession!).LastPingUtc.ToString(CultureInfo.InvariantCulture);
// ProtocolInfo [or Protocol] with sub-classes Eth, Snap etc...or just | ||
|
||
|
||
// keep extra info not availibale in get? |
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.
Typo found: 'availibale' should be corrected to 'available'.
// keep extra info not availibale in get? | |
// keep extra info not available in get? |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Fixes #7808
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.