Skip to content

rpc, cli: Add client ID field to cluster nodes#7817

Merged
joncinque merged 1 commit into
anza-xyz:masterfrom
leafaar:add-client-id
Feb 10, 2026
Merged

rpc, cli: Add client ID field to cluster nodes#7817
joncinque merged 1 commit into
anza-xyz:masterfrom
leafaar:add-client-id

Conversation

@leafaar
Copy link
Copy Markdown

@leafaar leafaar commented Sep 1, 2025

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

  • Add client_id field to RpcContactInfo in getClusterNodes RPC response
  • Make Version::client field public to allow access from RPC layer
  • Add CliClientId type for parsing and displaying client IDs in CLI
  • Add client ID column to validator list display
  • Support --sort=client-id option for sorting validators
  • Add stake distribution breakdown by client ID

Fixes #

@mergify mergify Bot requested a review from a team September 1, 2025 17:00
@mergify
Copy link
Copy Markdown

mergify Bot commented Sep 1, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/kit (example)

Thank you for keeping the RPC clients in sync with the server API @leafaar.

@0xbrw
Copy link
Copy Markdown

0xbrw commented Sep 2, 2025

@steviez would you know the right person to review this?

@steviez
Copy link
Copy Markdown

steviez commented Sep 9, 2025

@steviez would you know the right person to review this?

Probably a generalist like myself; can try to take a look later this week.

Edit: I didn't get the chance to look but seems like Alan nominated himself

alannza
alannza previously approved these changes Dec 3, 2025
Copy link
Copy Markdown

@alannza alannza left a comment

Choose a reason for hiding this comment

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

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!

Comment thread cli-output/src/cli_output.rs Outdated
Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

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

Comment thread cli-output/src/cli_output.rs Outdated
Comment thread cli-output/src/cli_output.rs Outdated
Comment thread cli-output/src/cli_output.rs Outdated
@leafaar
Copy link
Copy Markdown
Author

leafaar commented Dec 5, 2025

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.

Comment thread cli-output/src/cli_output.rs Outdated
Comment thread cli-output/src/cli_output.rs
@leafaar leafaar requested review from alannza and joncinque December 5, 2025 06:43
@joncinque joncinque added the CI Pull Request is ready to enter CI label Dec 5, 2025
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Dec 5, 2025
@joncinque
Copy link
Copy Markdown

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

@joncinque joncinque added the CI Pull Request is ready to enter CI label Feb 4, 2026
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Feb 4, 2026
@joncinque joncinque force-pushed the add-client-id branch 2 times, most recently from 792a75b to de3cb96 Compare February 4, 2026 22:59
@joncinque joncinque added the CI Pull Request is ready to enter CI label Feb 4, 2026
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Feb 4, 2026
@joncinque joncinque self-assigned this Feb 4, 2026
@joncinque joncinque removed the request for review from alannza February 4, 2026 22:59
Expose client ID in getClusterNodes RPC response and add CLI support
for displaying and sorting validators by client ID.
@joncinque joncinque added the CI Pull Request is ready to enter CI label Feb 4, 2026
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Feb 4, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 9.90099% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.2%. Comparing base (01159e4) to head (0a97cb4).
⚠️ Report is 813 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joncinque joncinque requested a review from mcintyre94 February 5, 2026 00:27
@joncinque
Copy link
Copy Markdown

@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

Copy link
Copy Markdown
Member

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@joncinque joncinque added this pull request to the merge queue Feb 10, 2026
Merged via the queue into anza-xyz:master with commit d527427 Feb 10, 2026
52 checks passed
@t-nelson
Copy link
Copy Markdown

why did we put the discriminant on the wire instead of the string representation?

@joncinque
Copy link
Copy Markdown

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?

@t-nelson
Copy link
Copy Markdown

just can't imagine that people know what the number means and not particularly keen on exposing the crate to public api

@joncinque
Copy link
Copy Markdown

People have to interpret all sorts of bytes from frontends, so you'd be surprised 😅

Anyway, looks like Display isn't implemented on the enum -- do you want the exact strings that are there? SolanaLabs / JitoLabs / Frankendancer / Agave / AgavePaladin / Firedancer / AgaveBam / Sig / "Unknown(<INSERT_NUMBER_HERE>)"

@t-nelson
Copy link
Copy Markdown

i think we abuse Debug for that elsewhere

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

@joncinque
Copy link
Copy Markdown

Considering it's a new RPC response field, I want to fix it before it lands in a release. I can go with abusing Debug and keeping the changes to RPC

github-merge-queue Bot pushed a commit that referenced this pull request Feb 24, 2026
#### 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants