I am working on the development of a software wallet. I am using Horizon Post Transaction API to post signed transaction. Following an issue I ran into, I am trying to understand which responses are final and immutable and which are provisional.
Timeout - Provisional
According to this, timeout is not a final answer:
A stellar-core instance may drop your transaction after failing to include it in several ledgers (currently 3). However other distributed instances may still rebroadcast the tx. See e.g. stellar/stellar-core#1811.
When Horizon provides you with a timeout, it means that Horizon has not had timely confirmation that your tx has made it into a ledger. It does not guarantee that the tx will never make it.
Success - Final & Immutable
According to this, success is considered final & immutable:
Success is a consensus-level return so you don't need to look it up again. You can see this is so because the response includes the result XDR, and such XDR could only come from stellar-core after ledger application.
Transaction malformed?
Are transaction_malformed results final & immutable?
Transaction failed with transaction result_code == tx_failed
?
Are transaction_failed results with transaction result_code == tx_failed
like this one final & immutable?
I assume they are, as they include the result XDR like the aforementioned success result.
Transaction failed with transaction result_code != tx_failed
?
What about transaction_failed results with transaction result_code != tx_failed
?
Sample transaction results codes are:
tx_bad_auth
tx_no_source_account
tx_bad_seq
These are trickier since the HTTP response body includes a result XDR as you mentioned but the transaction failure will not appear on the chain like the previous case when transaction result_code == tx_failed
and fees are deducted. In general, such transactions may soon be valid, if account sequence changes for example.
Can I treat such results as final and immutable?