From 1855a5fa0df921203a3423db975bacf5a5369ddc Mon Sep 17 00:00:00 2001 From: Antonio Ventilii Date: Thu, 23 Jan 2025 07:48:57 -0300 Subject: [PATCH] feat(frontend): make the Solana getLatestBlockhash last longer (#4417) # Motivation The default commitment level for Solana method `getLatestBlockhash` is `finalized`. However, it is ok to be more lax and accept a commitment level of `confirmed`, since it will give a longer life to our transactions (in case the network slows down a little). We use this method just for sending transactions, so it is acceptable. --- src/frontend/src/sol/services/sol-send.services.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/sol/services/sol-send.services.ts b/src/frontend/src/sol/services/sol-send.services.ts index 6d40e86124..4ca5e61498 100644 --- a/src/frontend/src/sol/services/sol-send.services.ts +++ b/src/frontend/src/sol/services/sol-send.services.ts @@ -60,7 +60,7 @@ export const setLifetimeAndFeePayerToTransaction = async ({ feePayer: TransactionSigner; }): Promise => { const { getLatestBlockhash } = rpc; - const { value: latestBlockhash } = await getLatestBlockhash().send(); + const { value: latestBlockhash } = await getLatestBlockhash({ commitment: 'confirmed' }).send(); return pipe( transactionMessage,