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

Rpc: deprecate getStakeActivation and make inactive_stake consistent #69

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

CriesofCarrots
Copy link

Problem

The RPC endpoint getStakeActivation only looks at the total stake balance for the deactivating and inactive cases. This means that if an active stake account receives a transfer, the amount is not reflected in the "inactive" stake, which is confusing.

Originally here: solana-labs#35116

Summary of Changes

Deprecate this confusing RPC method
Evaluate inactive_stake to the total lamports balance minus effective stake and rent-exempt reserve for all activation cases.

Fixes solana-labs#35111

@CriesofCarrots CriesofCarrots requested a review from t-nelson March 4, 2024 22:03
Copy link

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

nice.

@@ -4091,7 +4063,43 @@ fn rpc_perf_sample_from_perf_sample(slot: u64, sample: PerfSample) -> RpcPerfSam
}
}

// RPC methods deprecated in v1.8
pub mod rpc_deprecated_v1_18 {
Copy link
Author

Choose a reason for hiding this comment

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

I forgot I wrote this code before v1.18 was branched. Rather than edit all these 18s, I'm going to propose backporting to v1.18 -- this is very low risk and small in scope, and backporting will allow us to remove this method altogether in v2.

Choose a reason for hiding this comment

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

Should this also have been removed in #1886?

Copy link
Author

@CriesofCarrots CriesofCarrots Jun 27, 2024

Choose a reason for hiding this comment

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

@steveluscher I included that at first, but realized we didn't deprecate the client methods in this PR. Still considering/hoping to remove in v2.0, but need to figure the best way to handle.

Copy link

mergify bot commented Mar 4, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

@CriesofCarrots CriesofCarrots merged commit 661de5b into anza-xyz:master Mar 5, 2024
36 checks passed
mergify bot pushed a commit that referenced this pull request Mar 5, 2024
#69)

* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo

(cherry picked from commit 661de5b)
CriesofCarrots added a commit that referenced this pull request Mar 5, 2024
#69)

* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo

(cherry picked from commit 661de5b)
CriesofCarrots added a commit that referenced this pull request Mar 6, 2024
…nsistent (backport of #69) (#75)

Rpc: deprecate `getStakeActivation` and make inactive_stake consistent (#69)

* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo

(cherry picked from commit 661de5b)

Co-authored-by: Tyera <[email protected]>
steveluscher added a commit to solana-labs/solana-web3.js that referenced this pull request Jun 28, 2024
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…nsistent (backport of anza-xyz#69) (anza-xyz#75)

Rpc: deprecate `getStakeActivation` and make inactive_stake consistent (anza-xyz#69)

* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo

(cherry picked from commit 661de5b)

Co-authored-by: Tyera <[email protected]>
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
anza-xyz#69)

* Make inactive_stake consistent

* Add rpc_deprecated_v1_18 module

* Move get_stake_activation to deprecated list

* Fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getStakeActivation rpc method incorrect inactive balance
3 participants