Skip to main content
3 of 5
added 410 characters in body
Digital
  • 175
  • 7

Confirmations vs commitment .how to to understand RpcResponse from a confirmation

So following the answer from this thread:

How many solana transaction confirmations are enough to declare a transaction as finalized before it hits 31 and actually finalizes itself?

Solana doesn't work with the "number of confirmations" scheme that is used in Ethereum with PoW. The commitment levels are based whether a supermajority of validators has confirmed the transaction (finalized) or includes votes from gossip (inter-validator communication) and replay (confirmed). Therefore, the time to confirmed and time to finalized can vary.

and documentation from: https://docs.solana.com/developing/clients/jsonrpc-api#default

If commitment configuration is not provided, the node will default to "finalized" commitment

On the front-end, when sending transactions like so

const signature = await provider.signAndSendTransaction(transaction);
          

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

I would get the following RpcResponse object

 const confirmationRpcResponse = {
    context: {slot: 150669448}
    value: {err: null}
    }

Is my understanding correct, that if I do not provide any commitment (in the signAndSendTransaction method) the RPC response confirmTransaction gives me information that transaction was finalized and I do not need any more "checking for confirmations", "checking for timestamps" etc. ?

Why does value key hold an err object and no actual value, like "processed" "finalized" "confirmed" - anything that would be more understandable than just slot and empty err key. How should I understand the response I got?

UPDATE:

Just got the following error:

Error: TransactionExpiredBlockheightExceededError: Signature mySingature--->qYmvyL9qqsJte2TKXLyu9DZUrjQs9cU9PFVsyvjGM9vd3UykkvbLfLhbRjQqhM4BhRFWM7eW has expired: block height exceeded.

When using the above method. So there is definitely something else that has to be done before I can declare a transaction final. Where can I read about it?

Digital
  • 175
  • 7