Using new method to deploy the programs (#32638)
Using new method to deploy the programs, making blockheight comparison similar to previous implementation.
This commit is contained in:
parent
a9ecdc0ae5
commit
1999138e12
|
@ -21,6 +21,9 @@ use {
|
||||||
},
|
},
|
||||||
solana_client::{
|
solana_client::{
|
||||||
connection_cache::ConnectionCache,
|
connection_cache::ConnectionCache,
|
||||||
|
send_and_confirm_transactions_in_parallel::{
|
||||||
|
send_and_confirm_transactions_in_parallel_blocking, SendAndConfrimConfig,
|
||||||
|
},
|
||||||
tpu_client::{TpuClient, TpuClientConfig},
|
tpu_client::{TpuClient, TpuClientConfig},
|
||||||
},
|
},
|
||||||
solana_program_runtime::{compute_budget::ComputeBudget, invoke_context::InvokeContext},
|
solana_program_runtime::{compute_budget::ComputeBudget, invoke_context::InvokeContext},
|
||||||
|
@ -2178,16 +2181,29 @@ fn send_deploy_messages(
|
||||||
write_messages,
|
write_messages,
|
||||||
&[payer_signer, write_signer],
|
&[payer_signer, write_signer],
|
||||||
),
|
),
|
||||||
ConnectionCache::Quic(cache) => TpuClient::new_with_connection_cache(
|
ConnectionCache::Quic(cache) => {
|
||||||
rpc_client.clone(),
|
let tpu_client_fut = solana_client::nonblocking::tpu_client::TpuClient::new_with_connection_cache(
|
||||||
&config.websocket_url,
|
rpc_client.get_inner_client().clone(),
|
||||||
TpuClientConfig::default(),
|
config.websocket_url.as_str(),
|
||||||
|
solana_client::tpu_client::TpuClientConfig::default(),
|
||||||
cache,
|
cache,
|
||||||
)?
|
);
|
||||||
.send_and_confirm_messages_with_spinner(
|
let tpu_client = rpc_client
|
||||||
|
.runtime()
|
||||||
|
.block_on(tpu_client_fut)
|
||||||
|
.expect("Should return a valid tpu client");
|
||||||
|
|
||||||
|
send_and_confirm_transactions_in_parallel_blocking(
|
||||||
|
rpc_client.clone(),
|
||||||
|
Some(tpu_client),
|
||||||
write_messages,
|
write_messages,
|
||||||
&[payer_signer, write_signer],
|
&[payer_signer, write_signer],
|
||||||
),
|
SendAndConfrimConfig {
|
||||||
|
resign_txs_count: Some(5),
|
||||||
|
with_spinner: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
.map_err(|err| format!("Data writes to account failed: {err}"))?
|
.map_err(|err| format!("Data writes to account failed: {err}"))?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
|
@ -286,7 +286,7 @@ async fn confirm_transactions_till_block_height_and_resend_unexpired_transaction
|
||||||
|
|
||||||
// wait till all transactions are confirmed or we have surpassed max processing age for the last sent transaction
|
// wait till all transactions are confirmed or we have surpassed max processing age for the last sent transaction
|
||||||
while !unconfirmed_transasction_map.is_empty()
|
while !unconfirmed_transasction_map.is_empty()
|
||||||
&& current_block_height.load(Ordering::Relaxed) < max_valid_block_height
|
&& current_block_height.load(Ordering::Relaxed) <= max_valid_block_height
|
||||||
{
|
{
|
||||||
let blockheight = current_block_height.load(Ordering::Relaxed);
|
let blockheight = current_block_height.load(Ordering::Relaxed);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue