Polygon Block Performance

    db_img

    Polygon Block Performance

    Questions :

    What is the average time between blocks on Polygon?

    \n

    What was the maximum and minimum recorded time between two blocks? How many transactions are done in a block on average? How do these numbers compare to L1 such as Flow or Solana, or other L2 such as Arbitrum or Optimism?

    Methods :

    • finding number of blocks in Specific time period for finding average time between two blocks .

      we also did this in an other way

      we can use both

      polygon.core.fact_blocks and

      polygon.core.fact_transactions tables

      \

    • compare each block time with the next one using polygon.core.fact_blocks table to find ==max== and ==min== block time

      \

    • comparing with other blockchains

    we found max , min and avg of block time for each blockchain for blocks in a row , by using BLOCK_NUMBER and also

    BLOCK_TIMESTAMP of each chain

    WITH A AS ( SELECT DISTINCT(BLOCK_NUMBER) AS Y, ROW_NUMBER() OVER (ORDER BY BLOCK_NUMBER) AS RowNumber , BLOCK_TIMESTAMP AS O FROM polygon.core.fact_blocks WHERE BLOCK_TIMESTAMP > '2022-06-06 15:14:51.000' ORDER BY 2 ), B AS ( SELECT DISTINCT(BLOCK_NUMBER) AS YY, ROW_NUMBER() OVER (ORDER BY BLOCK_NUMBER) AS RowNumber1 , BLOCK_TIMESTAMP AS OO FROM polygon.core.fact_blocks

    ORDER BY 2 ), date_diff_ as ( Select cast(DATEDIFF(SECOND,OO, O) as float) AS DATE_DIFF FROM A JOIN B ON B.RowNumber1=A.RowNumber WHERE Y=YY+1 ORDER BY 1 desc ) select max(DATE_DIFF) , min(DATE_DIFF) , avg(DATE_DIFF) from date_diff_

    note : '2022-06-06 15:14:51.000' is the BLOCK_TIMESTAMP of 1st block of polygon in flipside data base .

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

    here is the result :

    we counted number of distinct tx_id for each block number then calculated the average of transactions in each block

    here is the code :

    with polygon_number_of_tx_id_per_block as ( select count( TX_ID) as A ,BLOCK_ID from flipside_prod_db.polygon.transactions group by 2 order by 1 asc ) select avg (A) as average_transaction_each_block from polygon_number_of_tx_id_per_block

    other chains

    Loading...
    Loading...

    an other point of view :

    when we take a look more closely to transactions , block numbers and block times we can see some distinct BLOCK_NUMBERs with the same BLOCK TIME . when we go more close we can see that each of that blocks have unique transaction hashes in them , so we can,t ignore them.

    ==that’s because some chains minimum block times is zero==

    conclusion :

    if we don’t ignore distinct transactions with same block time , when we compare average time for each block , that’s clear that others are faster than polygon .

    if not , the game changes and we have these numbers for each blockchain :

                              min block time                average block time 
    

    sloana 1 1.118

    flow 1 1.433

    optimism 15 15.984

    arbitrum 1 48.766

    when we look at maximum time between two blocks , we see ( 8666 second ) for solana

    in my opinion it’s because of the time that solanas blockchain were down.

    and about each block number of transactions , we have solana in first place after that we have polygon that is hopeful .

    contact info :

    Discord : MOHAMAD23#9722

    Appendix :

    Data provided here are from app.flipsidecrypto.com .