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
Fix nil pointer dereference #4884
Conversation
## Motivation Closes #4778 Note that this is in a draft state because it needs spacemeshos/api#258 to be merged and I guess a release of the API package, before it can be merged. I plan to remove the replace directive for the api in the mod file when, the api has been released. ## Changes Adds a new streaming API endpoint to the node service to return info about connected peers. Note this PR changes the PostProviderID field to be exported to allow for config to be easily serialised/deserialised in order to perform a deep copy. ## Test Plan Added a test, the test doesn't check whether tags are since that part would make things a bit trickier. However through manual checking I can see that tags are being assigned. ```shell $ grpc_cli call localhost:9092 spacemesh.v1.NodeService.PeerInfo '' connecting to localhost:9092 peers { id: "12D3KooWRkZMjGNrQfRyeKQC9U58cUwAfyQMtjNsupixkBFag8AY" connections { address: "/ip4/34.150.215.241/tcp/5000" uptime: "29.348584085s" outbound: true } tags: "bootnode" } Rpc succeeded with OK status ``` ## DevOps Notes <!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases --> - [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources) - [x] This PR does not affect public APIs - [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.) - [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
Codecov Report
@@ Coverage Diff @@
## develop #4884 +/- ##
=========================================
- Coverage 76.8% 76.8% -0.1%
=========================================
Files 261 261
Lines 30160 30235 +75
=========================================
+ Hits 23189 23224 +35
- Misses 5476 5508 +32
- Partials 1495 1503 +8
|
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.
How about a unit test to cover it?
5569b44
to
a910104
Compare
already included in the change 🙂 |
a910104
to
ca76f04
Compare
Motivation
Latest release causes a
nil
pointer dereference error for some users:Changes
Test Plan
TODO
DevOps Notes