# SIZE_CONSTANTS

> `const` **SIZE\_CONSTANTS**: `object`

Defined in: [packages/synapse-core/src/utils/constants.ts:45](https://github.com/FilOzone/synapse-sdk/blob/2e357180d354970e2a091ff7ef0f3021c8357d4f/packages/synapse-core/src/utils/constants.ts#L45)

Data size constants

## Type Declaration

### BYTES\_PER\_LEAF

> `readonly` **BYTES\_PER\_LEAF**: `32n` = `32n`

Bytes per leaf in the PDP merkle tree.

Use `leafCountToRawSize()` on the aggregate data-set leaf count when
calculating the approximate byte size used by FWSS pricing.

### DEFAULT\_UPLOAD\_BATCH\_SIZE

> `readonly` **DEFAULT\_UPLOAD\_BATCH\_SIZE**: `32` = `32`

Default number of uploads to batch together in a single addPieces transaction
This balances gas efficiency with reasonable transaction sizes

### GiB

> `readonly` **GiB**: `bigint`

Bytes in 1 GiB

### KiB

> `readonly` **KiB**: `1024n` = `1024n`

Bytes in 1 KiB

### MAX\_ADD\_PIECES\_MESSAGE\_SIZE

> `readonly` **MAX\_ADD\_PIECES\_MESSAGE\_SIZE**: `number`

Payload budget (bytes) for one addPieces / createAndAdd Filecoin message.

Filecoin messages are capped at 64 KiB. 288 bytes are reserved for message
overhead (from, to, nonce, gas, method, …), leaving this much for encoded
params. Used by the default piece-batcher limiter.

### MAX\_LEGACY\_ADD\_PIECES\_BATCH\_SIZE

> `readonly` **MAX\_LEGACY\_ADD\_PIECES\_BATCH\_SIZE**: `80` = `80`

Maximum pieces per legacy data-set addition, enforced alongside the message-size limit.

### MAX\_UPLOAD\_SIZE

> `readonly` **MAX\_UPLOAD\_SIZE**: `68182605824` = `68_182_605_824`

Maximum upload size currently supported by PDP servers.

64 GiB padded piece adjusted for fr32 expansion: 64 GiB * (127/128) = 68,182,605,824 bytes (63.5 GiB)

Fr32 encoding adds 2 bits of padding per 254 bits of data, resulting in 128 bytes
of padded data for every 127 bytes of raw data. A 64 GiB raw payload therefore
exceeds this limit once padded.

Note: While it's technically possible to upload large pieces as Uint8Array,
streaming via ReadableStream is strongly recommended for non-trivial sizes.

### MiB

> `readonly` **MiB**: `bigint`

Bytes in 1 MiB

### MIN\_UPLOAD\_SIZE

> `readonly` **MIN\_UPLOAD\_SIZE**: `127` = `127`

Minimum upload size (128 bytes padded); matches what storage providers currently accept.

### PiB

> `readonly` **PiB**: `bigint`

Bytes in 1 PiB

### TiB

> `readonly` **TiB**: `bigint`

Bytes in 1 TiB