Skip to content

Commit 4b2a5a5

Browse files
authored
replace low-hanging fruit dependencies on solana-program (#6351)
1 parent 2441e64 commit 4b2a5a5

File tree

161 files changed

+966
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+966
-511
lines changed

Cargo.lock

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

accounts-db/src/blockhash_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl BlockhashQueue {
144144

145145
#[deprecated(
146146
since = "2.0.0",
147-
note = "Please use `solana_program::clock::MAX_PROCESSING_AGE`"
147+
note = "Please use `solana_clock::MAX_PROCESSING_AGE`"
148148
)]
149149
pub fn get_max_age(&self) -> usize {
150150
self.max_age

banks-client/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ borsh = { workspace = true }
1414
futures = { workspace = true }
1515
solana-account = { workspace = true }
1616
solana-banks-interface = { workspace = true }
17+
solana-clock = { workspace = true }
1718
solana-commitment-config = { workspace = true }
19+
solana-hash = { workspace = true }
1820
solana-message = { workspace = true }
19-
solana-program = { workspace = true }
21+
solana-program-pack = { workspace = true }
22+
solana-pubkey = { workspace = true }
23+
solana-rent = { workspace = true }
2024
solana-signature = { workspace = true }
25+
solana-sysvar = { workspace = true }
2126
solana-transaction = { workspace = true }
2227
solana-transaction-context = { workspace = true }
2328
solana-transaction-error = { workspace = true }

banks-client/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,15 @@ use {
1717
BanksRequest, BanksResponse, BanksTransactionResultWithMetadata,
1818
BanksTransactionResultWithSimulation,
1919
},
20+
solana_clock::Slot,
2021
solana_commitment_config::CommitmentLevel,
22+
solana_hash::Hash,
2123
solana_message::Message,
22-
solana_program::{
23-
clock::Slot, hash::Hash, program_pack::Pack, pubkey::Pubkey, rent::Rent, sysvar::Sysvar,
24-
},
24+
solana_program_pack::Pack,
25+
solana_pubkey::Pubkey,
26+
solana_rent::Rent,
2527
solana_signature::Signature,
28+
solana_sysvar::Sysvar,
2629
solana_transaction::versioned::VersionedTransaction,
2730
tarpc::{
2831
client::{self, NewClient, RequestDispatch},

cli-output/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ solana-hash = { workspace = true }
3333
solana-message = { workspace = true }
3434
solana-native-token = { workspace = true }
3535
solana-packet = { workspace = true }
36-
solana-program = { workspace = true }
3736
solana-pubkey = { workspace = true }
3837
solana-rpc-client-api = { workspace = true }
3938
solana-sdk-ids = { workspace = true }
4039
solana-signature = { workspace = true }
40+
solana-stake-interface = { workspace = true }
4141
solana-system-interface = { workspace = true }
4242
solana-sysvar = { workspace = true }
4343
solana-transaction = { workspace = true, features = ["verify"] }

cli-output/src/cli_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ use {
2626
solana_epoch_info::EpochInfo,
2727
solana_hash::Hash,
2828
solana_native_token::lamports_to_sol,
29-
solana_program::stake::state::{Authorized, Lockup},
3029
solana_pubkey::Pubkey,
3130
solana_rpc_client_api::response::{
3231
RpcAccountBalance, RpcContactInfo, RpcInflationGovernor, RpcInflationRate, RpcKeyedAccount,
3332
RpcSupply, RpcVoteAccountInfo,
3433
},
3534
solana_signature::Signature,
35+
solana_stake_interface::state::{Authorized, Lockup},
3636
solana_sysvar::stake_history::StakeHistoryEntry,
3737
solana_transaction::{versioned::VersionedTransaction, Transaction},
3838
solana_transaction_error::TransactionError,

cli-output/src/display.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ use {
1111
solana_hash::Hash,
1212
solana_message::{compiled_instruction::CompiledInstruction, v0::MessageAddressTableLookup},
1313
solana_native_token::lamports_to_sol,
14-
solana_program::stake,
1514
solana_pubkey::Pubkey,
1615
solana_signature::Signature,
16+
solana_stake_interface as stake,
1717
solana_transaction::versioned::{TransactionVersion, VersionedTransaction},
1818
solana_transaction_error::TransactionError,
1919
solana_transaction_status::{

cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ serde_derive = { workspace = true }
3131
serde_json = { workspace = true }
3232
solana-account = "=2.2.1"
3333
solana-account-decoder = { workspace = true }
34+
solana-address-lookup-table-interface = { workspace = true }
3435
solana-borsh = "=2.2.1"
3536
solana-bpf-loader-program = { workspace = true }
3637
solana-clap-utils = { workspace = true }
@@ -61,7 +62,6 @@ solana-native-token = "=2.2.2"
6162
solana-nonce = "=2.2.1"
6263
solana-offchain-message = { version = "=2.2.1", features = ["verify"] }
6364
solana-packet = "=2.2.1"
64-
solana-program = { version = "=2.2.1", default-features = false }
6565
solana-program-runtime = { workspace = true }
6666
solana-pubkey = { version = "=2.4.0", default-features = false }
6767
solana-pubsub-client = { workspace = true }

cli/src/address_lookup_table.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ use {
22
crate::cli::{CliCommand, CliCommandInfo, CliConfig, CliError, ProcessResult},
33
clap::{App, AppSettings, Arg, ArgMatches, SubCommand},
44
solana_account::from_account,
5-
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
6-
solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
7-
solana_clock::Clock,
8-
solana_commitment_config::CommitmentConfig,
9-
solana_message::Message,
10-
solana_program::address_lookup_table::{
11-
self,
5+
solana_address_lookup_table_interface::{
6+
self as address_lookup_table,
127
instruction::{
138
close_lookup_table, create_lookup_table, deactivate_lookup_table, extend_lookup_table,
149
freeze_lookup_table,
1510
},
1611
state::AddressLookupTable,
1712
},
13+
solana_clap_utils::{self, input_parsers::*, input_validators::*, keypair::*},
14+
solana_cli_output::{CliAddressLookupTable, CliAddressLookupTableCreated, CliSignature},
15+
solana_clock::Clock,
16+
solana_commitment_config::CommitmentConfig,
17+
solana_message::Message,
1818
solana_pubkey::Pubkey,
1919
solana_remote_wallet::remote_wallet::RemoteWalletManager,
2020
solana_rpc_client::rpc_client::RpcClient,

cli/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use {
2020
solana_instruction::error::InstructionError,
2121
solana_keypair::{read_keypair_file, Keypair},
2222
solana_offchain_message::OffchainMessage,
23-
solana_program::stake::{instruction::LockupArgs, state::Lockup},
2423
solana_pubkey::Pubkey,
2524
solana_remote_wallet::remote_wallet::RemoteWalletManager,
2625
solana_rpc_client::rpc_client::RpcClient,
@@ -31,6 +30,7 @@ use {
3130
solana_rpc_client_nonce_utils::blockhash_query::BlockhashQuery,
3231
solana_signature::Signature,
3332
solana_signer::{Signer, SignerError},
33+
solana_stake_interface::{instruction::LockupArgs, state::Lockup},
3434
solana_tps_client::{utils::create_connection_cache, TpsClient},
3535
solana_tpu_client::tpu_client::{
3636
TpuClient, TpuClientConfig, DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_TPU_ENABLE_UDP,

cli/src/cluster_query.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use {
3333
solana_message::Message,
3434
solana_native_token::lamports_to_sol,
3535
solana_nonce::state::State as NonceState,
36-
solana_program::stake::{self, state::StakeStateV2},
3736
solana_pubkey::Pubkey,
3837
solana_pubsub_client::pubsub_client::PubsubClient,
3938
solana_remote_wallet::remote_wallet::RemoteWalletManager,
@@ -53,6 +52,7 @@ use {
5352
solana_sdk_ids::sysvar::{self, stake_history},
5453
solana_signature::Signature,
5554
solana_slot_history::{self as slot_history, SlotHistory},
55+
solana_stake_interface::{self as stake, state::StakeStateV2},
5656
solana_system_interface::{instruction as system_instruction, MAX_PERMITTED_DATA_LENGTH},
5757
solana_tps_client::TpsClient,
5858
solana_transaction::Transaction,

cli/src/stake.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ use {
3737
solana_epoch_schedule::EpochSchedule,
3838
solana_message::Message,
3939
solana_native_token::Sol,
40-
solana_program::stake::{
41-
self,
42-
instruction::{self as stake_instruction, LockupArgs, StakeError},
43-
state::{Authorized, Lockup, Meta, StakeActivationStatus, StakeAuthorize, StakeStateV2},
44-
tools::{acceptable_reference_epoch_credits, eligible_for_deactivate_delinquent},
45-
},
4640
solana_pubkey::Pubkey,
4741
solana_remote_wallet::remote_wallet::RemoteWalletManager,
4842
solana_rpc_client::rpc_client::RpcClient,
@@ -56,6 +50,13 @@ use {
5650
system_program,
5751
sysvar::{clock, stake_history},
5852
},
53+
solana_stake_interface::{
54+
self as stake,
55+
error::StakeError,
56+
instruction::{self as stake_instruction, LockupArgs},
57+
state::{Authorized, Lockup, Meta, StakeActivationStatus, StakeAuthorize, StakeStateV2},
58+
tools::{acceptable_reference_epoch_credits, eligible_for_deactivate_delinquent},
59+
},
5960
solana_system_interface::{error::SystemError, instruction as system_instruction},
6061
solana_sysvar::stake_history::StakeHistory,
6162
solana_transaction::Transaction,

compute-budget-instruction/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ solana-builtins-default-costs = { workspace = true, features = ["dev-context-onl
3636
solana-hash = { workspace = true }
3737
solana-keypair = { workspace = true }
3838
solana-message = { workspace = true }
39-
solana-program = { workspace = true }
4039
solana-signer = { workspace = true }
40+
solana-stake-interface = { workspace = true }
4141
solana-system-interface = { workspace = true }
4242
solana-transaction = { workspace = true, features = ["blake3"] }
4343

compute-budget-instruction/src/compute_budget_instruction_details.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ mod test {
516516
fn test_builtin_program_migration() {
517517
let tx = build_sanitized_transaction(&[
518518
Instruction::new_with_bincode(Pubkey::new_unique(), &(), vec![]),
519-
solana_program::stake::instruction::delegate_stake(
519+
solana_stake_interface::instruction::delegate_stake(
520520
&Pubkey::new_unique(),
521521
&Pubkey::new_unique(),
522522
&Pubkey::new_unique(),

program-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ solana-banks-server = { workspace = true }
2727
solana-clock = { workspace = true }
2828
solana-commitment-config = { workspace = true }
2929
solana-compute-budget = { workspace = true }
30-
solana-cpi = { workspace = true }
3130
solana-epoch-rewards = { workspace = true }
3231
solana-epoch-schedule = { workspace = true }
3332
solana-fee-calculator = { workspace = true }
@@ -67,6 +66,7 @@ thiserror = { workspace = true }
6766
tokio = { workspace = true, features = ["full"] }
6867

6968
[dev-dependencies]
69+
solana-cpi = { workspace = true }
7070
solana-program = { workspace = true }
7171
solana-stake-program = { workspace = true }
7272
test-case = { workspace = true }

program-test/tests/cpi.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use {
22
solana_account_info::{next_account_info, AccountInfo},
3-
solana_cpi::invoke,
43
solana_instruction::{AccountMeta, Instruction},
54
solana_keypair::Keypair,
65
solana_msg::msg,
7-
solana_program::instruction::get_stack_height,
6+
solana_program::{instruction::get_stack_height, program::invoke},
87
solana_program_entrypoint::{ProgramResult, MAX_PERMITTED_DATA_INCREASE},
98
solana_program_test::{processor, ProgramTest},
109
solana_pubkey::Pubkey,

program-test/tests/realloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use {
22
solana_account_info::{next_account_info, AccountInfo},
3-
solana_cpi::invoke,
43
solana_instruction::{AccountMeta, Instruction},
54
solana_keypair::Keypair,
5+
solana_program::program::invoke,
66
solana_program_error::ProgramResult,
77
solana_program_test::{processor, ProgramTest},
88
solana_pubkey::Pubkey,

programs/bpf_loader/benches/bpf_loader_upgradeable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use {
33
solana_account::{state_traits::StateMut, AccountSharedData},
44
solana_bpf_loader_program::Entrypoint,
55
solana_instruction::AccountMeta,
6-
solana_program::{
7-
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
8-
loader_upgradeable_instruction::UpgradeableLoaderInstruction,
6+
solana_loader_v3_interface::{
7+
instruction::UpgradeableLoaderInstruction, state::UpgradeableLoaderState,
98
},
109
solana_program_runtime::invoke_context::mock_process_instruction,
1110
solana_pubkey::Pubkey,
11+
solana_sdk_ids::bpf_loader_upgradeable,
1212
};
1313

1414
#[derive(Default)]

0 commit comments

Comments
 (0)