|
@@ -234,9 +234,10 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
Arg::with_name("program_id")
|
|
Arg::with_name("program_id")
|
|
|
.long("program-id")
|
|
.long("program-id")
|
|
|
.value_name("PROGRAM_ID"),
|
|
.value_name("PROGRAM_ID"),
|
|
|
- "Executable program; must be a signer for initial deploys, \
|
|
|
|
|
- can be an address for upgrades [default: address of keypair at \
|
|
|
|
|
- /path/to/program-keypair.json if present, otherwise a random address]."
|
|
|
|
|
|
|
+ "Executable program; must be a signer for initial deploys, can be an \
|
|
|
|
|
+ address for upgrades [default: address of keypair at \
|
|
|
|
|
+ /path/to/program-keypair.json if present, otherwise a random \
|
|
|
|
|
+ address]."
|
|
|
))
|
|
))
|
|
|
.arg(
|
|
.arg(
|
|
|
Arg::with_name("final")
|
|
Arg::with_name("final")
|
|
@@ -250,8 +251,8 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
.takes_value(true)
|
|
.takes_value(true)
|
|
|
.required(false)
|
|
.required(false)
|
|
|
.help(
|
|
.help(
|
|
|
- "Maximum length of the upgradeable program \
|
|
|
|
|
- [default: the length of the original deployed program]",
|
|
|
|
|
|
|
+ "Maximum length of the upgradeable program [default: the \
|
|
|
|
|
+ length of the original deployed program]",
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.arg(
|
|
.arg(
|
|
@@ -272,20 +273,20 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
.default_value("5")
|
|
.default_value("5")
|
|
|
.help(
|
|
.help(
|
|
|
"Maximum number of attempts to sign or resign transactions \
|
|
"Maximum number of attempts to sign or resign transactions \
|
|
|
- after blockhash expiration. \
|
|
|
|
|
- If any transactions sent during the program deploy are still \
|
|
|
|
|
- unconfirmed after the initially chosen recent blockhash \
|
|
|
|
|
- expires, those transactions will be resigned with a new \
|
|
|
|
|
- recent blockhash and resent. Use this setting to adjust \
|
|
|
|
|
- the maximum number of transaction signing iterations. Each \
|
|
|
|
|
- blockhash is valid for about 60 seconds, which means using \
|
|
|
|
|
- the default value of 5 will lead to sending transactions \
|
|
|
|
|
- for at least 5 minutes or until all transactions are confirmed,\
|
|
|
|
|
- whichever comes first.",
|
|
|
|
|
|
|
+ after blockhash expiration. If any transactions sent during \
|
|
|
|
|
+ the program deploy are still unconfirmed after the initially \
|
|
|
|
|
+ chosen recent blockhash expires, those transactions will be \
|
|
|
|
|
+ resigned with a new recent blockhash and resent. Use this \
|
|
|
|
|
+ setting to adjust the maximum number of transaction signing \
|
|
|
|
|
+ iterations. Each blockhash is valid for about 60 seconds, \
|
|
|
|
|
+ which means using the default value of 5 will lead to \
|
|
|
|
|
+ sending transactions for at least 5 minutes or until all \
|
|
|
|
|
+ transactions are confirmed,whichever comes first.",
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.arg(Arg::with_name("use_rpc").long("use-rpc").help(
|
|
.arg(Arg::with_name("use_rpc").long("use-rpc").help(
|
|
|
- "Send write transactions to the configured RPC instead of validator TPUs",
|
|
|
|
|
|
|
+ "Send write transactions to the configured RPC instead of validator \
|
|
|
|
|
+ TPUs",
|
|
|
))
|
|
))
|
|
|
.arg(compute_unit_price_arg())
|
|
.arg(compute_unit_price_arg())
|
|
|
.arg(
|
|
.arg(
|
|
@@ -298,9 +299,12 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
Arg::with_name("skip_feature_verify")
|
|
Arg::with_name("skip_feature_verify")
|
|
|
.long("skip-feature-verify")
|
|
.long("skip-feature-verify")
|
|
|
.takes_value(false)
|
|
.takes_value(false)
|
|
|
- .help("Don't verify program against the activated feature set. \
|
|
|
|
|
- This setting means a program containing a syscall not yet active on \
|
|
|
|
|
- mainnet will succeed local verification, but fail during the last step of deployment.")
|
|
|
|
|
|
|
+ .help(
|
|
|
|
|
+ "Don't verify program against the activated feature set. This \
|
|
|
|
|
+ setting means a program containing a syscall not yet active \
|
|
|
|
|
+ on mainnet will succeed local verification, but fail during \
|
|
|
|
|
+ the last step of deployment.",
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.subcommand(
|
|
.subcommand(
|
|
@@ -335,9 +339,12 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
Arg::with_name("skip_feature_verify")
|
|
Arg::with_name("skip_feature_verify")
|
|
|
.long("skip-feature-verify")
|
|
.long("skip-feature-verify")
|
|
|
.takes_value(false)
|
|
.takes_value(false)
|
|
|
- .help("Don't verify program against the activated feature set. \
|
|
|
|
|
- This setting means a program containing a syscall not yet active on \
|
|
|
|
|
- mainnet will succeed local verification, but fail during the last step of deployment.")
|
|
|
|
|
|
|
+ .help(
|
|
|
|
|
+ "Don't verify program against the activated feature set. This \
|
|
|
|
|
+ setting means a program containing a syscall not yet active \
|
|
|
|
|
+ on mainnet will succeed local verification, but fail during \
|
|
|
|
|
+ the last step of deployment.",
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
.offline_args(),
|
|
.offline_args(),
|
|
|
)
|
|
)
|
|
@@ -378,8 +385,8 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
.takes_value(true)
|
|
.takes_value(true)
|
|
|
.required(false)
|
|
.required(false)
|
|
|
.help(
|
|
.help(
|
|
|
- "Maximum length of the upgradeable program \
|
|
|
|
|
- [default: the length of the original deployed program]",
|
|
|
|
|
|
|
+ "Maximum length of the upgradeable program [default: the \
|
|
|
|
|
+ length of the original deployed program]",
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.arg(
|
|
.arg(
|
|
@@ -390,16 +397,15 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
.default_value("5")
|
|
.default_value("5")
|
|
|
.help(
|
|
.help(
|
|
|
"Maximum number of attempts to sign or resign transactions \
|
|
"Maximum number of attempts to sign or resign transactions \
|
|
|
- after blockhash expiration. \
|
|
|
|
|
- If any transactions sent during the program deploy are still \
|
|
|
|
|
- unconfirmed after the initially chosen recent blockhash \
|
|
|
|
|
- expires, those transactions will be resigned with a new \
|
|
|
|
|
- recent blockhash and resent. Use this setting to adjust \
|
|
|
|
|
- the maximum number of transaction signing iterations. Each \
|
|
|
|
|
- blockhash is valid for about 60 seconds, which means using \
|
|
|
|
|
- the default value of 5 will lead to sending transactions \
|
|
|
|
|
- for at least 5 minutes or until all transactions are confirmed,\
|
|
|
|
|
- whichever comes first.",
|
|
|
|
|
|
|
+ after blockhash expiration. If any transactions sent during \
|
|
|
|
|
+ the program deploy are still unconfirmed after the initially \
|
|
|
|
|
+ chosen recent blockhash expires, those transactions will be \
|
|
|
|
|
+ resigned with a new recent blockhash and resent. Use this \
|
|
|
|
|
+ setting to adjust the maximum number of transaction signing \
|
|
|
|
|
+ iterations. Each blockhash is valid for about 60 seconds, \
|
|
|
|
|
+ which means using the default value of 5 will lead to \
|
|
|
|
|
+ sending transactions for at least 5 minutes or until all \
|
|
|
|
|
+ transactions are confirmed,whichever comes first.",
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.arg(Arg::with_name("use_rpc").long("use-rpc").help(
|
|
.arg(Arg::with_name("use_rpc").long("use-rpc").help(
|
|
@@ -410,9 +416,12 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
Arg::with_name("skip_feature_verify")
|
|
Arg::with_name("skip_feature_verify")
|
|
|
.long("skip-feature-verify")
|
|
.long("skip-feature-verify")
|
|
|
.takes_value(false)
|
|
.takes_value(false)
|
|
|
- .help("Don't verify program against the activated feature set. \
|
|
|
|
|
- This setting means a program containing a syscall not yet active on \
|
|
|
|
|
- mainnet will succeed local verification, but fail during the last step of deployment.")
|
|
|
|
|
|
|
+ .help(
|
|
|
|
|
+ "Don't verify program against the activated feature set. This \
|
|
|
|
|
+ setting means a program containing a syscall not yet active \
|
|
|
|
|
+ on mainnet will succeed local verification, but fail during \
|
|
|
|
|
+ the last step of deployment.",
|
|
|
|
|
+ ),
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.subcommand(
|
|
.subcommand(
|
|
@@ -598,8 +607,8 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
Arg::with_name("recipient_account")
|
|
Arg::with_name("recipient_account")
|
|
|
.long("recipient")
|
|
.long("recipient")
|
|
|
.value_name("RECIPIENT_ADDRESS"),
|
|
.value_name("RECIPIENT_ADDRESS"),
|
|
|
- "Recipient of closed account's lamports \
|
|
|
|
|
- [default: the default configured keypair]."
|
|
|
|
|
|
|
+ "Recipient of closed account's lamports [default: the default \
|
|
|
|
|
+ configured keypair]."
|
|
|
))
|
|
))
|
|
|
.arg(
|
|
.arg(
|
|
|
Arg::with_name("lamports")
|
|
Arg::with_name("lamports")
|
|
@@ -643,9 +652,7 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
)
|
|
)
|
|
|
.subcommand(
|
|
.subcommand(
|
|
|
SubCommand::with_name("migrate")
|
|
SubCommand::with_name("migrate")
|
|
|
- .about(
|
|
|
|
|
- "Migrates an upgradeable program to loader-v4",
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ .about("Migrates an upgradeable program to loader-v4")
|
|
|
.arg(
|
|
.arg(
|
|
|
Arg::with_name("program_id")
|
|
Arg::with_name("program_id")
|
|
|
.index(1)
|
|
.index(1)
|
|
@@ -662,8 +669,7 @@ impl ProgramSubCommands for App<'_, '_> {
|
|
|
.takes_value(true)
|
|
.takes_value(true)
|
|
|
.validator(is_valid_signer)
|
|
.validator(is_valid_signer)
|
|
|
.help(
|
|
.help(
|
|
|
- "Upgrade authority [default: the default configured \
|
|
|
|
|
- keypair]",
|
|
|
|
|
|
|
+ "Upgrade authority [default: the default configured keypair]",
|
|
|
),
|
|
),
|
|
|
)
|
|
)
|
|
|
.arg(compute_unit_price_arg()),
|
|
.arg(compute_unit_price_arg()),
|
|
@@ -1533,10 +1539,7 @@ fn fetch_verified_buffer_program_data(
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
verify_elf(&buffer_program_data, feature_set).map_err(|err| {
|
|
verify_elf(&buffer_program_data, feature_set).map_err(|err| {
|
|
|
- format!(
|
|
|
|
|
- "Buffer account {buffer_pubkey} has invalid program data: {:?}",
|
|
|
|
|
- err
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ format!("Buffer account {buffer_pubkey} has invalid program data: {err:?}")
|
|
|
})?;
|
|
})?;
|
|
|
|
|
|
|
|
Ok(buffer_program_data)
|
|
Ok(buffer_program_data)
|
|
@@ -1569,8 +1572,8 @@ fn fetch_buffer_program_data(
|
|
|
}
|
|
}
|
|
|
if authority_address != Some(buffer_authority) {
|
|
if authority_address != Some(buffer_authority) {
|
|
|
return Err(format!(
|
|
return Err(format!(
|
|
|
- "Buffer's authority {:?} does not match authority provided {}",
|
|
|
|
|
- authority_address, buffer_authority
|
|
|
|
|
|
|
+ "Buffer's authority {authority_address:?} does not match authority provided \
|
|
|
|
|
+ {buffer_authority}"
|
|
|
)
|
|
)
|
|
|
.into());
|
|
.into());
|
|
|
}
|
|
}
|
|
@@ -3020,8 +3023,8 @@ fn extend_program_data_if_needed(
|
|
|
let max_program_len = max_permitted_data_length
|
|
let max_program_len = max_permitted_data_length
|
|
|
.saturating_sub(UpgradeableLoaderState::size_of_programdata(0));
|
|
.saturating_sub(UpgradeableLoaderState::size_of_programdata(0));
|
|
|
return Err(format!(
|
|
return Err(format!(
|
|
|
- "New program ({program_id}) data account is too big: {required_len}.\n\
|
|
|
|
|
- Maximum program size: {max_program_len}.",
|
|
|
|
|
|
|
+ "New program ({program_id}) data account is too big: {required_len}.\nMaximum program \
|
|
|
|
|
+ size: {max_program_len}.",
|
|
|
)
|
|
)
|
|
|
.into());
|
|
.into());
|
|
|
}
|
|
}
|
|
@@ -3250,7 +3253,7 @@ fn send_deploy_messages(
|
|
|
|
|
|
|
|
if !transaction_errors.is_empty() {
|
|
if !transaction_errors.is_empty() {
|
|
|
for transaction_error in &transaction_errors {
|
|
for transaction_error in &transaction_errors {
|
|
|
- error!("{:?}", transaction_error);
|
|
|
|
|
|
|
+ error!("{transaction_error:?}");
|
|
|
}
|
|
}
|
|
|
return Err(
|
|
return Err(
|
|
|
format!("{} write transactions failed", transaction_errors.len()).into(),
|
|
format!("{} write transactions failed", transaction_errors.len()).into(),
|
|
@@ -3717,8 +3720,8 @@ mod tests {
|
|
|
"test",
|
|
"test",
|
|
|
"program",
|
|
"program",
|
|
|
"upgrade",
|
|
"upgrade",
|
|
|
- format!("{}", buffer_key).as_str(),
|
|
|
|
|
- format!("{}", program_key).as_str(),
|
|
|
|
|
|
|
+ format!("{buffer_key}").as_str(),
|
|
|
|
|
+ format!("{program_key}").as_str(),
|
|
|
"--skip-feature-verify",
|
|
"--skip-feature-verify",
|
|
|
]);
|
|
]);
|
|
|
assert_eq!(
|
|
assert_eq!(
|