bitcoin-dev

How was the average size of blk*.data chosen?

Original Postby Peter Todd

Posted on: May 30, 2024 18:20 UTC

When selecting a number for certain operations, it appears to be a common practice to choose a value somewhat arbitrarily within a broad and acceptable range.

The primary consideration for setting an upper limit on values is the compatibility with older file systems, which often do not support files larger than 4GB. This constraint is particularly relevant in scenarios where all block data is stored in a single file, such as with Monero, a cryptocurrency. Storing extensive data in one file can lead to complications when attempting to transfer this file between different locations or systems.

On the other end of the spectrum, the lower limit is influenced by the technical difficulties associated with managing a large number of files within a single directory. Systems can encounter significant performance issues when tasked with handling tens of thousands of files in one location. These considerations underline the importance of choosing a value that balances the need to avoid exceeding file system limitations while also preventing directory overcrowding.

For further information, insights from Peter Todd can be explored at https://petertodd.org.