Skip to content

Commit dd15884

Browse files
authored
remove solana-program and solana-sdk from solana-stake-program (anza-xyz#4719)
* remove solana-sdk from solana-stake-program * remove solana-program from solana-stake-program * remove solana_program after rebase * remove redundant import * missing feature activation in compute-budget-instruction * missing feature activation in solana-entry * missing feature in stake program dev deps * missing feature activations in runtime-transaction * missing feature activation in compute-budget-instruction * missing feature activation in cost-model * missing feature activations in stake program deps * trigger ci
1 parent 7444820 commit dd15884

File tree

15 files changed

+67
-65
lines changed

15 files changed

+67
-65
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compute-budget-instruction/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ log = { workspace = true }
1414
solana-borsh = { workspace = true }
1515
solana-builtins-default-costs = { workspace = true, features = ["svm-internal"] }
1616
solana-compute-budget = { workspace = true }
17-
solana-compute-budget-interface = { workspace = true }
17+
solana-compute-budget-interface = { workspace = true, features = ["borsh"] }
1818
solana-feature-set = { workspace = true }
1919
solana-instruction = { workspace = true }
2020
solana-packet = { workspace = true }
@@ -39,7 +39,7 @@ solana-message = { workspace = true }
3939
solana-program = { workspace = true }
4040
solana-signer = { workspace = true }
4141
solana-system-interface = { workspace = true }
42-
solana-transaction = { workspace = true }
42+
solana-transaction = { workspace = true, features = ["blake3"] }
4343

4444
[package.metadata.docs.rs]
4545
targets = ["x86_64-unknown-linux-gnu"]

cost-model/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ solana-cost-model = { path = ".", features = ["dev-context-only-utils"] }
5959
solana-instruction = { workspace = true }
6060
solana-keypair = { workspace = true }
6161
solana-logger = { workspace = true }
62+
solana-pubkey = { workspace = true, features = ["rand"] }
6263
solana-reserved-account-keys = { workspace = true }
6364
solana-runtime-transaction = { workspace = true, features = [
6465
"dev-context-only-utils",

entry/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ solana-reserved-account-keys = { workspace = true }
4141
solana-signature = { workspace = true }
4242
solana-signer = { workspace = true }
4343
solana-system-transaction = { workspace = true }
44+
solana-transaction = { workspace = true, features = ["verify"] }
4445

4546
[lib]
4647
crate-type = ["lib"]

programs/sbf/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

programs/stake/Cargo.toml

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@ solana-bincode = { workspace = true }
1717
solana-clock = { workspace = true }
1818
solana-config-program = { workspace = true }
1919
solana-feature-set = { workspace = true }
20+
solana-genesis-config = { workspace = true }
2021
solana-instruction = { workspace = true }
2122
solana-log-collector = { workspace = true }
2223
solana-native-token = { workspace = true }
2324
solana-packet = { workspace = true }
24-
solana-program = { workspace = true }
2525
solana-program-runtime = { workspace = true }
26-
solana-pubkey = { workspace = true }
26+
solana-pubkey = { workspace = true, features = ["sha2"] }
2727
solana-rent = { workspace = true }
28-
solana-sdk = { workspace = true }
2928
solana-sdk-ids = { workspace = true }
29+
solana-stake-interface = { workspace = true }
3030
solana-sysvar = { workspace = true }
31-
solana-transaction-context = { workspace = true }
31+
solana-transaction-context = { workspace = true, features = ["bincode"] }
3232
solana-type-overrides = { workspace = true }
33-
solana-vote-interface = { workspace = true }
33+
solana-vote-interface = { workspace = true, features = ["bincode"] }
3434

3535
[dev-dependencies]
3636
assert_matches = { workspace = true }
@@ -40,6 +40,7 @@ solana-compute-budget = { workspace = true }
4040
solana-epoch-rewards = { workspace = true }
4141
solana-epoch-schedule = { workspace = true }
4242
solana-logger = { workspace = true }
43+
solana-pubkey = { workspace = true, features = ["rand"] }
4344
solana-sysvar-id = { workspace = true }
4445
solana-vote-program = { workspace = true, default-features = false }
4546
test-case = { workspace = true }

programs/stake/benches/stake.rs

+11-13
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,24 @@ use {
55
solana_clock::{Clock, Epoch},
66
solana_feature_set::FeatureSet,
77
solana_instruction::AccountMeta,
8-
solana_program::{
9-
stake::{
10-
instruction::{
11-
self, AuthorizeCheckedWithSeedArgs, AuthorizeWithSeedArgs, LockupArgs,
12-
LockupCheckedArgs, StakeInstruction,
13-
},
14-
stake_flags::StakeFlags,
15-
state::{Authorized, Lockup, StakeAuthorize, StakeStateV2},
16-
},
17-
vote::state::{VoteState, VoteStateVersions},
18-
},
198
solana_program_runtime::invoke_context::mock_process_instruction,
209
solana_pubkey::Pubkey,
2110
solana_rent::Rent,
2211
solana_sdk_ids::sysvar::{clock, rent, stake_history},
12+
solana_stake_interface::{
13+
instruction::{
14+
self, AuthorizeCheckedWithSeedArgs, AuthorizeWithSeedArgs, LockupArgs,
15+
LockupCheckedArgs, StakeInstruction,
16+
},
17+
stake_flags::StakeFlags,
18+
state::{Authorized, Lockup, StakeAuthorize, StakeStateV2},
19+
},
2320
solana_stake_program::{
2421
stake_instruction,
2522
stake_state::{Delegation, Meta, Stake},
2623
},
2724
solana_sysvar::stake_history::StakeHistory,
25+
solana_vote_interface::state::{VoteState, VoteStateVersions},
2826
solana_vote_program::vote_state,
2927
std::sync::Arc,
3028
};
@@ -624,7 +622,7 @@ fn bench_deactivate_delinquent(c: &mut Criterion) {
624622

625623
// reference vote account has been consistently voting
626624
let mut vote_state = VoteState::default();
627-
for epoch in 0..=solana_program::stake::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION {
625+
for epoch in 0..=solana_stake_interface::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION {
628626
vote_state.increment_credits(epoch as Epoch, 1);
629627
}
630628
let reference_vote_address = Pubkey::new_unique();
@@ -660,7 +658,7 @@ fn bench_deactivate_delinquent(c: &mut Criterion) {
660658
test_setup.add_account(
661659
clock::id(),
662660
create_account_shared_data_for_test(&Clock {
663-
epoch: solana_program::stake::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION as u64,
661+
epoch: solana_stake_interface::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION as u64,
664662
..Clock::default()
665663
}),
666664
);

programs/stake/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//! carries variables that the stake program cares about
33
#[deprecated(
44
since = "1.8.0",
5-
note = "Please use `solana_sdk::stake::config` or `solana_program::stake::config` instead"
5+
note = "Please use `solana_stake_interface::config` instead"
66
)]
7-
pub use solana_program::stake::config::*;
7+
pub use solana_stake_interface::config::*;
88
use {
99
bincode::deserialize,
1010
solana_account::{AccountSharedData, ReadableAccount, WritableAccount},
1111
solana_config_program::{create_config_account, get_config_data},
12-
solana_sdk::genesis_config::GenesisConfig,
12+
solana_genesis_config::GenesisConfig,
1313
solana_transaction_context::BorrowedAccount,
1414
};
1515

programs/stake/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#![allow(clippy::arithmetic_side_effects)]
33
#[deprecated(
44
since = "1.8.0",
5-
note = "Please use `solana_sdk::stake::program::id` or `solana_program::stake::program::id` instead"
5+
note = "Please use `solana_sdk_ids::sysvar::stake::id` instead"
66
)]
77
pub use solana_sdk_ids::stake::{check_id, id};
88
use {
99
solana_feature_set::{self as feature_set, FeatureSet},
10+
solana_genesis_config::GenesisConfig,
1011
solana_native_token::LAMPORTS_PER_SOL,
11-
solana_sdk::genesis_config::GenesisConfig,
1212
};
1313

1414
pub mod config;

programs/stake/src/points.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
use {
55
solana_clock::Epoch,
66
solana_instruction::error::InstructionError,
7-
solana_program::stake::state::{Delegation, Stake, StakeStateV2},
87
solana_pubkey::Pubkey,
8+
solana_stake_interface::state::{Delegation, Stake, StakeStateV2},
99
solana_sysvar::stake_history::StakeHistory,
1010
solana_vote_interface::state::VoteState,
1111
std::cmp::Ordering,

programs/stake/src/rewards.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use {
99
solana_account::{state_traits::StateMut, AccountSharedData, WritableAccount},
1010
solana_clock::Epoch,
1111
solana_instruction::error::InstructionError,
12-
solana_program::stake::{
13-
instruction::StakeError,
12+
solana_stake_interface::{
13+
error::StakeError,
1414
state::{Stake, StakeStateV2},
1515
},
1616
solana_sysvar::stake_history::StakeHistory,

programs/stake/src/stake_instruction.rs

+19-19
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ use {
77
log::*,
88
solana_bincode::limited_deserialize,
99
solana_instruction::error::InstructionError,
10-
solana_program::stake::{
11-
instruction::{LockupArgs, StakeError, StakeInstruction},
12-
program::id,
13-
state::{Authorized, Lockup},
14-
},
1510
solana_program_runtime::{
1611
declare_process_instruction, sysvar_cache::get_sysvar_with_account_check,
1712
},
1813
solana_pubkey::Pubkey,
14+
solana_stake_interface::{
15+
error::StakeError,
16+
instruction::{LockupArgs, StakeInstruction},
17+
program::id,
18+
state::{Authorized, Lockup},
19+
},
1920
solana_transaction_context::{IndexOfAccount, InstructionContext, TransactionContext},
2021
};
2122

@@ -398,31 +399,30 @@ mod tests {
398399
solana_epoch_schedule::EpochSchedule,
399400
solana_feature_set::FeatureSet,
400401
solana_instruction::{AccountMeta, Instruction},
401-
solana_program::{
402-
stake::{
403-
config as stake_config,
404-
instruction::{
405-
self, authorize_checked, authorize_checked_with_seed, initialize_checked,
406-
set_lockup_checked, AuthorizeCheckedWithSeedArgs, AuthorizeWithSeedArgs,
407-
LockupArgs, StakeError,
408-
},
409-
stake_flags::StakeFlags,
410-
state::{warmup_cooldown_rate, Authorized, Lockup, StakeAuthorize},
411-
MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION,
412-
},
413-
vote::state::{VoteState, VoteStateVersions},
414-
},
415402
solana_program_runtime::invoke_context::mock_process_instruction,
416403
solana_pubkey::Pubkey,
417404
solana_rent::Rent,
418405
solana_sdk_ids::{
419406
system_program,
420407
sysvar::{clock, epoch_rewards, epoch_schedule, rent, rewards, stake_history},
421408
},
409+
solana_stake_interface::{
410+
config as stake_config,
411+
error::StakeError,
412+
instruction::{
413+
self, authorize_checked, authorize_checked_with_seed, initialize_checked,
414+
set_lockup_checked, AuthorizeCheckedWithSeedArgs, AuthorizeWithSeedArgs,
415+
LockupArgs,
416+
},
417+
stake_flags::StakeFlags,
418+
state::{warmup_cooldown_rate, Authorized, Lockup, StakeAuthorize},
419+
MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION,
420+
},
422421
solana_sysvar::{
423422
rewards::Rewards,
424423
stake_history::{StakeHistory, StakeHistoryEntry},
425424
},
425+
solana_vote_interface::state::{VoteState, VoteStateVersions},
426426
solana_vote_program::vote_state,
427427
std::{collections::HashSet, str::FromStr, sync::Arc},
428428
test_case::test_case,

programs/stake/src/stake_state.rs

+11-12
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,30 @@
55
66
#[deprecated(
77
since = "1.8.0",
8-
note = "Please use `solana_sdk::stake::state` or `solana_program::stake::state` instead"
8+
note = "Please use `solana_sdk::stake::state` or `solana_stake_interface::state` instead"
99
)]
10-
pub use solana_program::stake::state::*;
10+
pub use solana_stake_interface::state::*;
1111
use {
1212
solana_account::{state_traits::StateMut, AccountSharedData, ReadableAccount},
1313
solana_clock::{Clock, Epoch},
1414
solana_feature_set::FeatureSet,
1515
solana_instruction::error::InstructionError,
1616
solana_log_collector::ic_msg,
17-
solana_program::{
18-
stake::{
19-
instruction::{LockupArgs, StakeError},
20-
program::id,
21-
stake_flags::StakeFlags,
22-
tools::{acceptable_reference_epoch_credits, eligible_for_deactivate_delinquent},
23-
},
24-
vote::state::{VoteState, VoteStateVersions},
25-
},
2617
solana_program_runtime::invoke_context::InvokeContext,
2718
solana_pubkey::Pubkey,
2819
solana_rent::Rent,
20+
solana_sdk_ids::stake::id,
21+
solana_stake_interface::{
22+
error::StakeError,
23+
instruction::LockupArgs,
24+
stake_flags::StakeFlags,
25+
tools::{acceptable_reference_epoch_credits, eligible_for_deactivate_delinquent},
26+
},
2927
solana_sysvar::stake_history::{StakeHistory, StakeHistoryEntry},
3028
solana_transaction_context::{
3129
BorrowedAccount, IndexOfAccount, InstructionContext, TransactionContext,
3230
},
31+
solana_vote_interface::state::{VoteState, VoteStateVersions},
3332
std::{collections::HashSet, convert::TryFrom},
3433
};
3534

@@ -1452,10 +1451,10 @@ mod tests {
14521451
proptest::prelude::*,
14531452
solana_account::{create_account_shared_data_for_test, AccountSharedData},
14541453
solana_epoch_schedule::EpochSchedule,
1455-
solana_program::stake::state::warmup_cooldown_rate,
14561454
solana_program_runtime::with_mock_invoke_context,
14571455
solana_pubkey::Pubkey,
14581456
solana_sdk_ids::sysvar::epoch_schedule,
1457+
solana_stake_interface::state::warmup_cooldown_rate,
14591458
solana_sysvar_id::SysvarId,
14601459
test_case::test_case,
14611460
};

runtime-transaction/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ solana-feature-set = { workspace = true }
3838
solana-instruction = { workspace = true }
3939
solana-keypair = { workspace = true }
4040
solana-program = { workspace = true }
41+
solana-pubkey = { workspace = true, features = ["rand"] }
4142
solana-reserved-account-keys = { workspace = true }
4243
solana-signer = { workspace = true }
4344
solana-system-interface = { workspace = true, features = ["bincode"] }
4445
solana-system-transaction = { workspace = true }
46+
solana-transaction = { workspace = true, features = ["blake3"] }
4547

4648
[package.metadata.docs.rs]
4749
targets = ["x86_64-unknown-linux-gnu"]

svm/examples/Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)