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

Deprecate MINIMUM_STAKE_DELEGATION #24329

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions programs/stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ pub(crate) fn get_minimum_delegation(_feature_set: &FeatureSet) -> u64 {
// If/when the minimum delegation amount is changed, the `feature_set` parameter will be used
// to chose the correct value. And since the MINIMUM_STAKE_DELEGATION constant cannot be
// removed, use it here as to not duplicate magic constants.
#[allow(deprecated)]
solana_sdk::stake::MINIMUM_STAKE_DELEGATION
brooksprumo marked this conversation as resolved.
Show resolved Hide resolved
}
5 changes: 5 additions & 0 deletions sdk/program/src/stake/deprecated.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[deprecated(
since = "1.11.0",
note = "please use `solana_program::stake::tools::get_minimum_delegation()` instead"
)]
pub const MINIMUM_STAKE_DELEGATION: u64 = 1;
7 changes: 3 additions & 4 deletions sdk/program/src/stake/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ pub mod instruction;
pub mod state;
pub mod tools;

mod deprecated;
pub use deprecated::*;

pub mod program {
crate::declare_id!("Stake11111111111111111111111111111111111111");
}

// NOTE: This constant will be deprecated soon; if possible, use
// `solana_stake_program::get_minimum_delegation()` instead.
pub const MINIMUM_STAKE_DELEGATION: u64 = 1;

/// The minimum number of epochs before stake account that is delegated to a delinquent vote
/// account may be unstaked with `StakeInstruction::DeactivateDelinquent`
pub const MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION: usize = 5;