Blockhash not found when using nonce

Blockhash not found when using nonce

Manage alerts

Loading saved threads...

Rahul G · External communityPost link
External question — Solana Stack Exchange Author: Rahul G Original post: https://solana.stackexchange.com/questions/7497 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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.
Quote
Report
Adam · External communityPost link
External answer — Solana Stack Exchange Author: Adam Original post: https://solana.stackexchange.com/a/8156 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Apologies for the delay in response. If this difference still exists, please post on the Phantom developer discussions available here .
Quote
Report
JonneyY · External communityPost link
External answer — Solana Stack Exchange Author: JonneyY Original post: https://solana.stackexchange.com/a/16015 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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();
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External answer — Solana Stack Exchange Author: JonneyY Source score (net votes, not local likes): 0 Original post: https://solana.stackexchange.com/a/16015 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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();

Cancel quote

Checking account access…