yangli-io
yangli-io

Reputation: 17354

Solana - Commitment vs preflightCommitment

I'm curious what the difference between preflightCommitment and commitment is.

Also, what are the different types of commitments listed below.

export type Commitment =
    | 'processed'
    | 'confirmed'
    | 'finalized'
    | 'recent'
    | 'single'
    | 'singleGossip'
    | 'root'
    | 'max';

Upvotes: 12

Views: 6183

Answers (1)

Jon C
Jon C

Reputation: 8472

preflightCommitment is the commitment used for the preflight transaction, AKA the transaction simulation, whereas commitment is used for the actual transaction.

As for the different commitments, they're all listed at https://docs.solana.com/developing/clients/jsonrpc-api#configuring-state-commitment

Some of those terms are old, but here's roughly how they would translate:

  • processed = recent
  • confirmed = singleGossip = single
  • finalized = root = max

Upvotes: 18

Related Questions