Episode 44 - Block Gas Limit, Block Period, and Blockchain Scalability
When we talk about blockchain scalability — which has been the theme for some of the current episodes — we must understand how the block gas limit plays an important role in the scalability discussion.
In general, for any public smart contracts blockchain, it is important to measure and charge for the resource usage while executing smart contract logic. For this, we have gas. The concept of gas makes sure the user pays for the logic they want to execute on the chain. This discourages several kinds of attacks on the blockchain.
Now let’s understand what block gas limit is. A blockchain block is basically a collection of transactions along with some metadata. A transaction is a packet of data that represents a message from a user to a blockchain. So, in totality, a block is just a bigger packet of data. Another thing is blockchains are peer to peer networks. Which means nodes propagate blocks to their peers during the consensus process. There is also a concept of block time which is the period between the production of two blocks.
When we want to propagate a packet of data (a block) across several nodes of a network (blockchain) within a time limit (block period), we need to make sure the size of the data packet is not too large. This allows the block to propagate to maximum number of nodes so that it could be verified in a fully decentralized manner. Hence we need to put a limit on the size of the block.
How do we limit the size of the block? By limiting the number of transactions in it. And how do we measure the size and complexity of transactions? Gas. Hence, the block gas limit is the maximum amount of gas which could be used by transactions in that block.
If we increase the block gas limit, we will have to increase the block period as well. And if we increase the block period, we will have to wait longer for the transactions to be executed by the blockchains. This is how the block gas limit and block period impacts the blockchain scalability.