Update SWQOS submit behavior
This commit is contained in:
@@ -96,6 +96,7 @@ impl TradeExecutor for GenericTradeExecutor {
|
||||
total_start.as_ref().map(|s| s.elapsed()).unwrap_or(Duration::ZERO);
|
||||
let before_submit_us = (params.log_enabled && crate::common::sdk_log::sdk_log_enabled())
|
||||
.then(crate::common::clock::now_micros);
|
||||
let address_lookup_table_accounts = params.address_lookup_table_accounts.clone();
|
||||
|
||||
if params.simulate {
|
||||
let send_start = crate::common::sdk_log::sdk_log_enabled().then(Instant::now);
|
||||
@@ -103,7 +104,7 @@ impl TradeExecutor for GenericTradeExecutor {
|
||||
params.rpc,
|
||||
params.payer,
|
||||
final_instructions,
|
||||
params.address_lookup_table_account,
|
||||
address_lookup_table_accounts,
|
||||
params.recent_blockhash,
|
||||
params.durable_nonce,
|
||||
params.middleware_manager,
|
||||
@@ -157,16 +158,16 @@ impl TradeExecutor for GenericTradeExecutor {
|
||||
}
|
||||
|
||||
let need_confirm = params.wait_tx_confirmed;
|
||||
// When the caller confirms externally (need_confirm = false) and opts in
|
||||
// via SwapParams.wait_for_all_submits, return every route's signature so
|
||||
// pinned-nonce confirmation can poll all of them.
|
||||
let wait_for_all_submits = !need_confirm && params.wait_for_all_submits;
|
||||
// Each SWQOS lane may submit a distinct transaction because relay tips
|
||||
// can use different accounts, so confirmation must be able to poll every
|
||||
// returned signature when the caller opts in.
|
||||
let wait_for_all_submits = params.wait_for_all_submits;
|
||||
let sender_config = params.sender_concurrency_config();
|
||||
let result = execute_parallel(
|
||||
params.swqos_clients.as_slice(),
|
||||
params.payer,
|
||||
final_instructions,
|
||||
params.address_lookup_table_account,
|
||||
address_lookup_table_accounts,
|
||||
params.recent_blockhash,
|
||||
params.durable_nonce,
|
||||
params.middleware_manager,
|
||||
@@ -253,7 +254,7 @@ async fn simulate_transaction(
|
||||
rpc: Option<Arc<SolanaRpcClient>>,
|
||||
payer: Arc<Keypair>,
|
||||
instructions: Vec<Instruction>,
|
||||
address_lookup_table_account: Option<AddressLookupTableAccount>,
|
||||
address_lookup_table_accounts: Vec<AddressLookupTableAccount>,
|
||||
recent_blockhash: Option<Hash>,
|
||||
durable_nonce: Option<DurableNonceInfo>,
|
||||
middleware_manager: Option<Arc<MiddlewareManager>>,
|
||||
@@ -288,7 +289,7 @@ async fn simulate_transaction(
|
||||
unit_limit,
|
||||
unit_price,
|
||||
&instructions,
|
||||
address_lookup_table_account.as_ref(),
|
||||
address_lookup_table_accounts.as_slice(),
|
||||
recent_blockhash,
|
||||
middleware_manager.as_ref(),
|
||||
protocol_name,
|
||||
|
||||
Reference in New Issue
Block a user