0

I am getting an error message when creating a signature

Error: 

TransactionExpiredBlockheightExceededError: Signature 2XqzFuyv5YWpDPTT87CVu48QJPemGSu5rbCazrNBgY6D3mS8rugKugtzXDGpN6XZF8FPyWwXQvzfm4ZyMx6gTf6j has expired: block height exceeded.

Signature created like this:

const transaction = transaction.add(...)

  transaction.feePayer = publicKey;
          transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
          const latestBlockHash = await connection.getLatestBlockhash()

// ----> Phantom recommended way of signing tx
          const { signature }  = await provider.signAndSendTransaction(transaction);

 const confirmation = await connection.confirmTransaction(
            {
              blockhash: latestBlockHash.blockhash,
              lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
              signature,
            }
          );

After few seconds/minute or 2 I get the above error message although the TX is confirmed and finalized.

How to handle this? Why is the error popping up if the tx gets added to the block?

4
  • This error comes from connection.confirmTransaction, not from creating the signature.
    – agrippa
    Commented Jul 27, 2022 at 20:51
  • I expect that if you used connection.confirmTransaction(signature) you would not get this error, though this approach is apparently deprecated now.
    – agrippa
    Commented Jul 27, 2022 at 20:53
  • 1
    I’m voting to close this question because it’s already being tracked in GitHub issues as a bug: github.com/solana-labs/solana/issues/25955 Commented Jul 28, 2022 at 0:17
  • Let's close this one then. But it's good that thread is here on stack overflow so that people can follow from stack -> github.
    – Digital
    Commented Jul 28, 2022 at 9:00

2 Answers 2

1

This is a known bug that you can follow along with here: https://github.com/solana-labs/solana/issues/25955

1
  • Will vote to close this Stack Exchange question. Commented Jul 28, 2022 at 0:16
1

This is a bug. I'd suggest you make your experience known in the Github issue

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