Polygon Block Performance

    The average time between blocks on Polygon Maximum and minimum recorded time between two blocks Average number of transactions in a block

    db_img

    1. What Is a Block (Blockchain Block)?

    Blocks are data structures within the blockchain database, where transaction data in a cryptocurrency blockchain are permanently recorded. A block records some or all of the most recent transactions not yet validated by the network. Once the data are validated, the block is closed. Then, a new block is created for new transactions to be entered into and validated. A block is thus a permanent store of records that, once written, cannot be altered or removed.

    2. Statement of Problem

    In this bounty, a comprehensive study is conducted to investigate the performance of blocks Polygon network. To this end, the following procedure is employed to evaluate and analyze data from Flipside tables:

    a. BLOCK_NUMBER, BLOCK_TIMESTAMP and TX_COUNT were extracted.

    b. The extracted data was sorted ascending according to BLOCK_NUMBER.

    c. The difference between each BLOCK_TIMESTAMP and its following was calculated as the duration of each block.

    d. Using the data evaluated in previous step, the maximum, minimum, and average duration of blocks have been evaluated.

    Two types of arithmetic and weighted average are calculated for block duration. For arithmetic average the duration of all blocks have been summed and divided by their number. On the other hand, number of blocks for each duration were employed as the weights to calculate the average.

    e. TX_COUNT was employed as the number of transactions sent in each block. This field was used to calculate the average number of transactions in each block.

    The same procedure was followed to extract, analyze and compare data for Arbitrum, Optimism (as L2 networks like Polygon) and Solana and Flow (as L1 networks). The following tables have been used to extract the required data:

    • For Polygon: polygon.core.fact_blocks

      \

    • For Arbitrum: polygon.core.fact_blocks

      \

    • For Optimism: optimism.core.fact_blocks

      \

    • For Solana: solana.core.fact_blocks

      \

    • For Flow: flow.core.fact_blocks

      \

    NOTE1:

    Due to large differences between block durations on different networks selected for this study, author was not able to plot the results of different networks on same figure for comparison. If the results of different networks be plotted in same figure, the output is something meaningless and very hard to understand.

    NOTE2:

    For Arbitrum, Optimism, Solana and Flow networks some Blocks with ZERO duration are recorded on Flipside tables. There might be something wrong on Flipside tables and these blocks are not omitted from output results.

    NOTE3:

    For Solana network, a block of negative duration was identified. This was excluded from data for further processing.

    NOTE4:

    For Optimism network, only 1 transaction is recorded for each block. This means that the TX_COUNT field in “optimism.core.fact_blocks” table is not filled with right data.

    NOTE5:

    Given the range of outputs and their concentration on a narrow band of duration or large difference between number of blocks or their number of transactions, either of horizontal and vertical axes or both of them might be set in logarithmic scale. Pay attention to this matter for better evaluation of results.

    NOTE6:

    To provide a better basis for comparison, in next section, firstly the figures for each output of all networks are shown and then the assessment of results is given.

    NOTE7:

    All data and their assessment are provided at the time of writing this article. Since, new blocks will be mined over time, the results may slightly differ.

    3. Results

    3.1. Number of Blocks

    After calculating the duration of each block, they were grouped and counted according to duration. Figures 1 through 5 show the number of blocks for each duration for selected networks.

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Polygon:

    Most number of blocks have a duration of 2 seconds (nearly 1.7 million blocks). As block duration increases, the number of blocks decrease in average. Blocks with even duration (2, 4, 6, …) usually have higher number of blocks with respect to next block of odd duration (3, 5, 7, …).

     

    Arbitrum:

    There are some blocks with very long duration. For durations greater than 200 seconds, only one block is recorded. Till 13 seconds duration, the number of blocks is nearly constant around 400. Then, it increases to about 900 till 40 seconds duration and after that the trend became decreasing.

     

    Optimism:

    Most number of blocks are recorded for ZERO duration. A regular decreasing trend can be seen in number of blocks against block duration where vertical axis is set logarithmic. No block of 0 second < duration < 15 seconds is recorded for this network.

     

    Solana:

    Nearly 15 million blocks are recorded for 1 second duration. An almost linear decreasing trend exists in number of blocks against block duration till 20 seconds where both vertical and horizontal axes are set logarithmic. Blocks of very long duration are recorded for this network.

     

    Flow:

    Most number of blocks are recorded for 1 second duration. The decrease in number blocks against block duration looks like stepwise. There also are some blocks of very long duration for this network.

     

    3.2. Number of Transactions

    The blocks were grouped and then for each group, the number of transactions have been summed up. Final results are depicted in figures 6 through 10.

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Polygon:

    Nearly 120 million transactions have been sent on blocks with 2 seconds duration. As block duration increases, the number of transactions decreases. Most transactions are done where block duration is even in comparison to odd block durations.

     

    Arbitrum:

    There are some fluctuations in number of transactions which can be ignored where vertical axis is logarithmic. For durations longer than 50 seconds, the trend became decreasing. For very long durations, the variation of number of transactions is negligible.

     

    Optimism:

    The most important observation for number of transactions against block duration for Optimism network is its regular decreasing trend.

     

    Solana:

    Also in this case, a linear decreasing pattern in number of transactions against block duration can be identified for durations less than 50 seconds.

     

    Flow:

    The stepwise decrease in number transaction also exists like number of blocks.

     

    For all networks, the trend of variations of number of transactions against block duration is similar to number of blocks in previous section. This gives the idea that a strong relation may be established between number of transactions and number of blocks for each duration. This issue will be examined in section 3.4.

     

    3.3 Average Number of Transactions

    Same as number of transactions, average number of transactions for each block group have been calculated and plotted in figures 11 to 15.

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Polygon:

    No strong relation can be found between block duration and average number of transactions. On may claim that as the duration of blocks increases, the average number of transactions also increases.

     

    Arbitrum:

    For this network, a decreasing pattern for average number of transactions against block duration can be identified till 140 seconds. After that, due to dispersion of data, the results are not reliable.

     

    Optimism:

    Since only one transaction is recorded for each block, no assessment can be made for average number of transactions for Optimism network. the TX_COUNT field for this network must be revised.

     

    Solana:

    In this case, a decreasing trend can be seen for short block durations. Number of records for long block duration is low and this makes no reliable analysis can be done for them.

     

    Flow:

    For block duration shorter than 15 seconds, the trend for average number of transactions is increasing.

     

    The results for this part of study indicated that this parameter is not reliable for consideration. For example, in Polygon network, the average number of transactions for 2 seconds block duration is almost 71. While, for 20 seconds duration is 419. This might mislead the data analysts that the greatest number of transactions happen for 20 seconds block duration.

    It should be noted that the sum of transactions for each block duration is divided by number of blocks for that duration. The total number of transactions for 2 seconds block duration is the largest. But, since the number of blocks for this duration is the largest, the average number of transactions becomes low.

     

    3.4. Relation Between Number of Blocks and Number of Transactions

    The comparison between results in section 3.1 and section 3.2 gave the idea that a strong relation might exist between number of blocks and number of transactions. For this reason, for each block duration, number of blocks and number transactions were plotted.

    For all 5 networks, both horizontal and vertical axes are in logarithmic scale for better presentation of the results. The results revealed that strong linear relation exists between number of blocks and number transactions. As the number of blocks for a given block duration increases, the number of transactions would also increase in response. It is found out that the linear relation is stronger for higher number of blocks. The results for this section are shown in figures 16 through 20.

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    3.5. Statistical Study of Blocks Duration

    In this section, the minimum, maximum, arithmetic average and weighted average duration of blocks are given in figures 21 through 24 respectively. For minimum block duration, the ZERO durations are excluded from data.

    As shown in figure 21, Arbitrum, Flow and Solana network have the shortest minimum duration. The Polygon with a minimum of 2 seconds is and after that Optimism has the longest minimum duration with 15 seconds.

    Loading...
    Loading...
    Loading...
    Loading...

    The maximum block duration for all networks is demonstrated in figure 22. Optimism and Polygon have a maximum of 73 and 86 seconds. For other networks, the maximum duration is very long. For example, Arbitrum has a maximum block duration of 37511 seconds (10 hours and 25 minutes). If such long durations for a block is recorded correctly, it’s a good idea to investigate what is the reason for mining such blocks.

    Figure 23 displays the arithmetic average duration of blocks. It is found that average block duration on Polygon network is about 15 seconds.

    Since the number of blocks mined for each duration may vary greatly, author believes it is more reasonable to use weighted average to compute the average block duration, where weights are number of blocks recorded for each duration. Figure 24 shows the weighted average block duration for all networks. As expected, the results are totally different from those of figure 23 (where arithmetic average is employed).

    For Polygon, the weighted average duration is 2.24 seconds. Since the greatest number of blocks for Polygon have 2 seconds duration, an average near to 2 seconds is expected.

    Weighted average duration for Arbitrum is 58.69 seconds while its arithmetic average was 1846.76 seconds.

    The results of this section confirm that weighted average is the best option to evaluate the average block duration, where weights are number of blocks for each duration.

     

    4. Conclusion

    In this bounty, a comprehensive study was conducted to assess the performance of blocks on Polygon network. Also, four more networks included in this work for comparison. The following results can be drawn from this study:

    ·       For all networks, most of the blocks are mined for lower block durations.

    ·       As block duration increases, the number of blocks for that duration decrease.

    ·       Since most of blocks are in short duration band, consequently, the greatest number of transactions belongs to these groups of blocks.

    ·       Average number of transactions is not a reliable metric to assess the block performance.

    ·       Strong linear relation exists between number of blocks and number of transactions.

    ·       Weighted average must be employed to compute the average block duration, where weights are number of blocks.

    ·       Polygon has the shortest weighted average block duration with respect to two other L2 networks. The difference is significant.

    ·       The difference between weighted average block duration on Polygon network and two L1 networks included in this study is negligible.

    ·       In comparison to Arbitrum, the number of distinct block duration on Polygon network is very low.

    ·       L1 networks have relatively very large numbers of distinct block duration with respect to Polygon.

    ·       Total number of transactions on Polygon is greater than Arbitrum and Flow (Optimism is not considered sinc number of transactions are not correctly recorded for this network).

    ·       Total number of transactions on Polygon is significantly lower that Solana. This is due to limited number of available data for Polygon with respect to Solana on Flipside tables.