## Why are blk*.dat files ~134200000 bytes?

6

2

I understand that blocks are stored on disk across multiple blk*.dat files, but why is the maximum file size roughly 134,200,000 bytes?

• What's the reason behind this file size?
• Where can I find this setting in the source code?
• What's the exact maximum size?

The constant is called MAX_BLOCKFILE_SIZE and is set in src/validation.h. It is currently set to 0x8000000 which is 128 MiB (134,217,728 bytes).
You can see where it is checked in FindBlockPos() in src/validation.cpp.