Skip to content

Commit

Permalink
remove solana-sdk from loader-v4-program
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Jan 7, 2025
1 parent b73993b commit ace7e19
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 24 deletions.
10 changes: 9 additions & 1 deletion Cargo.lock

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

16 changes: 14 additions & 2 deletions programs/loader-v4/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ edition = { workspace = true }

[dependencies]
log = { workspace = true }
solana-account = { workspace = true }
solana-bincode = { workspace = true }
solana-bpf-loader-program = { workspace = true }
solana-compute-budget = { workspace = true }
solana-instruction = { workspace = true }
solana-log-collector = { workspace = true }
solana-measure = { workspace = true }
solana-packet = { workspace = true }
solana-program = { workspace = true }
solana-program-runtime = { workspace = true }
solana-pubkey = { workspace = true }
solana-sbpf = { workspace = true }
solana-sdk = { workspace = true }
solana-transaction-context = { workspace = true }
solana-type-overrides = { workspace = true }

[dev-dependencies]
bincode = { workspace = true }
solana-clock = { workspace = true }
solana-sysvar = { workspace = true }

[lib]
crate-type = ["lib"]
Expand All @@ -30,4 +38,8 @@ name = "solana_loader_v4_program"
targets = ["x86_64-unknown-linux-gnu"]

[features]
shuttle-test = ["solana-type-overrides/shuttle-test", "solana-program-runtime/shuttle-test", "solana-sbpf/shuttle-test"]
shuttle-test = [
"solana-type-overrides/shuttle-test",
"solana-program-runtime/shuttle-test",
"solana-sbpf/shuttle-test"
]
36 changes: 17 additions & 19 deletions programs/loader-v4/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use {
solana_bincode::limited_deserialize,
solana_bpf_loader_program::{deploy_program, deploy_program_internal, execute},
solana_instruction::error::InstructionError,
solana_log_collector::{ic_logger_msg, LogCollector},
solana_measure::measure::Measure,
solana_program::{
loader_v4::{self, LoaderV4State, LoaderV4Status, DEPLOYMENT_COOLDOWN_IN_SLOTS},
loader_v4_instruction::LoaderV4Instruction,
},
solana_program_runtime::{
invoke_context::InvokeContext,
loaded_programs::{ProgramCacheEntry, ProgramCacheEntryOwner, ProgramCacheEntryType},
},
solana_pubkey::Pubkey,
solana_sbpf::{declare_builtin_function, memory_region::MemoryMapping},
solana_sdk::{
instruction::InstructionError,
loader_v4::{self, LoaderV4State, LoaderV4Status, DEPLOYMENT_COOLDOWN_IN_SLOTS},
loader_v4_instruction::LoaderV4Instruction,
program_utils::limited_deserialize,
pubkey::Pubkey,
transaction_context::{BorrowedAccount, InstructionContext},
},
solana_transaction_context::{BorrowedAccount, InstructionContext},
solana_type_overrides::sync::{atomic::Ordering, Arc},
std::{cell::RefCell, rc::Rc},
};
Expand Down Expand Up @@ -429,7 +429,7 @@ pub fn process_instruction_inner(
let program_id = instruction_context.get_last_program_key(transaction_context)?;
if loader_v4::check_id(program_id) {
invoke_context.consume_checked(DEFAULT_COMPUTE_UNITS)?;
match limited_deserialize(instruction_data)? {
match limited_deserialize(instruction_data, solana_packet::PACKET_DATA_SIZE as u64)? {
LoaderV4Instruction::Write { offset, bytes } => {
process_instruction_write(invoke_context, offset, bytes)
}
Expand Down Expand Up @@ -480,18 +480,16 @@ pub fn process_instruction_inner(
mod tests {
use {
super::*,
solana_account::{
create_account_shared_data_for_test, AccountSharedData, ReadableAccount,
WritableAccount,
},
solana_bpf_loader_program::test_utils,
solana_clock::Slot,
solana_instruction::AccountMeta,
solana_program_runtime::invoke_context::mock_process_instruction,
solana_sdk::{
account::{
create_account_shared_data_for_test, AccountSharedData, ReadableAccount,
WritableAccount,
},
instruction::AccountMeta,
slot_history::Slot,
sysvar::{clock, rent},
transaction_context::IndexOfAccount,
},
solana_sysvar::{clock, rent},
solana_transaction_context::IndexOfAccount,
std::{fs::File, io::Read, path::Path},
};

Expand Down
8 changes: 7 additions & 1 deletion programs/sbf/Cargo.lock

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

8 changes: 7 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 ace7e19

Please sign in to comment.