0

I have a solana program that has the following two instructions.

  1. an instruction that writes a record to the PDA
  2. an instruction that fails if this record exists and succeeds if it does not.

If 2 -> 1 is executed quickly with little time interval, the "confirmed" commitment will succeed, but the "finalized" commitment will fail with a non-negligible probability.

What causes the result of "confirmed" to change from "finalized" to something else? Is it possible to prevent this?

1 Answer 1

3

Finalized is the last status of a transaction. I'm not sure what you mean by "finalized" to something else? If you're asking how the status is determined then finalized is confirmed with 31+ block atop of its submission block.

You can deterministically execute instructions in order by putting them in the same transaction.

1
  • If I send tx and immediately do confirmTransaction with the commitment: "confirmed" option, it succeeds, but if I wait for the "finalized" phase and confirm tx again, it finally fails sometimes. I would like to know if it is possible to solve a situation where the structure of the service does not allow sending two instructions to one tx.
    – gtolarc
    Commented Jul 21, 2023 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.