#18.When Do Flow Transactions Fail?

    Q7. Building off last week's question investigating when transactions fail on Flow, what addresses and contracts are causing the majority of failures? What types of activities and events are these addresses doing that are spamming the network? What types of arbitrage opportunities are they seeking and how profitable are these efforts? Compare these transaction failures to the botting issue that Solana has bene facing causing outages. How do they compare and how could Flow attempt to mitigate these issues?

    Analysis Methodology

    In this dashboard, we are looking to investigate the root cause of errors and failed transactions in the FLOW blockchain.

    First, based on the data in the flow.core.fact_transactions table, we examine the error rates on a daily basis over the past two months.

    In the next step, using flow.core.fact_transactions, we group the errors based on their code and analyze these groups over time.

    Then we find the smart contracts that produced the most errors, as well as the wallets from which these errors originated.

    In the last step, we are looking for a pattern in the behavior of these wallets (with the focus on the wallet that has produced the most errors).

    Let's look at the daily error rates over the past two months.

    Loading...
    Loading...
    db_img
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Key Findings

    1. The error rate from May 25 to May 31 shows a strange increase. On May 28, more than 80 percent of the transactions sent to the FLOW blockchain failed.
    2. Apart from the above interval, the average occurrence of daily FLOW blockchain errors is less than 10%, which is an acceptable number.

    Let's see what error has caused this large increase in errors.

    1. Error code 1101 has been viewed about 4 million times, which alone accounts for more than 90% of errors that occur.

    2. This error code(1101) has also had the highest number of failed transactions over the past two months.

    Next, we filter the errors that contains the code 1101 and check what errors this code consists of.

    Underflow Error

    >Underflow is a condition or exception that results if a number calculation is too small to be represented by the CPU or memory. It may be caused by a limitation of the computer's hardware, its architecture, or the data type of the numbers used in the calculation.

    for instance,if you subtract 1 from a uint8 that is 0, it will produce Underflow error.

    So when we send a transaction to the server that negates the balance of a wallet that must be a positive number or zero, we will have an Underflow error. For example, suppose we want to swap or move all the balance of an account and we have not calculated the transfer fee, and by performing the transaction, the balance of the source account will be negative and therefore the Underflow error occurs.

    Let's see which smart contracts have produced these errors, and whether this contract is consistent with the assumption given in the example above. (Swap or transfer assets while account balance is not sufficient for this purpose)

    1. The only smart contract that generated the code 1101 was the withdrawal and deposit and deducting transaction fee, and as can be seen from the table above, all the transactions that generated this error consisted of three components: withdrawal, deposit and calculation of fee. In most cases, the withdrawal amount + transfer fee was more than the account balance.

    In the next step, let's see which wallet or address produced the most errors.

    1. A user with the address 0a386460e7fe7e27 alone has generated about 2 million errors, and the next five users have generated the same total errors.
    2. The pattern of user errors 0a386460e7fe7e27 is exactly the same as the pattern of errors in the FLOW blockchain in the last two months, and it seems that these errors are mostly generated by the same user.
    3. The average number of transactions sent by user 0a386460e7fe7e27 daily in the third decade of May was about three hundred thousand, which indicates that a bot is behind this account.
    4. The other ten users who generated the most errors are also bots.

    Takeaways

    • The high rate of daily blockchain errors was mostly due to user-generated errors, and blockchain itself played no role. This issue must be clearly announced in the media.
    • Nearly 100% error percentage rate for an address indicates that the bot has a logical error and its programmers did not have the necessary skills to develop a professional program that caused high traffic for the blockchain and a high error rate.

    What Can Flow Do ?

    It is better to make changes in the FLOW blockchain that if the transaction error rate of an address exceeds ten percent (for example) within a certain period of time, this address is temporarily blocked and if this is repeated, it is permanently blocked.