Skip to content

Commit

Permalink
Solana program deployment failed because blockhash was expired during… (
Browse files Browse the repository at this point in the history
solana-labs#34621)

* 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
  • Loading branch information
godmodegalactus authored Jan 5, 2024
1 parent b814497 commit bbb4118
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions client/src/send_and_confirm_transactions_in_parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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));
Expand Down

0 comments on commit bbb4118

Please sign in to comment.