From b11a56356d9c4b7386f465a97ce9ee24995f806b Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Tue, 9 Jul 2024 13:09:23 -0400 Subject: [PATCH 1/2] SDK: Fix the relay fee amount in Solana NTT --- solana/ts/sdk/ntt.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solana/ts/sdk/ntt.ts b/solana/ts/sdk/ntt.ts index 55b3c4270..541b6c970 100644 --- a/solana/ts/sdk/ntt.ts +++ b/solana/ts/sdk/ntt.ts @@ -5,6 +5,7 @@ import { AddressLookupTableAccount, Connection, Keypair, + LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction, @@ -391,7 +392,7 @@ export class SolanaNtt payerAddress, outboxItem.publicKey, destination.chain, - Number(fee), + Number(fee) / LAMPORTS_PER_SOL, // Note: quoter expects gas dropoff to be in terms of gwei Number(options.gasDropoff ?? 0n) / WEI_PER_GWEI ); From 6ea59aa284f9d14e91daf330ae4d5cc5f89468ff Mon Sep 17 00:00:00 2001 From: Ben Guidarelli Date: Tue, 9 Jul 2024 13:26:50 -0400 Subject: [PATCH 2/2] Request finalized blockhash in version fetch for Solana --- solana/ts/lib/ntt.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/solana/ts/lib/ntt.ts b/solana/ts/lib/ntt.ts index 7cf45da64..1a190abff 100644 --- a/solana/ts/lib/ntt.ts +++ b/solana/ts/lib/ntt.ts @@ -184,8 +184,11 @@ export namespace NTT { const program = getNttProgram(connection, programId.toString(), "1.0.0"); const ix = await program.methods.version().accountsStrict({}).instruction(); - const { blockhash } = - await program.provider.connection.getLatestBlockhash(); + // Since we don't need the very very very latest blockhash, using finalized + // ensures the blockhash will be found when we immediately simulate the tx + const { blockhash } = await program.provider.connection.getLatestBlockhash( + "finalized" + ); const msg = new TransactionMessage({ payerKey: sender, recentBlockhash: blockhash,