what's a better way to handle "Timed out awaiting confirmation on transaction" error on Metaplex CMv2?

2.7k views Asked by At

the title speaks it all. Lately, I am facing Error: Timed out awaiting confirmation on transaction too often. Be it in a devnet or in a mainnet-beta

tried out various different custom --rpc's but most of the time it just doesn't help regardless of the internet speed, enough SOLs in a wallet and even minting only 1 NFT...

I can't think of any possible scenario which could reproduce/improve this error.

Any ideas/suggestions much appreciated

1

There are 1 answers

2
Jon C On BEST ANSWER

If the network is bogged down or has issues, transactions may not go through, and that's to be expected. It's recommended to retry transactions if they haven't been confirmed by the time the blockhash expires.

A few options to consider:

  • customize the confirmTransactionInitialTimeout in ConnectionConfig when creating your Connection object. You can bump this up to a higher number to wait longer
  • retry if an error is returned from confirmTransaction by calling sendTransaction once again. This will fetch a new blockhash, sign the transaction again, and send it again

More information about retrying transactions at https://solanacookbook.com/guides/retrying-transactions.html

You can see information about confirmed transactions by looking at the "Solana Ping Stats" at the bottom of the Explorer: https://explorer.solana.com/?cluster=devnet

You'll see that some proportion of transactions aren't confirmed.