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

Extend getpeers RPC method to provide useragent and last known height #3481

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

EdgeDLT
Copy link
Contributor

@EdgeDLT EdgeDLT commented Jun 6, 2024

Close #3480

I have OldPeerHeight because I followed peers.go as an example, but I expect it may be pointless here. Please remove if so.

pkg/network/server.go Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/services/rpcsrv/server.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

The PR was updated, so it's only a part of my review.

docs/rpc.md Outdated Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peer_heights.go Outdated Show resolved Hide resolved
pkg/network/server.go Show resolved Hide resolved
pkg/network/server.go Show resolved Hide resolved
pkg/services/rpcsrv/server.go Outdated Show resolved Hide resolved
pkg/network/server.go Show resolved Hide resolved
@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 17, 2024

@AnnaShaleva @roman-khimov Removed getpeerheights and extended getpeers as requested. Please review.

@EdgeDLT EdgeDLT changed the title Add getpeerheights RPC method Extend getpeers RPC method to provide useragent and last known height Jun 17, 2024
@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 17, 2024

Re-pushed most recent commit with sign-off because I forgot :)

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Please, add neorpc: prefix to the commit message. Ref. https://github.com/nspcc-dev/.github/blob/master/git.md#commit-messages.

docs/rpc.md Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
docs/rpc.md Outdated Show resolved Hide resolved
@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 17, 2024

@AnnaShaleva Thanks Anna, changes made.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM!

pkg/network/server.go Show resolved Hide resolved
pkg/network/server.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
@EdgeDLT EdgeDLT force-pushed the getPeerHeights branch 2 times, most recently from 54c91d9 to 84808b8 Compare June 18, 2024 17:40
@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 18, 2024

@AnnaShaleva Think I got there eventually. Sorry for the trouble, I do very much appreciate the chance to practice a little :)

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM, @roman-khimov, could you take a look?

pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
pkg/neorpc/result/peers.go Outdated Show resolved Hide resolved
docs/rpc.md Outdated Show resolved Hide resolved
@AnnaShaleva
Copy link
Member

DCO check is failing, but it's just too strict. I think we may skip it for this commit since it has a valid sign-off note:

84808b85889db747677872814431a8c79b9da12a    Expected "edgedlt <edgedlt@protonmail.com>", but got "Brett Rhodes <edgedlt@protonmail.com>".

@AnnaShaleva
Copy link
Member

@EdgeDLT, could you please fix the latest comments? There's not much left, and then we can merge.

Signed-off-by: edgedlt <edgedlt@protonmail.com>
@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 27, 2024

@AnnaShaleva Pushed the changes.

AnnaShaleva
AnnaShaleva previously approved these changes Jun 27, 2024
@AnnaShaleva AnnaShaleva dismissed their stale review June 27, 2024 10:09

Some tests are failing.

@AnnaShaleva
Copy link
Member

@EdgeDLT, could you please fix the tests? It can be checked with make test.

2024-06-27T09:50:59.3271050Z         --- FAIL: TestRPCClients/Client/getpeers (0.01s)
2024-06-27T09:50:59.3272599Z             --- FAIL: TestRPCClients/Client/getpeers/positive (0.01s)

@EdgeDLT
Copy link
Contributor Author

EdgeDLT commented Jun 27, 2024

@AnnaShaleva Sorry for the oversight, fixed!

Signed-off-by: edgedlt <edgedlt@protonmail.com>
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 82.14286% with 5 lines in your changes missing coverage. Please review.

Project coverage is 86.12%. Comparing base (cf4d4a2) to head (ba4ebbd).
Report is 21 commits behind head on master.

Files Patch % Lines
pkg/network/server.go 28.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3481      +/-   ##
==========================================
- Coverage   86.19%   86.12%   -0.07%     
==========================================
  Files         331      331              
  Lines       38482    38541      +59     
==========================================
+ Hits        33168    33193      +25     
- Misses       3782     3819      +37     
+ Partials     1532     1529       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnnaShaleva AnnaShaleva merged commit ce1edda into nspcc-dev:master Jun 28, 2024
19 of 21 checks passed
@EdgeDLT EdgeDLT deleted the getPeerHeights branch June 28, 2024 08:52
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.

Add RPC method for extended information on connected peers
3 participants