Solana program deployment failed because blockhash was expired during… (#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
This commit is contained in:
galactus 2024-01-05 12:47:21 +01:00 committed by GitHub
parent b8144979dc
commit bbb4118ac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

View File

@ -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));