rpc, cli: Add client ID field to cluster nodes#7817
Conversation
|
@steviez would you know the right person to review this? |
Edit: I didn't get the chance to look but seems like Alan nominated himself |
There was a problem hiding this comment.
This looks great. I only found one minor issue with the formatting of the header.
Changing the RPC API response could break clients that depend on not receiving extra, unknown fields in the response but it looks like we've already done that so many times that it would be silly to draw the line here.
Thank you for the PR!
joncinque
left a comment
There was a problem hiding this comment.
Thanks for your contribution! Can you rebase your branch? There were some other CLI related changes recently. After that, we should be able to land this soon
13000a8 to
3a18540
Compare
|
I removed the extra space @joncinque, but notice, this PR didn't introduced the extra space, it already existed, if you look you will see more extra spaces, do you want to me remove them in this PR? Maybe it would be better a new PR so it would be clear what the change is. |
3a18540 to
f97de8c
Compare
|
Sorry for the late reply, I meant to remove only the extra spaces added in this PR, so your change looks good to me! I'll let @alannza shepherd the PR through CI and all that, there are some clippy errors to be fixed |
f97de8c to
254b6ae
Compare
792a75b to
de3cb96
Compare
Expose client ID in getClusterNodes RPC response and add CLI support for displaying and sorting validators by client ID.
de3cb96 to
0a97cb4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #7817 +/- ##
=========================================
- Coverage 83.2% 83.2% -0.1%
=========================================
Files 845 846 +1
Lines 319902 319999 +97
=========================================
+ Hits 266473 266500 +27
- Misses 53429 53499 +70 🚀 New features to boost your workflow:
|
|
@mcintyre94 can you take a look whenever you have a chance? After the previous approval, I rebased, updated a test for the new field, and added a changelog entry |
|
why did we put the discriminant on the wire instead of the string representation? |
No particular reason other than simplicity, but we can change that pretty easily -- for my own info, what's the reason to prefer a string for the field? For any enhancements in the future? |
|
just can't imagine that people know what the number means and not particularly keen on exposing the crate to public api |
|
People have to interpret all sorts of bytes from frontends, so you'd be surprised 😅 Anyway, looks like |
|
i think we abuse i already have a cleanup coming for that module tho. just need to land something that i want to bp first. we can fix this afterward |
|
Considering it's a new RPC response field, I want to fix it before it lands in a release. I can go with abusing |
#### Problem The client id was added in #7817, but the returned field is a u16, which requires clients to maintain the mapping from number to string. They shouldn't need to do that work. #### Summary of changes Change the reported field to be a string instead. The spacing for printing the field needs to be widened to 14 characters, to accommodate `Unknown(u16::MAX)`, and the CLI field can just become a string.
Problem
The client ID field in validator version information is not exposed through the RPC interface or CLI, making it impossible to analyze validator client diversity on the network. Users cannot see which client implementation (Agave, Jito, Firedancer, etc.) validators are running.
Summary of Changes
client_idfield toRpcContactInfoin getClusterNodes RPC responseVersion::clientfield public to allow access from RPC layerCliClientIdtype for parsing and displaying client IDs in CLI--sort=client-idoption for sorting validatorsFixes #