Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - loader-v2 and loader-v3 deprecation warnings #4704

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,17 @@ fn process_program_deploy(
fetch_feature_set(&rpc_client)?
};

if !skip_feature_verification {
if feature_set.is_active(&solana_feature_set::enable_loader_v4::id()) {
warn!("Loader-v4 is available now. Please migrate your program.");
}
if do_initial_deploy
&& feature_set.is_active(&solana_feature_set::disable_new_loader_v3_deployments::id())
{
return Err("No new programs can be deployed on loader-v3. Please use the program-v4 subcommand instead.".into());
}
}

let (program_data, program_len, buffer_program_data) =
if let Some(program_location) = program_location {
let program_data = read_and_verify_elf(program_location, feature_set)?;
Expand Down Expand Up @@ -2472,6 +2483,7 @@ fn do_process_program_deploy(

// Create and add final message
let final_message = {
#[allow(deprecated)]
let instructions = bpf_loader_upgradeable::deploy_with_max_program_len(
&fee_payer_signer.pubkey(),
&program_signers[0].pubkey(),
Expand Down
7 changes: 0 additions & 7 deletions programs/sbf/Cargo.lock

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

1 change: 0 additions & 1 deletion programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ members = [
"rust/dup_accounts",
"rust/error_handling",
"rust/external_spend",
"rust/finalize",
"rust/get_minimum_delegation",
"rust/inner_instruction_alignment_check",
"rust/instruction_introspection",
Expand Down
18 changes: 0 additions & 18 deletions programs/sbf/rust/finalize/Cargo.toml

This file was deleted.

25 changes: 0 additions & 25 deletions programs/sbf/rust/finalize/src/lib.rs

This file was deleted.

8 changes: 5 additions & 3 deletions programs/sbf/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use {
},
loader_utils::{
create_program, instructions_to_load_program_of_loader_v4, load_program_from_file,
load_program_of_loader_v4, load_upgradeable_buffer, load_upgradeable_program,
load_program_of_loader_v4, load_upgradeable_buffer,
},
},
solana_runtime_transaction::runtime_transaction::RuntimeTransaction,
Expand Down Expand Up @@ -1491,7 +1491,8 @@ fn test_program_sbf_invoke_stable_genesis_and_bank() {
TransactionError::ProgramAccountNotFound
);

load_upgradeable_program(
#[allow(deprecated)]
solana_runtime::loader_utils::load_upgradeable_program(
&bank_client,
&mint_keypair,
&buffer_keypair,
Expand All @@ -1504,7 +1505,8 @@ fn test_program_sbf_invoke_stable_genesis_and_bank() {
let indirect_program_keypair = Keypair::from_base58_string(
"2BgE4gD5wUCwiAVPYbmWd2xzXSsD9W2fWgNjwmVkm8WL7i51vK9XAXNnX1VB6oKQZmjaUPRd5RzE6RggB9DeKbZC",
);
load_upgradeable_program(
#[allow(deprecated)]
solana_runtime::loader_utils::load_upgradeable_program(
&bank_client,
&mint_keypair,
&buffer_keypair,
Expand Down
1 change: 1 addition & 0 deletions runtime/src/bank/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7243,6 +7243,7 @@ fn test_bank_load_program() {
}
}

#[allow(deprecated)]
#[test]
fn test_bpf_loader_upgradeable_deploy_with_max_len() {
let (genesis_config, mint_keypair) = create_genesis_config_no_tx_fee(1_000_000_000);
Expand Down
6 changes: 6 additions & 0 deletions runtime/src/loader_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub fn load_upgradeable_buffer<T: Client>(
program
}

#[deprecated(since = "2.2.0", note = "Use load_program_of_loader_v4() instead")]
pub fn load_upgradeable_program(
bank_client: &BankClient,
from_keypair: &Keypair,
Expand All @@ -135,6 +136,7 @@ pub fn load_upgradeable_program(
name,
);

#[allow(deprecated)]
let message = Message::new(
&bpf_loader_upgradeable::deploy_with_max_program_len(
&from_keypair.pubkey(),
Expand Down Expand Up @@ -165,6 +167,7 @@ pub fn load_upgradeable_program(
});
}

#[deprecated(since = "2.2.0", note = "Use load_program_of_loader_v4() instead")]
pub fn load_upgradeable_program_wrapper(
bank_client: &BankClient,
mint_keypair: &Keypair,
Expand All @@ -173,6 +176,7 @@ pub fn load_upgradeable_program_wrapper(
) -> Pubkey {
let buffer_keypair = Keypair::new();
let program_keypair = Keypair::new();
#[allow(deprecated)]
load_upgradeable_program(
bank_client,
mint_keypair,
Expand All @@ -184,13 +188,15 @@ pub fn load_upgradeable_program_wrapper(
program_keypair.pubkey()
}

#[deprecated(since = "2.2.0", note = "Use load_program_of_loader_v4() instead")]
pub fn load_upgradeable_program_and_advance_slot(
bank_client: &mut BankClient,
bank_forks: &RwLock<BankForks>,
mint_keypair: &Keypair,
authority_keypair: &Keypair,
name: &str,
) -> (Arc<Bank>, Pubkey) {
#[allow(deprecated)]
let program_id =
load_upgradeable_program_wrapper(bank_client, mint_keypair, authority_keypair, name);

Expand Down
2 changes: 2 additions & 0 deletions sdk/loader-v2-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub enum LoaderInstruction {
Finalize,
}

#[deprecated(since = "2.2.0", note = "Use loader-v4 instead")]
#[cfg(feature = "bincode")]
pub fn write(
account_pubkey: &Pubkey,
Expand All @@ -53,6 +54,7 @@ pub fn write(
)
}

#[deprecated(since = "2.2.0", note = "Use loader-v4 instead")]
#[cfg(feature = "bincode")]
pub fn finalize(account_pubkey: &Pubkey, program_id: &Pubkey) -> Instruction {
let account_metas = vec![
Expand Down
1 change: 1 addition & 0 deletions sdk/loader-v3-interface/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ pub fn write(
)
}

#[deprecated(since = "2.2.0", note = "Use loader-v4 instead")]
#[cfg(feature = "bincode")]
/// Returns the instructions required to deploy a program with a specified
/// maximum program length. The maximum length must be large enough to
Expand Down
1 change: 1 addition & 0 deletions sdk/program/src/bpf_loader_upgradeable.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#[deprecated(since = "2.2.0", note = "Use solana-loader-v3-interface instead")]
#[allow(deprecated)]
pub use solana_loader_v3_interface::{
get_program_data_address,
instruction::{
Expand Down
3 changes: 3 additions & 0 deletions transaction-status/src/parse_bpf_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ mod test {
let account_keys = vec![fee_payer, account_pubkey];
let missing_account_keys = vec![account_pubkey];

#[allow(deprecated)]
let instruction =
solana_loader_v2_interface::write(&account_pubkey, &program_id, offset, bytes.clone());
let mut message = Message::new(&[instruction], Some(&fee_payer));
Expand Down Expand Up @@ -252,6 +253,7 @@ mod test {
)
.is_err());

#[allow(deprecated)]
let instruction = solana_loader_v2_interface::finalize(&account_pubkey, &program_id);
let mut message = Message::new(&[instruction], Some(&fee_payer));
assert_eq!(
Expand Down Expand Up @@ -404,6 +406,7 @@ mod test {
&bpf_loader_upgradeable::id(),
)
.0;
#[allow(deprecated)]
let instructions = bpf_loader_upgradeable::deploy_with_max_program_len(
&payer_address,
&program_address,
Expand Down
Loading