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

Add json support for feature sets; also print output after feature list #21905

Merged
merged 2 commits into from
Dec 15, 2021

Conversation

CriesofCarrots
Copy link
Contributor

Problem

The solana feature status feature-set table is super helpful, but not included in json output, so difficult to parse and use.

Summary of Changes

  • Implement json output for feature sets
  • Also, print feature-set output after the feature list, as it's annoying to have to scroll up to find it (this change also jives with the new feature sorting)

Before/after examples below

@CriesofCarrots
Copy link
Contributor Author

Display output:

Before:

$ solana feature status -um

To activate features the stake must be >= 95%
To activate features the RPC nodes must be >= 95%

Tool Feature Set: 3130395986
Software Version             Feature Set  Stake   RPC
1.10.0                         167192737   0.00%  1.36%
1.10.0                        3130395986   0.00%  0.23%  <-- me
1.9.0, 1.9.1                   378846963   0.00%  1.13%
1.8.8                         3435319898   0.00%  0.23%
1.8.6, 1.8.7                   591501692   0.00%  0.90%
1.8.2, 1.8.3, 1.8.5, 1.8.10     52865992  98.54% 92.76%
1.8.1                         1797267350   0.00%  0.23%
1.8.0                         1813598585   0.00%  0.68%
1.7.16, 1.7.17                 140464022   0.00%  0.45%
1.7.15                        2995838076   0.01%  1.36%
1.7.14                        1824749018   0.00%  0.23%
1.7.12                        2013646575   0.00%  0.23%
unknown                          unknown   0.00%  0.23%

Feature                                      | Status                      | Description
E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv | active since slot  41040000 | spl-token multisig fix
...
JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG | inactive                    | disable fees sysvar

Feature activation is not allowed at this time

After:

$ solana feature status -um`
Feature                                      | Status                      | Description
E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv | active since slot  41040000 | spl-token multisig fix
...
JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG | inactive                    | disable fees sysvar

To activate features the stake must be >= 95%
To activate features the RPC nodes must be >= 95%

Tool Feature Set: 3130395986
Software Version             Feature Set  Stake   RPC
1.10.0                        167192737   0.00%  1.36%
1.10.0                       3130395986   0.00%  0.23%  <-- me
1.9.0, 1.9.1                  378846963   0.00%  1.13%
1.8.8                        3435319898   0.00%  0.23%
1.8.6, 1.8.7                  591501692   0.00%  0.90%
1.8.2, 1.8.3, 1.8.5, 1.8.10    52865992  98.51% 92.76%
1.8.1                        1797267350   0.00%  0.23%
1.8.0                        1813598585   0.00%  0.68%
1.7.16, 1.7.17                140464022   0.00%  0.45%
1.7.15                       2995838076   0.01%  1.36%
1.7.14                       1824749018   0.00%  0.23%
1.7.12                       2013646575   0.00%  0.23%
unknown                         unknown   0.00%  0.23%


Feature activation is not allowed at this time

@CriesofCarrots
Copy link
Contributor Author

CriesofCarrots commented Dec 14, 2021

Json output:

Before:

$ solana feature status -um --output json

To activate features the stake must be >= 95%
To activate features the RPC nodes must be >= 95%

Tool Feature Set: 3130395986
Software Version             Feature Set  Stake   RPC
1.10.0                         167192737   0.00%  1.36%
1.10.0                        3130395986   0.00%  0.23%  <-- me
1.9.0, 1.9.1                   378846963   0.00%  1.13%
1.8.8                         3435319898   0.00%  0.23%
1.8.6, 1.8.7                   591501692   0.00%  0.68%
1.8.2, 1.8.3, 1.8.5, 1.8.10     52865992  98.51% 92.99%
1.8.1                         1797267350   0.00%  0.23%
1.8.0                         1813598585   0.00%  0.68%
1.7.16, 1.7.17                 140464022   0.00%  0.45%
1.7.15                        2995838076   0.01%  1.36%
1.7.14                        1824749018   0.00%  0.23%
1.7.12                        2013646575   0.00%  0.23%
unknown                          unknown   0.00%  0.23%

{
  "features": [
    {
      "id": "E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv",
      "description": "spl-token multisig fix",
      "status": "active",
      "sinceSlot": 41040000
    },
    ...
    {
      "id": "JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG",
      "description": "disable fees sysvar",
      "status": "inactive"
    }
  ],
  "featureActivationAllowed": false
}

After:

$ solana feature status -um --output json`
{
  "features": [
    {
      "id": "E5JiFDQCwyC6QfT9REFyMpfK2mHcmv1GUDySU1Ue7TYv",
      "description": "spl-token multisig fix",
      "status": "active",
      "sinceSlot": 41040000
    },
    ...
    {
      "id": "JAN1trEUEtZjgXYzNBYHU9DYd7GnThhXfFP7SzPXkPsG",
      "description": "disable fees sysvar",
      "status": "inactive"
    }
  ],
  "featureActivationAllowed": false,
  "clusterFeatureSets": {
    "toolFeatureSet": 3130395986,
    "featureSets": [
      {
        "softwareVersions": [
          "1.10.0"
        ],
        "featureSet": 167192737,
        "stakePercent": 0.0,
        "rpcPercent": 1.5873017
      },
      {
        "softwareVersions": [
          "1.10.0"
        ],
        "featureSet": 3130395986,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.9.1"
        ],
        "featureSet": 4100269022,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.9.0",
          "1.9.1"
        ],
        "featureSet": 378846963,
        "stakePercent": 0.0,
        "rpcPercent": 1.3605442
      },
      {
        "softwareVersions": [
          "1.8.11"
        ],
        "featureSet": 2385070269,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.8.8"
        ],
        "featureSet": 3435319898,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.8.6"
        ],
        "featureSet": 591501692,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.8.2",
          "1.8.3",
          "1.8.5",
          "1.8.10"
        ],
        "featureSet": 52865992,
        "stakePercent": 98.85620079194285,
        "rpcPercent": 92.74377
      },
      {
        "softwareVersions": [
          "1.8.1"
        ],
        "featureSet": 1797267350,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.8.0"
        ],
        "featureSet": 1813598585,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.7.16",
          "1.7.17"
        ],
        "featureSet": 140464022,
        "stakePercent": 0.0,
        "rpcPercent": 0.45351475
      },
      {
        "softwareVersions": [
          "1.7.15"
        ],
        "featureSet": 2995838076,
        "stakePercent": 0.00963754061711433,
        "rpcPercent": 1.5873017
      },
      {
        "softwareVersions": [
          "1.7.14"
        ],
        "featureSet": 1824749018,
        "stakePercent": 0.00014857921264591759,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "1.7.12"
        ],
        "featureSet": 2013646575,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      },
      {
        "softwareVersions": [
          "unknown"
        ],
        "featureSet": 0,
        "stakePercent": 0.0,
        "rpcPercent": 0.22675738
      }
    ]
  }
}

cli/src/feature.rs Outdated Show resolved Hide resolved
jstarry
jstarry previously approved these changes Dec 14, 2021
Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

Just nits on implementation details, the meat of the changes looks great. Feel free to merge once you address what you feel is appropriate

cli/src/feature.rs Outdated Show resolved Hide resolved
cli/src/feature.rs Outdated Show resolved Hide resolved
cli/src/feature.rs Outdated Show resolved Hide resolved
cli/src/feature.rs Outdated Show resolved Hide resolved
cli/src/feature.rs Show resolved Hide resolved
@mergify mergify bot dismissed jstarry’s stale review December 15, 2021 00:00

Pull request has been modified.

@CriesofCarrots CriesofCarrots force-pushed the feature-status-json branch 2 times, most recently from f44129c to ff6cc9e Compare December 15, 2021 02:29
@CriesofCarrots
Copy link
Contributor Author

Blocked on audit fix: #21911

@CriesofCarrots CriesofCarrots added automerge Merge this Pull Request automatically once CI passes and removed v1.8 labels Dec 15, 2021
@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #21905 (a4f6f2f) into master (7ba27e5) will decrease coverage by 0.0%.
The diff coverage is 0.0%.

@@            Coverage Diff            @@
##           master   #21905     +/-   ##
=========================================
- Coverage    81.2%    81.2%   -0.1%     
=========================================
  Files         516      516             
  Lines      144251   144284     +33     
=========================================
+ Hits       117275   117299     +24     
- Misses      26976    26985      +9     

@mergify mergify bot merged commit dcd2854 into solana-labs:master Dec 15, 2021
mergify bot pushed a commit that referenced this pull request Dec 15, 2021
…st (#21905)

* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation

(cherry picked from commit dcd2854)
mergify bot added a commit that referenced this pull request Dec 15, 2021
…st (#21905) (#21914)

* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation

(cherry picked from commit dcd2854)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
mergify bot pushed a commit that referenced this pull request Dec 17, 2021
…st (#21905)

* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation

(cherry picked from commit dcd2854)
mergify bot added a commit that referenced this pull request Dec 17, 2021
…st (#21905) (#21974)

* Add json support for feature sets; also print output after feature list

* Move stringifying into Display implementation

(cherry picked from commit dcd2854)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
@brooksprumo brooksprumo mentioned this pull request Jan 5, 2022
@CriesofCarrots CriesofCarrots deleted the feature-status-json branch February 26, 2022 21:03
@github-actions
Copy link
Contributor

This PR has been automatically locked since there has not been any activity in past 14 days after it was merged.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes locked PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants