[Terra] Transaction Failures

    • A post/author on twitter shared their finding which claims Terra's failed transactions have been on the rise lately.
    • Image Attached:
    Loading...
    Loading...
    Loading...
    Loading...
    db_img

    Bounty Brief:

    • The following analysis will verify the claims made/data presented and also investigate further into the causes and their possible solutions/mitigations.
    • The analysis checks out.
    • So let's dig further into what could be the causes for these failures.

    Why are the transactions failing?

    Fig. 1

    • We analyze the tx_status_msg field for clues on what caused the transaction failure.
    • Since there can be a variety of unique errors, we are focusing on the top/highest 5 contributors to failures per day. This keeps the noise out of the chart.

    Fig. 2

    • Same as Fig. 1, just normalized to reflect daily contribution by error type.
    Observations:
    • It is clearly evident the leading cause of failures is the error type: execute wasm contract failed
    • Followed by insufficient funds and out of gas

    Fig. 3

    • Does market volatility/LUNA prices have any correlation with increased transaction failures?
    Observations:
    • It does seem there's a correlation!
    • Market Volatility is usually a time when the underlying chain is stress-tested, as users rush to manage their on-chain positions and activities.
    • The crests and valleys in failure rate often coincide with the same in LUNA price-action 🤔

    Remedying/Reducing Failures:

    Now that we know the most common failure reasons, let's go over some possible ways to reduce/curb them.

    • execute wasm contract failed

      • As the name suggests these are caused due to interaction failures with smart contracts.
      • This could either be in the form of wrong input parameters/invalid requests or parameters that became outdated.
      • These would ideally not be impacting an average user. The impact would likely be noticeable to bot users/builders and other automators/tinkerers.
      • Perhaps worth investing further down this reason and narrowing it into various sub-error categories!
    • Insufficient Funds / Out of Gas

      • These errors ought to be handled (to some extent) by the wallet UI/App UIs.
      • Most apps/wallets do not initiate a transaction if for some reason the balance entered for the action is insufficient/gas can't be payed.
      • This seems to be a case where it's again the scriptors/arbitragers running their bots with certain aspects left unchecked?
    • It would make sense for TerraLabs to look into whether these failures are being experienced by average/normal users or developers and traders/automators running custom scripts and spamming incorrect code logic that leads to failures. If it's the latter, maybe better guidelines and documents/workshops would help alleviate and avoid some of the most common failures.