3

Is there a straightforward way to ascertain from the horizon txn post response if the seqno has been incremented?

For example, an underfunded operation will cause the seq number to increment, but a bad_auth won't. Both responses are similar. They have no results meta field, and a result code of tx_failed.

This other question talks about why it happens and in which circumstances, but I am interested in how to determine whether it happened, without having to enumerate those different circumstances.

Looking at github.com/stellar/go/issues/430#issuecomment-385813801 it seems the answer might be to check for the presence of /extras/result_codes/operations. (edit: no). A more explicit field would be good.

5
  • 1
    Possible duplicate of When is account sequence number incremented? Jan 23, 2019 at 8:59
  • 1
    Yes, I saw that other question, but I think it's different. That talks about why it happens and in which circumstances. This question asks about how to determine whether it happened, without having to enumerate those different circumstances. Looking at github.com/stellar/go/issues/430#issuecomment-385813801 it seems the answer might be to check for the presence of /extras/result_codes/operations. A more explicit field would be good.
    – Synesso
    Jan 23, 2019 at 11:31
  • 1
    agree with Bartek. At the response, you need to check "result_xdr". That is some base64 string like "AAAAAAAAAGT////2AAAAAA==", and the behaviour is deterministic such that some result_xdr always increases sequence number while some others always not.
    – cesarm
    Jan 24, 2019 at 5:45
  • 1
    p.s. Do NOT rely merely on the transaction response message, but go for the result_xdr. For example, with the same message "txBadSeq", there are TWO DIFFERENT CASES - see here stellar.stackexchange.com/questions/946/…
    – cesarm
    Jan 24, 2019 at 5:50
  • Thanks @cesarm - I've implemented sequenceIncremented in terms of feeCharged. github.com/Synesso/scala-stellar-sdk/blob/master/src/main/scala/…
    – Synesso
    Feb 3, 2019 at 2:21

1 Answer 1

1

It's currently not possible without enumerating through the list of reasons, and agreed that it might be valuable to file an issue that exposes this information from a Horizon response.

Your Answer

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

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