diff --git a/Cargo.lock b/Cargo.lock index 3a6921a016bba5..113ca19f1d1c36 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8728,11 +8728,23 @@ dependencies = [ "rand 0.8.5", "solana-compute-budget", "solana-compute-budget-instruction", + "solana-compute-budget-interface", + "solana-feature-set", + "solana-hash", + "solana-instruction", + "solana-keypair", + "solana-message", "solana-program", "solana-pubkey", - "solana-sdk", + "solana-reserved-account-keys", "solana-sdk-ids", + "solana-signature", + "solana-signer", "solana-svm-transaction", + "solana-system-interface", + "solana-system-transaction", + "solana-transaction", + "solana-transaction-error", "thiserror 2.0.9", ] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 9b8b0020a9be21..8479164f9452d6 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -6869,10 +6869,14 @@ dependencies = [ "log", "solana-compute-budget", "solana-compute-budget-instruction", + "solana-hash", + "solana-message", "solana-pubkey", - "solana-sdk", "solana-sdk-ids", + "solana-signature", "solana-svm-transaction", + "solana-transaction", + "solana-transaction-error", "thiserror 2.0.9", ] diff --git a/runtime-transaction/Cargo.toml b/runtime-transaction/Cargo.toml index d63a1d1e089817..dc37d849bf928d 100644 --- a/runtime-transaction/Cargo.toml +++ b/runtime-transaction/Cargo.toml @@ -14,10 +14,14 @@ agave-transaction-view = { workspace = true } log = { workspace = true } solana-compute-budget = { workspace = true } solana-compute-budget-instruction = { workspace = true } +solana-hash = { workspace = true } +solana-message = { workspace = true } solana-pubkey = { workspace = true } -solana-sdk = { workspace = true } solana-sdk-ids = { workspace = true } +solana-signature = { workspace = true } solana-svm-transaction = { workspace = true } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } thiserror = { workspace = true } [lib] @@ -29,7 +33,15 @@ bincode = { workspace = true } criterion = { workspace = true } rand = { workspace = true } solana-compute-budget-instruction = { workspace = true, features = ["dev-context-only-utils"] } +solana-compute-budget-interface = { workspace = true } +solana-feature-set = { workspace = true } +solana-instruction = { workspace = true } +solana-keypair = { workspace = true } solana-program = { workspace = true } +solana-reserved-account-keys = { workspace = true } +solana-signer = { workspace = true } +solana-system-interface = { workspace = true, features = ["bincode"] } +solana-system-transaction = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/runtime-transaction/benches/get_signature_details.rs b/runtime-transaction/benches/get_signature_details.rs index 3a576574909a08..061f062f0fa9b9 100644 --- a/runtime-transaction/benches/get_signature_details.rs +++ b/runtime-transaction/benches/get_signature_details.rs @@ -1,7 +1,8 @@ use { criterion::{black_box, criterion_group, criterion_main, Criterion, Throughput}, + solana_message::compiled_instruction::CompiledInstruction, + solana_pubkey::Pubkey, solana_runtime_transaction::signature_details::get_precompile_signature_details, - solana_sdk::{instruction::CompiledInstruction, pubkey::Pubkey}, solana_svm_transaction::instruction::SVMInstruction, }; @@ -51,8 +52,8 @@ fn bench_get_signature_details_no_sigs_unique(c: &mut Criterion) { fn bench_get_signature_details_packed_sigs(c: &mut Criterion) { let program_ids = [ - solana_sdk::secp256k1_program::id(), - solana_sdk::ed25519_program::id(), + solana_sdk_ids::secp256k1_program::id(), + solana_sdk_ids::ed25519_program::id(), ]; for num_instructions in [4, 64] { let instructions = (0..num_instructions) @@ -86,8 +87,8 @@ fn bench_get_signature_details_packed_sigs(c: &mut Criterion) { fn bench_get_signature_details_mixed_sigs(c: &mut Criterion) { let program_ids = [ - solana_sdk::secp256k1_program::id(), - solana_sdk::ed25519_program::id(), + solana_sdk_ids::secp256k1_program::id(), + solana_sdk_ids::ed25519_program::id(), ] .into_iter() .chain((0..6).map(|_| Pubkey::new_unique())) diff --git a/runtime-transaction/src/runtime_transaction.rs b/runtime-transaction/src/runtime_transaction.rs index 3dec0732050af3..ba10ccee07879e 100644 --- a/runtime-transaction/src/runtime_transaction.rs +++ b/runtime-transaction/src/runtime_transaction.rs @@ -1,10 +1,10 @@ //! RuntimeTransaction is `runtime` facing representation of transaction, while -//! solana_sdk::SanitizedTransaction is client facing representation. +//! solana_transaction::sanitized::SanitizedTransaction is client facing representation. //! //! It has two states: //! 1. Statically Loaded: after receiving `packet` from sigverify and deserializing -//! it into `solana_sdk::VersionedTransaction`, then sanitizing into -//! `solana_sdk::SanitizedVersionedTransaction`, which can be wrapped into +//! it into `solana_transaction::versioned::VersionedTransaction`, then sanitizing into +//! `solana_transaction::versioned::sanitized::SanitizedVersionedTransaction`, which can be wrapped into //! `RuntimeTransaction` with static transaction metadata extracted. //! 2. Dynamically Loaded: after successfully loaded account addresses from onchain //! ALT, RuntimeTransaction transits into Dynamically Loaded state, @@ -13,12 +13,10 @@ use { crate::transaction_meta::{DynamicMeta, StaticMeta, TransactionMeta}, core::ops::Deref, solana_compute_budget_instruction::compute_budget_instruction_details::*, - solana_sdk::{ - hash::Hash, - message::{AccountKeys, TransactionSignatureDetails}, - pubkey::Pubkey, - signature::Signature, - }, + solana_hash::Hash, + solana_message::{AccountKeys, TransactionSignatureDetails}, + solana_pubkey::Pubkey, + solana_signature::Signature, solana_svm_transaction::{ instruction::SVMInstruction, message_address_table_lookup::SVMMessageAddressTableLookup, svm_message::SVMMessage, svm_transaction::SVMTransaction, diff --git a/runtime-transaction/src/runtime_transaction/sdk_transactions.rs b/runtime-transaction/src/runtime_transaction/sdk_transactions.rs index a82e9c1217fff6..61167b7c253713 100644 --- a/runtime-transaction/src/runtime_transaction/sdk_transactions.rs +++ b/runtime-transaction/src/runtime_transaction/sdk_transactions.rs @@ -5,16 +5,15 @@ use { transaction_meta::{StaticMeta, TransactionMeta}, transaction_with_meta::TransactionWithMeta, }, + solana_message::{AddressLoader, TransactionSignatureDetails}, solana_pubkey::Pubkey, - solana_sdk::{ - message::{AddressLoader, TransactionSignatureDetails}, + solana_svm_transaction::instruction::SVMInstruction, + solana_transaction::{ + sanitized::{MessageHash, SanitizedTransaction}, simple_vote_transaction_checker::is_simple_vote_transaction, - transaction::{ - MessageHash, Result, SanitizedTransaction, SanitizedVersionedTransaction, - VersionedTransaction, - }, + versioned::{sanitized::SanitizedVersionedTransaction, VersionedTransaction}, }, - solana_svm_transaction::instruction::SVMInstruction, + solana_transaction_error::TransactionResult as Result, std::{borrow::Cow, collections::HashSet}, }; @@ -137,13 +136,13 @@ impl TransactionWithMeta for RuntimeTransaction { #[cfg(feature = "dev-context-only-utils")] impl RuntimeTransaction { - pub fn from_transaction_for_tests(transaction: solana_sdk::transaction::Transaction) -> Self { + pub fn from_transaction_for_tests(transaction: solana_transaction::Transaction) -> Self { let versioned_transaction = VersionedTransaction::from(transaction); Self::try_create( versioned_transaction, MessageHash::Compute, None, - solana_sdk::message::SimpleAddressLoader::Disabled, + solana_message::SimpleAddressLoader::Disabled, &HashSet::new(), ) .expect("failed to create RuntimeTransaction from Transaction") @@ -154,20 +153,17 @@ impl RuntimeTransaction { mod tests { use { super::*, - solana_program::{ - system_instruction, - vote::{self, state::Vote}, - }, - solana_sdk::{ - compute_budget::ComputeBudgetInstruction, - feature_set::FeatureSet, - hash::Hash, - instruction::Instruction, - message::Message, - reserved_account_keys::ReservedAccountKeys, - signer::{keypair::Keypair, Signer}, - transaction::{SimpleAddressLoader, Transaction, VersionedTransaction}, - }, + solana_compute_budget_interface::ComputeBudgetInstruction, + solana_feature_set::FeatureSet, + solana_hash::Hash, + solana_instruction::Instruction, + solana_keypair::Keypair, + solana_message::{Message, SimpleAddressLoader}, + solana_program::vote::{self, state::Vote}, + solana_reserved_account_keys::ReservedAccountKeys, + solana_signer::Signer, + solana_system_interface::instruction as system_instruction, + solana_transaction::{versioned::VersionedTransaction, Transaction}, }; fn vote_sanitized_versioned_transaction() -> SanitizedVersionedTransaction { @@ -203,7 +199,7 @@ mod tests { let from_keypair = Keypair::new(); let instructions = vec![system_instruction::transfer( &from_keypair.pubkey(), - &solana_sdk::pubkey::new_rand(), + &solana_pubkey::new_rand(), 1, )]; TestTransaction { diff --git a/runtime-transaction/src/runtime_transaction/transaction_view.rs b/runtime-transaction/src/runtime_transaction/transaction_view.rs index 7a7c38f0db306b..0a09fc2c310cae 100644 --- a/runtime-transaction/src/runtime_transaction/transaction_view.rs +++ b/runtime-transaction/src/runtime_transaction/transaction_view.rs @@ -9,20 +9,20 @@ use { resolved_transaction_view::ResolvedTransactionView, transaction_data::TransactionData, transaction_version::TransactionVersion, transaction_view::SanitizedTransactionView, }, + solana_message::{ + compiled_instruction::CompiledInstruction, + v0::{LoadedAddresses, LoadedMessage, MessageAddressTableLookup}, + LegacyMessage, MessageHeader, SanitizedMessage, TransactionSignatureDetails, + VersionedMessage, + }, solana_pubkey::Pubkey, - solana_sdk::{ - instruction::CompiledInstruction, - message::{ - v0::{LoadedAddresses, LoadedMessage, MessageAddressTableLookup}, - LegacyMessage, MessageHeader, SanitizedMessage, TransactionSignatureDetails, - VersionedMessage, - }, + solana_svm_transaction::svm_message::SVMMessage, + solana_transaction::{ + sanitized::{MessageHash, SanitizedTransaction}, simple_vote_transaction_checker::is_simple_vote_transaction_impl, - transaction::{ - MessageHash, Result, SanitizedTransaction, TransactionError, VersionedTransaction, - }, + versioned::VersionedTransaction, }, - solana_svm_transaction::svm_message::SVMMessage, + solana_transaction_error::{TransactionError, TransactionResult as Result}, std::{borrow::Cow, collections::HashSet}, }; @@ -158,14 +158,14 @@ impl TransactionWithMeta for RuntimeTransaction { - VersionedMessage::Legacy(solana_sdk::message::legacy::Message { + VersionedMessage::Legacy(solana_message::legacy::Message { header, account_keys: static_account_keys, recent_blockhash, instructions, }) } - TransactionVersion::V0 => VersionedMessage::V0(solana_sdk::message::v0::Message { + TransactionVersion::V0 => VersionedMessage::V0(solana_message::v0::Message { header, account_keys: static_account_keys, recent_blockhash, @@ -192,14 +192,13 @@ impl TransactionWithMeta for RuntimeTransaction ProgramIdStatus { - if program_id == &solana_sdk::secp256k1_program::ID { + if program_id == &solana_sdk_ids::secp256k1_program::ID { ProgramIdStatus::Secp256k1 - } else if program_id == &solana_sdk::ed25519_program::ID { + } else if program_id == &solana_sdk_ids::ed25519_program::ID { ProgramIdStatus::Ed25519 } else if program_id == &solana_sdk_ids::secp256r1_program::ID { ProgramIdStatus::Secp256r1 @@ -148,8 +148,8 @@ mod tests { fn test_get_signature_details_signatures_mixed() { let program_ids = [ Pubkey::new_unique(), - solana_sdk::secp256k1_program::ID, - solana_sdk::ed25519_program::ID, + solana_sdk_ids::secp256k1_program::ID, + solana_sdk_ids::ed25519_program::ID, solana_sdk_ids::secp256r1_program::ID, ]; let instructions = [ @@ -172,8 +172,8 @@ mod tests { #[test] fn test_get_signature_details_missing_num_signatures() { let program_ids = [ - solana_sdk::secp256k1_program::ID, - solana_sdk::ed25519_program::ID, + solana_sdk_ids::secp256k1_program::ID, + solana_sdk_ids::ed25519_program::ID, solana_sdk_ids::secp256r1_program::ID, ]; let instructions = [ diff --git a/runtime-transaction/src/transaction_meta.rs b/runtime-transaction/src/transaction_meta.rs index ec257c2926cfd2..1ba551c05f3b9e 100644 --- a/runtime-transaction/src/transaction_meta.rs +++ b/runtime-transaction/src/transaction_meta.rs @@ -13,7 +13,7 @@ //! use { solana_compute_budget_instruction::compute_budget_instruction_details::ComputeBudgetInstructionDetails, - solana_sdk::{hash::Hash, message::TransactionSignatureDetails}, + solana_hash::Hash, solana_message::TransactionSignatureDetails, }; /// metadata can be extracted statically from sanitized transaction, diff --git a/runtime-transaction/src/transaction_with_meta.rs b/runtime-transaction/src/transaction_with_meta.rs index 9e7e4b815341a6..77371c533455e4 100644 --- a/runtime-transaction/src/transaction_with_meta.rs +++ b/runtime-transaction/src/transaction_with_meta.rs @@ -1,7 +1,7 @@ use { crate::transaction_meta::StaticMeta, - solana_sdk::transaction::{SanitizedTransaction, VersionedTransaction}, solana_svm_transaction::svm_transaction::SVMTransaction, + solana_transaction::{sanitized::SanitizedTransaction, versioned::VersionedTransaction}, std::borrow::Cow, }; diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index 03f3c6de41a92c..1db2eb02235fb2 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -6688,10 +6688,14 @@ dependencies = [ "log", "solana-compute-budget", "solana-compute-budget-instruction", + "solana-hash", + "solana-message", "solana-pubkey", - "solana-sdk", "solana-sdk-ids", + "solana-signature", "solana-svm-transaction", + "solana-transaction", + "solana-transaction-error", "thiserror 2.0.9", ]