Polygon - Block Performance
Description of Work
In this bounty, we want to check the Block Performance in Polygon and compare it with other layer 1 and 2 blockchains. To do this, we examine the following:
- Average time between blocks on Polygon and compare it with other layer 1 and 2 blockchains.
- Maximum and Minimum time recorded between two blocks on Polygon and compare it with other layer 1 and 2 blockchains
- Average Transactions Per Block (TPB) on Polygon and compare it with other layer 1 and 2 blockchains
- Average Bock Per Hour (BPH) on Polygon and compare it with other layer 1 and 2 blockchains
Note
- The blockchains we want to compare with Polygon include:
- Layer 1: Ethereum, Solana, Flow, Osmosis and Avalanche
- Layer 2: Optimism and Arbitrum
- We use the:
- polygon.core schema and fact_blocks for Polygon
- ethereum.core schema and fact_blocks for Ethereum
- solana.core schema and fact_blocks for Solana
- flow.core schema and fact_blocks for Flow
- osmosis .core schema and fact_blocks for Osmosis
- avalanche.core schema and fact_blocks for Avalanche
- optimism.core schema and fact_blocks for Optimism
- arbitrum.core schema and fact_blocks for Arbitrum
Method
- Average time between blocks:
- To do this, for better comparison of Polygon with other blockchains, we select the last 1M (1,000,000) blocks for each blockchain for comparison. Now, how do we get the time difference between two consecutive blocks? first, we divide the blocks into two sets, odd and even, based on the block number, and obtain the set of odd and even blocks in the last 1M block.
- Odd Block Set:
mod(block_number::int, 2) = 1
- Even Block Set:
mod(block_number::int, 2) = 0
- Odd Block Set:
- After obtaining the set of odd and even blocks, we join them together based on:
(even.block_number::int) = ((odd.block_number::int) + 1) and time_odd <= time_even
- Then we get the difference in creation time between two consecutive blocks based on seconds:
datediff('second', time_odd, time_even) as block_time_difference
- Finally, we calculate the average of all the time differences between the two blocks obtained for each blockchain:
round(avg(block_time_difference), 3) as avg_block_time_difference
- To do this, for better comparison of Polygon with other blockchains, we select the last 1M (1,000,000) blocks for each blockchain for comparison. Now, how do we get the time difference between two consecutive blocks? first, we divide the blocks into two sets, odd and even, based on the block number, and obtain the set of odd and even blocks in the last 1M block.
- Maximum and Minimum time recorded between two blocks
- For this, we obtain the time difference between the two consecutive blocks as explained in section 1, and obtain Minimum and Maximum from them.
- Average Transactions Per Block (TPB)
- To do this, we calculate the average tx_count (
avg(tx_count)
) for each block in each blockchain overall and hourly over time (from 2022-06-06 onwards).
- To do this, we calculate the average tx_count (
- Average Bock Per Hour (BPH)
- To do this we get the average number of blocks created per hour overall and over time (from 2022-06-06 onwards) by hour.
Conclusion of Part 1
-
The highest Average time (Second) between blocks in the last 1M block by far belongs to Ethereum with 13.64 seconds
\
-
After Ethereum, the highest Average time (Second) between blocks in the last 1M block is related to:
- Osmosis (6.85 seconds)
- Polygon (2.31 seconds)
- Avalanche (2.0 seconds)
- Flow (1.41 seconds)
- Arbitrum (1.08 seconds)
- Optimism(0.991 seconds)
- Solana(0.69 seconds)
Conclusion of Part 2
-
In terms of the maximum time (Second) recorded between two blocks in the last 1M block, the highest recorded time belongs to Osmosis with 393,194 seconds. This value is equal to 4.5 days. This very long time can be related to the network unavailability for 4.5 days and restarting it.
-
After Osmosis, the maximum time (Second) recorded between two blocks in the last 1M block is related to
- Arbitrum (204 seconds)
- Ethereum (172 seconds)
- Flow (90 seconds)
- Optimism (46 seconds)
- Polygon (25 seconds)
- Avalanche (11 seconds)
- Solana (10 seconds)
-
But the results are different in term of minimum time (Second) recorded between two blocks in the last 1M block. Except for Ethereum(1 second), Osmosis (1 second), and Polygon (2 seconds), this value is 0 for other blockchains examined. The value of 0 means that these blockchains can produce two different blocks at the same time.
Conclusion of Part 3
-
In terms of Average Transactions Per Block, Solana has a great performance by a large margin (1747 transactions).
\
-
After Solana, the highest average Transactions Per Block is related to
- Ethereum (142 transactions)
- Polygon (75 transactions
- Osmosis (15 transactions)
- Flow (13 transactions)
- Avalanche (5 transactions)
- Arbitrum (1 transaction)
- Optimism(1 transaction)
-
In the TPB (Hourly) charts
- In Flow, TPB has dropped sharply in some hours, which can be related to network problems.
- In the Optimism network, TPB is always equal to 1.
- There is no data available for Osmosis from 8 to 12 June.
Conclusion of Part 4
-
In terms of Average Block Per Hour, Solana still performs brilliantly. (4776 blocks)
-
After Solana, the highest Average Block Per Hour is related to
-
Optimism (3957 blocks)
-
Arbitrum (3559 blocks)
-
Flow (2398 blocks)
-
Avalanche (1794 blocks)
-
Polygon (1601 blocks)
-
Osmosis (575 blocks)
-
Ethereum (252 blocks)
\
-
-
In the Average BPH charts over time charts
- In Flow, as in the previous section, at some times the BPH criterion also suffers a sharp drop, and these signs increase the probability of problems in the network during these hours. In Ethereum, BPH has increased since July 2022.
🏁 Final Conclusion 🏁
In this work, we have compared 8 different networks from different aspects:
-
In terms of the Average time (Second) between blocks in the last 1M block, the highest values are related to Ethereum (13.64 seconds), Osmosis (6.85 seconds), Polygon (2.31 seconds), Avalanche (2.0 seconds), Flow (1.41 seconds), Arbitrum (1.08 seconds), Optimism(0.991 seconds) and Solana(0.69 seconds), respectively.
\
-
In terms of the maximum time (Second) recorded between two blocks in the last 1M block, the highest values are related to Osmosis (393,194 seconds), Arbitrum (204 seconds), Ethereum (172 seconds), Flow (90 seconds), Optimism (46 seconds), Polygon (25 seconds), Avalanche (11 seconds), Solana (10 seconds), respectively.
-
Osmosis maximum time (Second) recorded between two blocks in the last 1M block is unusual. This very long time can be related to the network unavailability for 4.5 days and restarting it
\
-
-
In terms of minimum time (Second) recorded between two blocks in the last 1M block. Except for Ethereum(1 second), Osmosis (1 second), and Polygon (2 seconds), this value is 0 for other blockchains examined. The value of 0 means that these blockchains can produce two different blocks at the same time.
\
-
In terms of the Average Transactions Per Block, the highest values are related to Solana (1747 transactions), Ethereum (142 transactions), Polygon (75 transactions), Osmosis (15 transactions), Flow (13 transactions), Avalanche (5 transactions), Arbitrum (1 transaction), Optimism(1 transaction)
\
-
In terms of the Average Block Per Hour, the highest values are related to Solana (4776 blocks), Optimism (3957 blocks), Arbitrum (3559 blocks), Flow (2398 blocks), Avalanche (1794 blocks), Polygon (1601 blocks), Osmosis (575 blocks), Ethereum (252 blocks)
\