From bbb4118ac4b6dbeb2703cdeb774c168147fa291e Mon Sep 17 00:00:00 2001 From: galactus <96341601+godmodegalactus@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:47:21 +0100 Subject: [PATCH] =?UTF-8?q?Solana=20program=20deployment=20failed=20becaus?= =?UTF-8?q?e=20blockhash=20was=20expired=20during=E2=80=A6=20(#34621)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Solana program deployment failed because blockhash was expired during simulation, So we ignore these types of errors as we are going to retry with new blockhash anyways * Creating a single pattern matching after jon's review --- ...nd_and_confirm_transactions_in_parallel.rs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index 9185ed790..f97761cba 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -204,11 +204,21 @@ async fn send_transaction_with_rpc_fallback( ErrorKind::Io(_) | ErrorKind::Reqwest(_) => { // fall through on io error, we will retry the transaction } - ErrorKind::TransactionError(transaction_error) => { - context.error_map.insert(index, transaction_error.clone()); - return Ok(()); + ErrorKind::TransactionError(TransactionError::BlockhashNotFound) + | ErrorKind::RpcError(RpcError::RpcResponseError { + data: + RpcResponseErrorData::SendTransactionPreflightFailure( + RpcSimulateTransactionResult { + err: Some(TransactionError::BlockhashNotFound), + .. + }, + ), + .. + }) => { + // fall through so that we will resend with another blockhash } - ErrorKind::RpcError(RpcError::RpcResponseError { + ErrorKind::TransactionError(transaction_error) + | ErrorKind::RpcError(RpcError::RpcResponseError { data: RpcResponseErrorData::SendTransactionPreflightFailure( RpcSimulateTransactionResult { @@ -218,8 +228,8 @@ async fn send_transaction_with_rpc_fallback( ), .. }) => { + // if we get other than blockhash not found error the transaction is invalid context.error_map.insert(index, transaction_error.clone()); - return Ok(()); } _ => { return Err(TpuSenderError::from(e));