diff --git a/Cargo.lock b/Cargo.lock index d2f0b0ea865b0d..e892e6d2e1c3ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9974,9 +9974,20 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", + "solana-clock", + "solana-hash", + "solana-instruction", "solana-message", + "solana-program", "solana-pubkey", + "solana-reserved-account-keys", + "solana-reward-info", "solana-sdk", + "solana-sdk-ids", + "solana-signature", + "solana-system-interface", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "spl-associated-token-account", "spl-memo", diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index 4bc43647e7e6fa..e081e51e746698 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -8244,9 +8244,20 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", + "solana-clock", + "solana-hash", + "solana-instruction", "solana-message", + "solana-program", "solana-pubkey", + "solana-reserved-account-keys", + "solana-reward-info", "solana-sdk", + "solana-sdk-ids", + "solana-signature", + "solana-system-interface", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "spl-associated-token-account", "spl-memo", diff --git a/svm/examples/Cargo.lock b/svm/examples/Cargo.lock index a22877d3519108..b51db1212adf77 100644 --- a/svm/examples/Cargo.lock +++ b/svm/examples/Cargo.lock @@ -7580,9 +7580,20 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", + "solana-clock", + "solana-hash", + "solana-instruction", "solana-message", + "solana-program", "solana-pubkey", + "solana-reserved-account-keys", + "solana-reward-info", "solana-sdk", + "solana-sdk-ids", + "solana-signature", + "solana-system-interface", + "solana-transaction", + "solana-transaction-error", "solana-transaction-status-client-types", "spl-associated-token-account", "spl-memo", diff --git a/transaction-status/Cargo.toml b/transaction-status/Cargo.toml index 4c69565114dda7..1e89896da8221e 100644 --- a/transaction-status/Cargo.toml +++ b/transaction-status/Cargo.toml @@ -21,9 +21,20 @@ serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } solana-account-decoder = { workspace = true } +solana-clock = { workspace = true } +solana-hash = { workspace = true } +solana-instruction = { workspace = true } solana-message = { workspace = true } +solana-program = { workspace = true } solana-pubkey = { workspace = true } +solana-reserved-account-keys = { workspace = true } +solana-reward-info = { workspace = true } solana-sdk = { workspace = true } +solana-sdk-ids = { workspace = true } +solana-signature = { workspace = true } +solana-system-interface = { workspace = true } +solana-transaction = { workspace = true } +solana-transaction-error = { workspace = true } solana-transaction-status-client-types = { workspace = true } spl-associated-token-account = { workspace = true, features = ["no-entrypoint"] } spl-memo = { workspace = true, features = ["no-entrypoint"] } @@ -35,6 +46,7 @@ thiserror = { workspace = true } [dev-dependencies] bytemuck = { workspace = true } +solana-pubkey = { workspace = true, features = ["rand"] } spl-token-confidential-transfer-proof-extraction = { workspace = true } [package.metadata.docs.rs] diff --git a/transaction-status/benches/extract_memos.rs b/transaction-status/benches/extract_memos.rs index 8e2db7db5ae593..2d0f7ed5710638 100644 --- a/transaction-status/benches/extract_memos.rs +++ b/transaction-status/benches/extract_memos.rs @@ -4,7 +4,7 @@ extern crate test; use { solana_message::{compiled_instruction::CompiledInstruction, Message}, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, solana_transaction_status::extract_memos::{spl_memo_id_v1, spl_memo_id_v3, ExtractMemos}, test::Bencher, }; diff --git a/transaction-status/src/extract_memos.rs b/transaction-status/src/extract_memos.rs index e008d73ffff2bb..b49b5dda558135 100644 --- a/transaction-status/src/extract_memos.rs +++ b/transaction-status/src/extract_memos.rs @@ -3,7 +3,7 @@ use { solana_message::{ compiled_instruction::CompiledInstruction, AccountKeys, Message, SanitizedMessage, }, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, }; // A helper function to convert spl_memo::v1::id() as spl_sdk::pubkey::Pubkey to diff --git a/transaction-status/src/lib.rs b/transaction-status/src/lib.rs index d5d29d4aa9ee63..6d4ac259428248 100644 --- a/transaction-status/src/lib.rs +++ b/transaction-status/src/lib.rs @@ -2,7 +2,7 @@ pub use { crate::extract_memos::extract_and_fmt_memos, - solana_sdk::reward_type::RewardType, + solana_reward_info::RewardType, solana_transaction_status_client_types::{ option_serializer, ConfirmedTransactionStatusWithSignature, EncodeError, EncodedConfirmedBlock, EncodedConfirmedTransactionWithStatusMeta, EncodedTransaction, @@ -23,19 +23,21 @@ use { parse_instruction::parse, }, base64::{prelude::BASE64_STANDARD, Engine}, + solana_clock::{Slot, UnixTimestamp}, + solana_hash::Hash, solana_message::{ compiled_instruction::CompiledInstruction, v0::{self, LoadedAddresses, LoadedMessage}, AccountKeys, Message, VersionedMessage, }, - solana_sdk::{ - clock::{Slot, UnixTimestamp}, - hash::Hash, - pubkey::Pubkey, - reserved_account_keys::ReservedAccountKeys, - signature::Signature, - transaction::{Transaction, TransactionError, TransactionVersion, VersionedTransaction}, + solana_pubkey::Pubkey, + solana_reserved_account_keys::ReservedAccountKeys, + solana_signature::Signature, + solana_transaction::{ + versioned::{TransactionVersion, VersionedTransaction}, + Transaction, }, + solana_transaction_error::TransactionError, std::collections::HashSet, thiserror::Error, }; diff --git a/transaction-status/src/parse_accounts.rs b/transaction-status/src/parse_accounts.rs index d682418591b2ce..b40150e440fcdb 100644 --- a/transaction-status/src/parse_accounts.rs +++ b/transaction-status/src/parse_accounts.rs @@ -1,7 +1,7 @@ pub use solana_transaction_status_client_types::{ParsedAccount, ParsedAccountSource}; use { solana_message::{v0::LoadedMessage, Message}, - solana_sdk::reserved_account_keys::ReservedAccountKeys, + solana_reserved_account_keys::ReservedAccountKeys, }; pub fn parse_legacy_message_accounts(message: &Message) -> Vec { @@ -41,7 +41,8 @@ mod test { use { super::*, solana_message::{v0, v0::LoadedAddresses, MessageHeader}, - solana_sdk::{pubkey::Pubkey, reserved_account_keys::ReservedAccountKeys}, + solana_pubkey::Pubkey, + solana_reserved_account_keys::ReservedAccountKeys, }; #[test] diff --git a/transaction-status/src/parse_address_lookup_table.rs b/transaction-status/src/parse_address_lookup_table.rs index 966b7802b5eb88..cffaf1b5c46c20 100644 --- a/transaction-status/src/parse_address_lookup_table.rs +++ b/transaction-status/src/parse_address_lookup_table.rs @@ -5,7 +5,7 @@ use { bincode::deserialize, serde_json::json, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::address_lookup_table::instruction::ProgramInstruction, + solana_program::address_lookup_table::instruction::ProgramInstruction, }; pub fn parse_address_lookup_table( @@ -114,10 +114,8 @@ fn check_num_address_lookup_table_accounts( #[cfg(test)] mod test { use { - super::*, - solana_message::Message, - solana_sdk::{address_lookup_table::instruction, pubkey::Pubkey, system_program}, - std::str::FromStr, + super::*, solana_message::Message, solana_program::address_lookup_table::instruction, + solana_pubkey::Pubkey, solana_sdk_ids::system_program, std::str::FromStr, }; #[test] diff --git a/transaction-status/src/parse_associated_token.rs b/transaction-status/src/parse_associated_token.rs index 3956963ecb9963..6ab01046a6e2c6 100644 --- a/transaction-status/src/parse_associated_token.rs +++ b/transaction-status/src/parse_associated_token.rs @@ -5,7 +5,7 @@ use { borsh::BorshDeserialize, serde_json::json, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::pubkey::Pubkey, + solana_pubkey::Pubkey, spl_associated_token_account::instruction::AssociatedTokenAccountInstruction, }; @@ -96,7 +96,7 @@ mod test { use { super::*, solana_message::Message, - solana_sdk::sysvar, + solana_sdk_ids::sysvar, spl_associated_token_account::{ get_associated_token_address, get_associated_token_address_with_program_id, instruction::{ @@ -123,7 +123,7 @@ mod test { "account": associated_account_address.to_string(), "wallet": wallet_address.to_string(), "mint": mint.to_string(), - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), "tokenProgram": spl_token::id().to_string(), }), }; @@ -186,7 +186,7 @@ mod test { "account": associated_account_address.to_string(), "wallet": wallet_address.to_string(), "mint": mint.to_string(), - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), "tokenProgram": token_program_id.to_string(), }) } @@ -228,7 +228,7 @@ mod test { "account": associated_account_address.to_string(), "wallet": wallet_address.to_string(), "mint": mint.to_string(), - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), "tokenProgram": token_program_id.to_string(), }) } diff --git a/transaction-status/src/parse_bpf_loader.rs b/transaction-status/src/parse_bpf_loader.rs index 2fb3a09b758d10..4849fd0d94fb52 100644 --- a/transaction-status/src/parse_bpf_loader.rs +++ b/transaction-status/src/parse_bpf_loader.rs @@ -6,7 +6,7 @@ use { bincode::deserialize, serde_json::json, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::{ + solana_program::{ loader_instruction::LoaderInstruction, loader_upgradeable_instruction::UpgradeableLoaderInstruction, }, @@ -209,11 +209,9 @@ mod test { super::*, serde_json::Value, solana_message::Message, - solana_sdk::{ - bpf_loader_upgradeable, - pubkey::{self, Pubkey}, - system_program, sysvar, - }, + solana_program::bpf_loader_upgradeable, + solana_pubkey::{self as pubkey, Pubkey}, + solana_sdk_ids::{system_program, sysvar}, }; #[test] @@ -226,7 +224,7 @@ mod test { let account_keys = vec![fee_payer, account_pubkey]; let missing_account_keys = vec![account_pubkey]; - let instruction = solana_sdk::loader_instruction::write( + let instruction = solana_program::loader_instruction::write( &account_pubkey, &program_id, offset, @@ -260,7 +258,8 @@ mod test { ) .is_err()); - let instruction = solana_sdk::loader_instruction::finalize(&account_pubkey, &program_id); + let instruction = + solana_program::loader_instruction::finalize(&account_pubkey, &program_id); let mut message = Message::new(&[instruction], Some(&fee_payer)); assert_eq!( parse_bpf_loader( diff --git a/transaction-status/src/parse_instruction.rs b/transaction-status/src/parse_instruction.rs index b4c07ed9a0a619..b35eaf2f71e518 100644 --- a/transaction-status/src/parse_instruction.rs +++ b/transaction-status/src/parse_instruction.rs @@ -14,7 +14,8 @@ use { serde_json::Value, solana_account_decoder::parse_token::spl_token_ids, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::{address_lookup_table, pubkey::Pubkey, stake, system_program, vote}, + solana_pubkey::Pubkey, + solana_sdk_ids::{address_lookup_table, stake, system_program, vote}, std::{ collections::HashMap, str::{from_utf8, Utf8Error}, @@ -23,15 +24,16 @@ use { }; lazy_static! { - static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = address_lookup_table::program::id(); + static ref ADDRESS_LOOKUP_PROGRAM_ID: Pubkey = address_lookup_table::id(); static ref ASSOCIATED_TOKEN_PROGRAM_ID: Pubkey = spl_associated_token_id(); - static ref BPF_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader::id(); - static ref BPF_UPGRADEABLE_LOADER_PROGRAM_ID: Pubkey = solana_sdk::bpf_loader_upgradeable::id(); + static ref BPF_LOADER_PROGRAM_ID: Pubkey = solana_sdk_ids::bpf_loader::id(); + static ref BPF_UPGRADEABLE_LOADER_PROGRAM_ID: Pubkey = + solana_sdk_ids::bpf_loader_upgradeable::id(); static ref MEMO_V1_PROGRAM_ID: Pubkey = spl_memo_id_v1(); static ref MEMO_V3_PROGRAM_ID: Pubkey = spl_memo_id_v3(); - static ref STAKE_PROGRAM_ID: Pubkey = stake::program::id(); + static ref STAKE_PROGRAM_ID: Pubkey = stake::id(); static ref SYSTEM_PROGRAM_ID: Pubkey = system_program::id(); - static ref VOTE_PROGRAM_ID: Pubkey = vote::program::id(); + static ref VOTE_PROGRAM_ID: Pubkey = vote::id(); static ref PARSABLE_PROGRAM_IDS: HashMap = { let mut m = HashMap::new(); m.insert( diff --git a/transaction-status/src/parse_stake.rs b/transaction-status/src/parse_stake.rs index 6d6b6da9ffada9..5e879870c95f37 100644 --- a/transaction-status/src/parse_stake.rs +++ b/transaction-status/src/parse_stake.rs @@ -5,7 +5,7 @@ use { bincode::deserialize, serde_json::{json, Map, Value}, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::stake::instruction::StakeInstruction, + solana_program::stake::instruction::StakeInstruction, }; pub fn parse_stake( @@ -331,17 +331,15 @@ fn check_num_stake_accounts(accounts: &[u8], num: usize) -> Result<(), ParseInst mod test { use { super::*, + solana_instruction::Instruction, solana_message::Message, - solana_sdk::{ - instruction::Instruction, - pubkey::Pubkey, - stake::{ - config, - instruction::{self, LockupArgs}, - state::{Authorized, Lockup, StakeAuthorize}, - }, - sysvar, + solana_program::stake::{ + config, + instruction::{self, LockupArgs}, + state::{Authorized, Lockup, StakeAuthorize}, }, + solana_pubkey::Pubkey, + solana_sdk_ids::sysvar, std::iter::repeat_with, }; diff --git a/transaction-status/src/parse_system.rs b/transaction-status/src/parse_system.rs index cfe7c7559a1c9a..7010717cb8c0a6 100644 --- a/transaction-status/src/parse_system.rs +++ b/transaction-status/src/parse_system.rs @@ -5,7 +5,7 @@ use { bincode::deserialize, serde_json::json, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::system_instruction::SystemInstruction, + solana_system_interface::instruction::SystemInstruction, }; pub fn parse_system( @@ -208,9 +208,8 @@ fn check_num_system_accounts(accounts: &[u8], num: usize) -> Result<(), ParseIns #[cfg(test)] mod test { use { - super::*, - solana_message::Message, - solana_sdk::{pubkey::Pubkey, system_instruction, sysvar}, + super::*, solana_message::Message, solana_pubkey::Pubkey, solana_sdk_ids::sysvar, + solana_system_interface::instruction as system_instruction, }; #[test] diff --git a/transaction-status/src/parse_token.rs b/transaction-status/src/parse_token.rs index 0d62f7c9e53732..3f34b0d2d3e0b2 100644 --- a/transaction-status/src/parse_token.rs +++ b/transaction-status/src/parse_token.rs @@ -863,15 +863,15 @@ fn map_coption_pubkey(pubkey: COption) -> Option { #[cfg(test)] mod test { use { - super::*, solana_message::Message, solana_sdk::pubkey::Pubkey, - spl_token_2022::instruction::*, std::iter::repeat_with, + super::*, solana_message::Message, solana_pubkey::Pubkey, spl_token_2022::instruction::*, + std::iter::repeat_with, }; fn test_parse_token(program_id: &Pubkey) { let mint_pubkey = Pubkey::new_unique(); let mint_authority = Pubkey::new_unique(); let freeze_authority = Pubkey::new_unique(); - let rent_sysvar = solana_sdk::sysvar::rent::id(); + let rent_sysvar = solana_sdk_ids::sysvar::rent::id(); // Test InitializeMint variations let initialize_mint_ix = initialize_mint( @@ -1773,7 +1773,7 @@ mod test { info: json!({ "payer": payer.to_string(), "nativeMint": spl_token_2022::native_mint::id().to_string(), - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), }) } ); diff --git a/transaction-status/src/parse_token/extension/confidential_mint_burn.rs b/transaction-status/src/parse_token/extension/confidential_mint_burn.rs index 93e44a773700c9..4cd1c7b312034f 100644 --- a/transaction-status/src/parse_token/extension/confidential_mint_burn.rs +++ b/transaction-status/src/parse_token/extension/confidential_mint_burn.rs @@ -262,10 +262,8 @@ mod test { use { super::*, bytemuck::Zeroable, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_pubkey::Pubkey, spl_token_2022::{ extension::confidential_mint_burn::instruction::{ confidential_burn_with_split_proofs, confidential_mint_with_split_proofs, diff --git a/transaction-status/src/parse_token/extension/confidential_transfer.rs b/transaction-status/src/parse_token/extension/confidential_transfer.rs index b9bf877c8a2498..233a48dc548314 100644 --- a/transaction-status/src/parse_token/extension/confidential_transfer.rs +++ b/transaction-status/src/parse_token/extension/confidential_transfer.rs @@ -597,10 +597,8 @@ mod test { use { super::*, bytemuck::Zeroable, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_pubkey::Pubkey, spl_token_2022::{ extension::confidential_transfer::instruction::{ initialize_mint, inner_configure_account, inner_empty_account, update_mint, diff --git a/transaction-status/src/parse_token/extension/confidential_transfer_fee.rs b/transaction-status/src/parse_token/extension/confidential_transfer_fee.rs index 365623946a3518..21c731d38e2db0 100644 --- a/transaction-status/src/parse_token/extension/confidential_transfer_fee.rs +++ b/transaction-status/src/parse_token/extension/confidential_transfer_fee.rs @@ -209,10 +209,8 @@ mod test { use { super::*, bytemuck::Zeroable, - solana_sdk::{ - instruction::{AccountMeta, Instruction}, - pubkey::Pubkey, - }, + solana_instruction::{AccountMeta, Instruction}, + solana_pubkey::Pubkey, spl_token_2022::{ extension::confidential_transfer_fee::instruction::{ inner_withdraw_withheld_tokens_from_accounts, diff --git a/transaction-status/src/parse_token/extension/reallocate.rs b/transaction-status/src/parse_token/extension/reallocate.rs index c9f1bac993ee44..247c9c3d956d22 100644 --- a/transaction-status/src/parse_token/extension/reallocate.rs +++ b/transaction-status/src/parse_token/extension/reallocate.rs @@ -70,7 +70,7 @@ mod test { "account": account_pubkey.to_string(), "payer": payer_pubkey.to_string(), "owner": owner_pubkey.to_string(), - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), "extensionTypes": ["transferFeeAmount", "memoTransfer"], }) } @@ -107,7 +107,7 @@ mod test { multisig_signer0.to_string(), multisig_signer1.to_string(), ], - "systemProgram": solana_sdk::system_program::id().to_string(), + "systemProgram": solana_sdk_ids::system_program::id().to_string(), "extensionTypes": ["transferFeeAmount", "memoTransfer"], }) } diff --git a/transaction-status/src/parse_vote.rs b/transaction-status/src/parse_vote.rs index bea0bd0967742c..227fb6dce731bd 100644 --- a/transaction-status/src/parse_vote.rs +++ b/transaction-status/src/parse_vote.rs @@ -5,7 +5,7 @@ use { bincode::deserialize, serde_json::json, solana_message::{compiled_instruction::CompiledInstruction, AccountKeys}, - solana_sdk::vote::instruction::VoteInstruction, + solana_program::vote::instruction::VoteInstruction, }; pub fn parse_vote( @@ -284,18 +284,14 @@ fn check_num_vote_accounts(accounts: &[u8], num: usize) -> Result<(), ParseInstr mod test { use { super::*, + solana_hash::Hash, solana_message::Message, - solana_sdk::{ - hash::Hash, - pubkey::Pubkey, - sysvar, - vote::{ - instruction as vote_instruction, - state::{ - TowerSync, Vote, VoteAuthorize, VoteInit, VoteStateUpdate, VoteStateVersions, - }, - }, + solana_program::vote::{ + instruction as vote_instruction, + state::{TowerSync, Vote, VoteAuthorize, VoteInit, VoteStateUpdate, VoteStateVersions}, }, + solana_pubkey::Pubkey, + solana_sdk_ids::sysvar, }; #[test]