BlockLength

Constant v101 → current BlockLength

Limits block size for network propagation and storage .

Current Value

0x000078000000a0000000a000
Relevant for: validatorsdevelopers

The Big Picture

Blocks have a maximum size in bytes. This ensures blocks propagate quickly through the network and don't consume excessive storage. Large transactions may need multiple blocks.

Why This Matters

If your transaction data is large (big remark, large batch), it counts against this limit. Very large data may need to be split across multiple transactions.

Example

BlockLength might be 5MB for normal transactions. If you try to submit 6MB of remarks, it won't fit in a single block.

Common Questions

What happens if a block is too big?
It's rejected during validation. Transactions are trimmed to fit.

From Chain Metadata

The maximum length of a block (in bytes).

Use Cases

  • Block building
  • Transaction packing
  • DoS prevention

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query BlockLength constant
const value = api.consts[stringCamelCase("System")][stringCamelCase("BlockLength")];
console.log("BlockLength:", value.toHuman());

Type Information

Byte Size
variable bytes
Encoding
composite
Raw Hex
0x000078000000a00000...

Runtime Info

Pallet
System
First Version
v101
Latest Version
v101
Current Runtime
v393