Skip to content

Commit b0d38fa

Browse files
authored
remove solana-sdk from config-program (anza-xyz#4326)
* remove solana-sdk from config-program * remove solana-program from solana-config-program * missing feature activation (was previously being implicitly activated) * activate features that were previously activated implicitly * another feature activation * more missing feature activations * more feature activations * missing feature activation in rpc-client dev deps
1 parent db57715 commit b0d38fa

File tree

14 files changed

+74
-40
lines changed

14 files changed

+74
-40
lines changed

Cargo.lock

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

account-decoder/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ zstd = { workspace = true }
4646
assert_matches = { workspace = true }
4747
solana-hash = { workspace = true }
4848
solana-program = { workspace = true, default-features = false }
49+
solana-pubkey = { workspace = true, features = ["rand"] }
4950
spl-pod = { workspace = true }
5051

5152
[package.metadata.docs.rs]

cli-output/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ solana-bincode = { workspace = true }
2727
solana-clap-utils = { workspace = true }
2828
solana-cli-config = { workspace = true }
2929
solana-clock = { workspace = true }
30-
solana-epoch-info = { workspace = true }
30+
solana-epoch-info = { workspace = true, features = ["serde"] }
3131
solana-hash = { workspace = true }
3232
solana-message = { workspace = true }
3333
solana-native-token = { workspace = true }
@@ -40,7 +40,7 @@ solana-sdk-ids = { workspace = true }
4040
solana-signature = { workspace = true }
4141
solana-system-interface = { workspace = true }
4242
solana-sysvar = { workspace = true }
43-
solana-transaction = { workspace = true }
43+
solana-transaction = { workspace = true, features = ["verify"] }
4444
solana-transaction-error = { workspace = true }
4545
solana-transaction-status = { workspace = true }
4646
solana-vote-program = { workspace = true }

cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ solana-clock = { workspace = true }
4040
solana-cluster-type = { workspace = true }
4141
solana-commitment-config = { workspace = true }
4242
solana-compute-budget = { workspace = true }
43-
solana-compute-budget-interface = { workspace = true }
43+
solana-compute-budget-interface = { workspace = true, features = ["borsh"] }
4444
solana-config-program = { workspace = true }
4545
solana-connection-cache = { workspace = true }
4646
solana-decode-error = { workspace = true }
@@ -57,7 +57,7 @@ solana-logger = { workspace = true }
5757
solana-message = { workspace = true }
5858
solana-native-token = { workspace = true }
5959
solana-nonce = { workspace = true }
60-
solana-offchain-message = { workspace = true }
60+
solana-offchain-message = { workspace = true, features = ["verify"] }
6161
solana-packet = { workspace = true }
6262
solana-program = { workspace = true }
6363
solana-program-runtime = { workspace = true }

programs/config/Cargo.toml

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ bincode = { workspace = true }
1414
chrono = { workspace = true, features = ["default", "serde"] }
1515
serde = { workspace = true }
1616
serde_derive = { workspace = true }
17+
solana-account = { workspace = true }
18+
solana-bincode = { workspace = true }
19+
solana-instruction = { workspace = true }
1720
solana-log-collector = { workspace = true }
21+
solana-packet = { workspace = true }
1822
solana-program-runtime = { workspace = true }
19-
solana-sdk = { workspace = true }
23+
solana-pubkey = { workspace = true }
24+
solana-sdk-ids = { workspace = true }
2025
solana-short-vec = { workspace = true }
26+
solana-stake-interface = { workspace = true }
27+
solana-system-interface = { workspace = true }
28+
solana-transaction-context = { workspace = true }
2129

2230
[dev-dependencies]
31+
solana-keypair = { workspace = true }
2332
solana-logger = { workspace = true }
33+
solana-signer = { workspace = true }
2434

2535
[lib]
2636
crate-type = ["lib"]

programs/config/src/config_instruction.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use {
22
crate::{id, ConfigKeys, ConfigState},
3-
solana_sdk::{
4-
instruction::{AccountMeta, Instruction},
5-
pubkey::Pubkey,
6-
system_instruction,
7-
},
3+
solana_instruction::{AccountMeta, Instruction},
4+
solana_pubkey::Pubkey,
5+
solana_system_interface::instruction as system_instruction,
86
};
97

108
fn initialize_account<T: ConfigState>(config_pubkey: &Pubkey) -> Instruction {

programs/config/src/config_processor.rs

+16-18
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
//! Config program
22
33
use {
4-
crate::ConfigKeys,
5-
bincode::deserialize,
6-
solana_log_collector::ic_msg,
7-
solana_program_runtime::declare_process_instruction,
8-
solana_sdk::{
9-
instruction::InstructionError, program_utils::limited_deserialize, pubkey::Pubkey,
10-
transaction_context::IndexOfAccount,
11-
},
12-
std::collections::BTreeSet,
4+
crate::ConfigKeys, bincode::deserialize, solana_bincode::limited_deserialize,
5+
solana_instruction::error::InstructionError, solana_log_collector::ic_msg,
6+
solana_program_runtime::declare_process_instruction, solana_pubkey::Pubkey,
7+
solana_transaction_context::IndexOfAccount, std::collections::BTreeSet,
138
};
149

1510
pub const DEFAULT_COMPUTE_UNITS: u64 = 450;
@@ -19,7 +14,7 @@ declare_process_instruction!(Entrypoint, DEFAULT_COMPUTE_UNITS, |invoke_context|
1914
let instruction_context = transaction_context.get_current_instruction_context()?;
2015
let data = instruction_context.get_instruction_data();
2116

22-
let key_list: ConfigKeys = limited_deserialize(data)?;
17+
let key_list: ConfigKeys = limited_deserialize(data, solana_packet::PACKET_DATA_SIZE as u64)?;
2318
let config_account_key = transaction_context.get_key_of_account_at_index(
2419
instruction_context.get_index_of_instruction_account_in_transaction(0)?,
2520
)?;
@@ -139,14 +134,13 @@ mod tests {
139134
crate::{config_instruction, get_config_data, id, ConfigKeys, ConfigState},
140135
bincode::serialized_size,
141136
serde_derive::{Deserialize, Serialize},
137+
solana_account::{AccountSharedData, ReadableAccount},
138+
solana_instruction::AccountMeta,
139+
solana_keypair::Keypair,
142140
solana_program_runtime::invoke_context::mock_process_instruction,
143-
solana_sdk::{
144-
account::{AccountSharedData, ReadableAccount},
145-
instruction::AccountMeta,
146-
pubkey::Pubkey,
147-
signature::{Keypair, Signer},
148-
system_instruction::SystemInstruction,
149-
},
141+
solana_pubkey::Pubkey,
142+
solana_signer::Signer,
143+
solana_system_interface::instruction::SystemInstruction,
150144
};
151145

152146
fn process_instruction(
@@ -198,7 +192,11 @@ mod tests {
198192
let config_pubkey = config_keypair.pubkey();
199193
let instructions =
200194
config_instruction::create_account::<MyConfig>(&from_pubkey, &config_pubkey, 1, keys);
201-
let system_instruction = limited_deserialize(&instructions[0].data).unwrap();
195+
let system_instruction = limited_deserialize(
196+
&instructions[0].data,
197+
solana_packet::PACKET_DATA_SIZE as u64,
198+
)
199+
.unwrap();
202200
let SystemInstruction::CreateAccount {
203201
lamports: _,
204202
space,

programs/config/src/date_instruction.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use {
99
serde::ts_seconds,
1010
},
1111
serde_derive::{Deserialize, Serialize},
12-
solana_sdk::{instruction::Instruction, pubkey::Pubkey},
12+
solana_instruction::Instruction,
13+
solana_pubkey::Pubkey,
1314
};
1415

1516
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]

programs/config/src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ pub mod config_processor;
77
)]
88
pub mod date_instruction;
99

10-
pub use solana_sdk::config::program::id;
10+
pub use solana_sdk_ids::config::id;
1111
#[allow(deprecated)]
12-
use solana_sdk::stake::config::Config as StakeConfig;
12+
use solana_stake_interface::config::Config as StakeConfig;
1313
use {
1414
bincode::{deserialize, serialize, serialized_size},
1515
serde_derive::{Deserialize, Serialize},
16-
solana_sdk::{
17-
account::{Account, AccountSharedData},
18-
pubkey::Pubkey,
19-
},
16+
solana_account::{Account, AccountSharedData},
17+
solana_pubkey::Pubkey,
2018
solana_short_vec as short_vec,
2119
};
2220

programs/sbf/Cargo.lock

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

rpc-client/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jsonrpc-http-server = { workspace = true }
5050
solana-account-decoder = { workspace = true }
5151
solana-keypair = { workspace = true }
5252
solana-program = { workspace = true, default-features = false }
53+
solana-pubkey = { workspace = true, features = ["rand"] }
5354
solana-signer = { workspace = true }
5455
solana-system-transaction = { workspace = true }
5556
static_assertions = { workspace = true }

storage-bigtable/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ zstd = { workspace = true }
5050
[dev-dependencies]
5151
solana-hash = { workspace = true }
5252
solana-keypair = { workspace = true }
53+
solana-pubkey = { workspace = true, features = ["rand"] }
5354
solana-system-transaction = { workspace = true }
5455
solana-transaction-context = { workspace = true }
5556

storage-proto/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ solana-instruction = { workspace = true }
2020
solana-message = { workspace = true }
2121
solana-pubkey = { workspace = true }
2222
solana-serde = { workspace = true }
23-
solana-signature = { workspace = true }
23+
solana-signature = { workspace = true, features = ["std"] }
2424
solana-transaction = { workspace = true }
25-
solana-transaction-context = { workspace = true }
25+
solana-transaction-context = { workspace = true, features = ["serde"] }
2626
solana-transaction-error = { workspace = true }
2727
solana-transaction-status = { workspace = true }
2828

svm/examples/Cargo.lock

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

0 commit comments

Comments
 (0)