|
|
@@ -5,7 +5,7 @@ use {
|
|
|
log_instruction_custom_error, CliCommand, CliCommandInfo, CliConfig, CliError,
|
|
|
ProcessResult,
|
|
|
},
|
|
|
- compute_budget::WithComputeUnitPrice,
|
|
|
+ compute_budget::{ComputeUnitConfig, WithComputeUnitConfig},
|
|
|
feature::get_feature_activation_epoch,
|
|
|
memo::WithMemo,
|
|
|
nonce::check_nonce_account,
|
|
|
@@ -13,7 +13,7 @@ use {
|
|
|
},
|
|
|
clap::{value_t, App, Arg, ArgGroup, ArgMatches, SubCommand},
|
|
|
solana_clap_utils::{
|
|
|
- compute_unit_price::{compute_unit_price_arg, COMPUTE_UNIT_PRICE_ARG},
|
|
|
+ compute_budget::{compute_unit_price_arg, ComputeUnitLimit, COMPUTE_UNIT_PRICE_ARG},
|
|
|
fee_payer::{fee_payer_arg, FEE_PAYER_ARG},
|
|
|
hidden_unless_forced,
|
|
|
input_parsers::*,
|
|
|
@@ -1420,7 +1420,7 @@ pub fn process_create_stake_account(
|
|
|
memo: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
from: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let stake_account = config.signers[stake_account];
|
|
|
let stake_account_address = if let Some(seed) = seed {
|
|
|
@@ -1478,7 +1478,10 @@ pub fn process_create_stake_account(
|
|
|
),
|
|
|
}
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
if let Some(nonce_account) = &nonce_account {
|
|
|
Message::new_with_nonce(
|
|
|
ixs,
|
|
|
@@ -1567,7 +1570,7 @@ pub fn process_stake_authorize(
|
|
|
memo: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
no_wait: bool,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let mut ixs = Vec::new();
|
|
|
let custodian = custodian.map(|index| config.signers[index]);
|
|
|
@@ -1635,7 +1638,10 @@ pub fn process_stake_authorize(
|
|
|
}
|
|
|
ixs = ixs
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
|
|
|
let recent_blockhash = blockhash_query.get_blockhash(rpc_client, config.commitment)?;
|
|
|
|
|
|
@@ -1703,7 +1709,7 @@ pub fn process_deactivate_stake_account(
|
|
|
memo: Option<&String>,
|
|
|
seed: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let recent_blockhash = blockhash_query.get_blockhash(rpc_client, config.commitment)?;
|
|
|
|
|
|
@@ -1780,7 +1786,10 @@ pub fn process_deactivate_stake_account(
|
|
|
stake_instruction::deactivate_stake(&stake_account_address, &stake_authority.pubkey())
|
|
|
}]
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
|
|
|
let nonce_authority = config.signers[nonce_authority];
|
|
|
let fee_payer = config.signers[fee_payer];
|
|
|
@@ -1844,7 +1853,7 @@ pub fn process_withdraw_stake(
|
|
|
memo: Option<&String>,
|
|
|
seed: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let withdraw_authority = config.signers[withdraw_authority];
|
|
|
let custodian = custodian.map(|index| config.signers[index]);
|
|
|
@@ -1869,7 +1878,10 @@ pub fn process_withdraw_stake(
|
|
|
custodian.map(|signer| signer.pubkey()).as_ref(),
|
|
|
)]
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
|
|
|
if let Some(nonce_account) = &nonce_account {
|
|
|
Message::new_with_nonce(
|
|
|
@@ -1942,7 +1954,7 @@ pub fn process_split_stake(
|
|
|
split_stake_account_seed: &Option<String>,
|
|
|
lamports: u64,
|
|
|
fee_payer: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
rent_exempt_reserve: Option<&u64>,
|
|
|
) -> ProcessResult {
|
|
|
let split_stake_account = config.signers[split_stake_account];
|
|
|
@@ -2048,7 +2060,10 @@ pub fn process_split_stake(
|
|
|
seed,
|
|
|
)
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price),
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ }),
|
|
|
)
|
|
|
} else {
|
|
|
ixs.append(
|
|
|
@@ -2059,7 +2074,10 @@ pub fn process_split_stake(
|
|
|
&split_stake_account_address,
|
|
|
)
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price),
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ }),
|
|
|
)
|
|
|
};
|
|
|
|
|
|
@@ -2121,7 +2139,7 @@ pub fn process_merge_stake(
|
|
|
nonce_authority: SignerIndex,
|
|
|
memo: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let fee_payer = config.signers[fee_payer];
|
|
|
|
|
|
@@ -2167,7 +2185,10 @@ pub fn process_merge_stake(
|
|
|
&stake_authority.pubkey(),
|
|
|
)
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
|
|
|
let nonce_authority = config.signers[nonce_authority];
|
|
|
|
|
|
@@ -2232,7 +2253,7 @@ pub fn process_stake_set_lockup(
|
|
|
nonce_authority: SignerIndex,
|
|
|
memo: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
let recent_blockhash = blockhash_query.get_blockhash(rpc_client, config.commitment)?;
|
|
|
let custodian = config.signers[custodian];
|
|
|
@@ -2243,7 +2264,10 @@ pub fn process_stake_set_lockup(
|
|
|
stake_instruction::set_lockup(stake_account_pubkey, lockup, &custodian.pubkey())
|
|
|
}]
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
let nonce_authority = config.signers[nonce_authority];
|
|
|
let fee_payer = config.signers[fee_payer];
|
|
|
|
|
|
@@ -2658,7 +2682,7 @@ pub fn process_delegate_stake(
|
|
|
memo: Option<&String>,
|
|
|
fee_payer: SignerIndex,
|
|
|
redelegation_stake_account: Option<SignerIndex>,
|
|
|
- compute_unit_price: Option<&u64>,
|
|
|
+ compute_unit_price: Option<u64>,
|
|
|
) -> ProcessResult {
|
|
|
check_unique_pubkeys(
|
|
|
(&config.signers[0].pubkey(), "cli keypair".to_string()),
|
|
|
@@ -2749,7 +2773,10 @@ pub fn process_delegate_stake(
|
|
|
)]
|
|
|
}
|
|
|
.with_memo(memo)
|
|
|
- .with_compute_unit_price(compute_unit_price);
|
|
|
+ .with_compute_unit_config(&ComputeUnitConfig {
|
|
|
+ compute_unit_price,
|
|
|
+ compute_unit_limit: ComputeUnitLimit::Default,
|
|
|
+ });
|
|
|
|
|
|
let nonce_authority = config.signers[nonce_authority];
|
|
|
let fee_payer = config.signers[fee_payer];
|