Polygon Block Performance

    Deep dive into Polygon's block time and tx_count statistics investigating correlations with gas usage, block size and difficulty. Also compares the stats with 5 other chains.

    Methodology

    I used the Polygon Fact_Blocks table to join block hashes to their parent_hash and calculate the time difference between the blocks in seconds with the datediff function. This approach would have worked with multiple chains, but the DB only contains data on the mainnet. It also avoids considering data in uncle blocks that ultimately were not considered part of the chain. The distributions we get for the block times will naturally be distorted as the data is recorded with second precision in the DB and most transactions are in the 1.51-2.49 sec range.

    Loading...
    Loading...

    The minimum detected difference between blocks is 2 seconds and this is the achieved block time for the vast majority (~88%) of the blocks. This explains why the median and the average of the block times for Polygon is 2 and 2.24.

    The distribution of the block times is interesting: Blocks with an even timing occur with exponentially decaying probability (values decrease by aprx. 1/10 every 2 seconds), but 6 second block times are overrepresented by aprx. 25k blocks. Blocks with odd timings are very rare, 3 sec blocks are 1/500 less likely than 4 second blocks, while 9 second blocks are 1/40 less likely than 10 sec blocks.

    Block times are independent of the block difficulty: all block timings have an average difficulty close to 22.

    Looking at the blocks from the tx counts perspective is even more interesting:

    Even though the peak of the block tx_count distribution is in the 40-60 tx range the median is 58 and the overall average is 74.8 txs, showing the long and heavy tail of the distribution towards the larger tx counts.

    The average block time is the lowest (2.07 sec) for blocks with 30-70 txs and forms a broad peak for blocks between 70-400 txs, and is highest (2.89 sec) for blocks with 100-150 txs.

    The average block size increases with the block tx count in a sub-linear fashion up to 600-900 tx/block, however most surprisingly, the average block size drops by 35% for blocks with more than 900 tx/block.

    The average gas use - as could be expected - increases monotonously with the block tx count, however it flattens out 150/200 tx/block.

    One explanation to these findings might be that miners some (maybe 100-150) high gas fee and high complexity txs in their blocks - if available - and fill out the block with the rest. Such behaviour might explain the peak in block times around the 100-150 tx/block.

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

    Times series data shows, that both the hourly averages of block times and tx counts increased since July 12, whereas a month before an even higher increase in tx counts did not coincide with increased block times.

    Scatter-plotting the two metrics show a layered pyramid-like structure, showing that, 1. block times indeed usually increase by discrete intervals 2. Larger block times are only possible with an increasingly narrow band of tx counts.

    Plotting hourly average block tx counts VS gas used in the blocks, corroborates that Gas usage plateaus at high tx counts and clarifies the inflection point to be near 76-78 txs/block.

    The average block size follows a rather strictly linear patterns with average block size, however larger average blocks fall somewhat below the linear trend.

    Loading...
    Loading...

    Finally, comparing block stats, to other blockchains we find that:

    • The 2.24 second average block time value of Polygon is relatively high for a POS blockchain, only the Binance Smart Chain (BSC) is slower. The other compared rollup (Optimism) is much faster 0.86 sec/block on average
    • The median reflects the same order between the chains speed
    • No-one can touch Solana’s proof of history on the number of transactions/block - and probably shouldn’t considering the amount of failed transactions…
    • Polygon ranks relatively low on the number of transactions per block, 3rd after Flow. The 74 tx/block value is below BSC-s 104 and might indicate that Polygon is starting to approach congested levels of traffic (but is not there yet)
    Loading...
    Loading...

    Key Findings:

    • Polygon produces blocks with a 2 second block time in the vast majority of the time (88%)
    • Most common blocks contain 40-60 transactions (median 58), but the tx-block distribution has a long tail, the average is 78 tx/block
    • block times are independent of the difficulty
    • Large block times only occur with block tx_counts in the 70-150 range
    • Block Gas usage sturates with increasing tx counts with the inflection point being near 76-78
    • Block size increases up-to 90 tx/block, but further increases are sub-linear
    • compared to other layer 2-s and some other POS layer 1-s, Polygon’s block time is relatively slow and its tx_count/ block puts it in the middle of the pack
    db_img