Could you please help me to understand how much space in a node does an empty block with no extrinsics/transactions take up?
2 Answers
The empty block with a maximum block size of 1MB is not going to be 1MB in most cases (unless you have custom runtime logic which is adding data, which I doubt is the case).
Therefore, the empty block is likely to be small in size, maybe something around a hundred or few hundred bytes.
We are running a testnet and this is the data it print below. Most of our blocks are empty at the moment so hopefully this helps.
You can find similar charts like this by going to the Apps UI and clicking on "Explorer" and then "Latency". One of the diagrams should show the blocksize of the last X many blocks.
-
Thank you, Drew! Is 196 number of bytes? Do you know how to get this number from a block using polkadot js api?– cocokickMay 5, 2022 at 13:07
-
Grab the block, encode it into a Uint8Array, and then print the length of that array. May 26, 2022 at 19:47
I have a chain which has 131330 blocks as of this writing, 99% empty, and takes up 3.3 G of space. That calculates to about 0.0251275413 MB per block.