0

I'm invoking a POST API that sends a transaction to the smart contract. To ensure the durability of the transaction, I'm using a nonce account. On creating the transaction for the SC, I've set the recentBlockhash equal to the nonce of the nonce account to ensure the durability of the transaction.

On Firefox, everything is working fine, and I'm using Phantom Wallet version '23.5.0.1'.

However, on Chrome, when I invoke the same API, Phantom Wallet sends a warning that the 'transaction expired.It is due to the change in the order of the instructions in transaction object, in Firefox the ordering is {nonce account, main instruction, and two system instructions}, whereas in Chrome the ordering changes.' If I ignore warning and proceed anyway, the API crashes, indicating that the 'Blockhash not found'. Here Phantom Wallet version '23.12.0'

I would like to understand why this behavior differs between the two browsers.

1
  • It sounds like something might have changed between those releases -- try reaching out directly to phantom dev support to see what they advise.
    – Jon C
    Commented Sep 13, 2023 at 11:41

2 Answers 2

0

Apologies for the delay in response. If this difference still exists, please post on the Phantom developer discussions available here.

0

AdvanceNonce must be placed first among the instructions. Moreover, the signature of the wallet will automatically add two ComputeBudget instructions to the beginning of the array, which would lead to the failure of the Nonce. As a result, the "Blockhash not found" error is reported. Therefore, ComputeBudget instructions need to be added before signTransactions.

const messageV0 = new TransactionMessage({
            payerKey: publicKey!,
            recentBlockhash: nonceAccount.nonce,
            instructions: [
              advanceIX,
              ComputeBudgetProgram.setComputeUnitLimit({
                units: 100000,
              }),
              ComputeBudgetProgram.setComputeUnitPrice({
                microLamports: 10000,
              }),
              ...otherIxs,
            ],
          }).compileToV0Message();

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.