Skip to content

Commit

Permalink
remove solana-program and solana-sdk from solana-perf (#3973)
Browse files Browse the repository at this point in the history
* remove solana-sdk from dcou deps

* sort deps

* remove solana-program

* fix imports

* remove manifest entries missed in earlier commits
  • Loading branch information
kevinheavey authored Dec 6, 2024
1 parent 89872fd commit b347174
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 38 deletions.
10 changes: 8 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 18 additions & 5 deletions perf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,28 @@ log = { workspace = true }
rand = { workspace = true }
rayon = { workspace = true }
serde = { workspace = true }
solana-clock = { workspace = true, optional = true }
solana-frozen-abi = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-hash = { workspace = true }
solana-keypair = { workspace = true, optional = true }
solana-message = { workspace = true }
solana-metrics = { workspace = true }
solana-packet = { workspace = true, features = ["bincode"] }
solana-program = { workspace = true, default-features = false }
solana-pubkey = { workspace = true, default-features = false }
solana-rayon-threadlimit = { workspace = true }
solana-sdk = { workspace = true, optional = true }
solana-sdk-ids = { workspace = true }
solana-short-vec = { workspace = true }
solana-signature = { workspace = true, features = ["verify"] }
solana-signer = { workspace = true, optional = true }
solana-system-interface = { workspace = true, optional = true }
solana-system-transaction = { workspace = true, optional = true }
solana-time-utils = { workspace = true }
solana-transaction = { workspace = true, optional = true }
solana-vote-program = { workspace = true, optional = true }

[target."cfg(target_os = \"linux\")".dependencies]
Expand All @@ -55,13 +61,20 @@ solana-perf = { path = ".", features = ["dev-context-only-utils"] }
test-case = { workspace = true }

[features]
dev-context-only-utils = ["dep:solana-vote-program", "dep:solana-sdk"]
dev-context-only-utils = [
"dep:solana-clock",
"dep:solana-keypair",
"dep:solana-signer",
"dep:solana-system-interface",
"dep:solana-system-transaction",
"dep:solana-transaction",
"dep:solana-vote-program",
]
frozen-abi = [
"dep:solana-frozen-abi",
"dep:solana-frozen-abi-macro",
"solana-sdk/frozen-abi",
"solana-short-vec/frozen-abi",
"solana-vote-program/frozen-abi"
"solana-vote-program/frozen-abi",
]

[[bench]]
Expand Down
10 changes: 3 additions & 7 deletions perf/src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,15 @@ where
#[cfg(test)]
mod tests {
use {
super::*,
solana_hash::Hash,
solana_sdk::{
signature::{Keypair, Signer},
system_transaction,
},
super::*, solana_hash::Hash, solana_keypair::Keypair, solana_signer::Signer,
solana_system_transaction::transfer,
};

#[test]
fn test_to_packet_batches() {
let keypair = Keypair::new();
let hash = Hash::new_from_array([1; 32]);
let tx = system_transaction::transfer(&keypair, &keypair.pubkey(), 1, hash);
let tx = transfer(&keypair, &keypair.pubkey(), 1, hash);
let rv = to_packet_batches_for_tests(&[tx.clone(); 1]);
assert_eq!(rv.len(), 1);
assert_eq!(rv[0].len(), 1);
Expand Down
16 changes: 6 additions & 10 deletions perf/src/sigverify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use {
},
rayon::{prelude::*, ThreadPool},
solana_hash::Hash,
solana_program::message::{MESSAGE_HEADER_LENGTH, MESSAGE_VERSION_PREFIX},
solana_message::{MESSAGE_HEADER_LENGTH, MESSAGE_VERSION_PREFIX},
solana_pubkey::Pubkey,
solana_rayon_threadlimit::get_thread_count,
solana_short_vec::decode_shortu16_len,
Expand Down Expand Up @@ -415,7 +415,7 @@ fn check_for_simple_vote_transaction(
if packet
.data(instruction_program_id_start..instruction_program_id_end)
.ok_or(PacketError::InvalidLen)?
== solana_program::vote::program::id().as_ref()
== solana_sdk_ids::vote::id().as_ref()
{
packet.meta_mut().flags |= PacketFlags::SIMPLE_VOTE_TX;
}
Expand Down Expand Up @@ -675,15 +675,11 @@ mod tests {
bincode::{deserialize, serialize},
curve25519_dalek::{edwards::CompressedEdwardsY, scalar::Scalar},
rand::{thread_rng, Rng},
solana_program::{
instruction::CompiledInstruction,
message::{Message, MessageHeader},
},
solana_sdk::{
signature::{Keypair, Signer},
transaction::Transaction,
},
solana_keypair::Keypair,
solana_message::{compiled_instruction::CompiledInstruction, Message, MessageHeader},
solana_signature::Signature,
solana_signer::Signer,
solana_transaction::Transaction,
std::{
iter::repeat_with,
sync::atomic::{AtomicU64, Ordering},
Expand Down
22 changes: 10 additions & 12 deletions perf/src/test_tx.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
use {
rand::{CryptoRng, Rng, RngCore},
solana_sdk::{
clock::Slot,
hash::Hash,
instruction::CompiledInstruction,
signature::{Keypair, Signer},
stake,
system_instruction::SystemInstruction,
system_program, system_transaction,
transaction::Transaction,
},
solana_clock::Slot,
solana_hash::Hash,
solana_keypair::Keypair,
solana_message::compiled_instruction::CompiledInstruction,
solana_sdk_ids::{stake, system_program},
solana_signer::Signer,
solana_system_interface::instruction::SystemInstruction,
solana_transaction::Transaction,
solana_vote_program::{vote_state::TowerSync, vote_transaction},
};

pub fn test_tx() -> Transaction {
let keypair1 = Keypair::new();
let pubkey1 = keypair1.pubkey();
let zero = Hash::default();
system_transaction::transfer(&keypair1, &pubkey1, 42, zero)
solana_system_transaction::transfer(&keypair1, &pubkey1, 42, zero)
}

pub fn test_invalid_tx() -> Transaction {
Expand All @@ -35,7 +33,7 @@ pub fn test_multisig_tx() -> Transaction {

let transfer_instruction = SystemInstruction::Transfer { lamports };

let program_ids = vec![system_program::id(), stake::program::id()];
let program_ids = vec![system_program::id(), stake::id()];

let instructions = vec![CompiledInstruction::new(
0,
Expand Down
3 changes: 2 additions & 1 deletion programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion svm/examples/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b347174

Please sign in to comment.