Blocks are batches of transactions with a hash of the previous block in the chain.
1. HOW BLOCKS WORK
- Strictly ordered: every new block created contains a reference to its parent block) and transactions within blocks are strictly ordered too.
- Once a block is put together (mined), all nodes add this block to the end of their blockchain.
2. WHAT'S IN A BLOCK?
- timestamp – the time when the block was mined.
- blockNumber – the length of the blockchain in blocks.
- baseFeePerGas - the minimum fee per gas required for a transaction to be included in the block.
- difficulty – the effort required to mine the block.
- mixHash – a unique identifier for that block.
- parentHash – the unique identifier for the block that came before (this is how blocks are linked in a chain).
- transactions – the transactions included in the block.
- stateRoot – the entire state of the system: account balances, contract storage, contract code and account nonce are inside.
- nonce – a hash that, when combined with the mixHash, proves that the block has gone through proof-of-work.
3. BLOCK SIZE
- Target size of 15 million gas, increase or decrease in accordance with network demands, up until the block limit of 30 million gas (2x target block size). --> ensures that blocks can’t be arbitrarily large.
- Gas expended by all transactions in the block must be less than the block gas limit.
4. BLOCK TIME
- In Ethereum, mine a new block is between 12 to 14 seconds.
- Expected block time is set as a constant at the protocol level to protect the network's security (when the miners add more computational power.)
- Block header will increase/ decrease if average block time is smaller/ higher expected block time.
Nhận xét