0

When I broadcast a Transaction that is about to expire with SendTransaction, no error is returned from the node, but the Tx may not be taken into the network.

Is there any way to reliably detect this in SendTransaction?

now, Currently skipPreflight, preflightCommitment and maxRetries are not specified and are defaults.

If maxRetries is set to 0, no retries would be made. This way, can we reliably track SendTransaction failures?

1

1 Answer 1

1

I think this post/response might be what you need: https://solana.stackexchange.com/a/6088/121.

The confirmTransaction method might be sufficient for what you are trying to do (or sendAndConfirmTransaction which just uses sendAndConfirmTransaction under the hood).

Here are some good resources if you'd like to dig in a little deeper and/or create custom polling/retry logic:

Depeneding on your use case, you might try the experimental version of Solana/Web3.js, which allows building in custom retry logic.

4
  • Thank you. However, I am using another development language, not web3.js. Can the SendTransaction response confirm the success or failure of the Transaction? Should I use GetSignatureStatuses?
    – Koichi
    Commented Jan 31 at 4:10
  • Yeah--i actually think confirmTransaction is using getSignatureStatuses under the hood. Here's the source/polling logic.
    – AMilz
    Commented Jan 31 at 19:11
  • According to this article, it seems that the lastValidBlockHeight of getLatestBlockHash is kept, getBlockHeight is retrieved after SendTransaction, and the expiration date is checked to see if 150 slots have passed from the lastValidBlockHeight.
    – Koichi
    Commented Feb 7 at 9:06
  • Can the isBlockhashValid Method do the same thing? Which method would be more reliable?
    – Koichi
    Commented Feb 7 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.