SIZE_CONSTANTS
constSIZE_CONSTANTS:object
Defined in: packages/synapse-core/src/utils/constants.ts:45
Data size constants
Type Declaration
Section titled “Type Declaration”BYTES_PER_LEAF
Section titled “BYTES_PER_LEAF”
readonlyBYTES_PER_LEAF:32n=32n
Bytes per leaf in the PDP merkle tree.
The FWSS contract converts leaf counts to bytes via totalBytes = leafCount * BYTES_PER_LEAF.
DEFAULT_UPLOAD_BATCH_SIZE
Section titled “DEFAULT_UPLOAD_BATCH_SIZE”
readonlyDEFAULT_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
readonlyGiB:bigint
Bytes in 1 GiB
readonlyKiB:1024n=1024n
Bytes in 1 KiB
MAX_ADD_PIECES_BATCH_SIZE
Section titled “MAX_ADD_PIECES_BATCH_SIZE”
readonlyMAX_ADD_PIECES_BATCH_SIZE:40=40
Heuristic pieces-per-addPieces used only for upload-fee previews.
Action validation uses MAX_ADD_PIECES_MESSAGE_SIZE via addPiecesFits,
not this count.
MAX_ADD_PIECES_MESSAGE_SIZE
Section titled “MAX_ADD_PIECES_MESSAGE_SIZE”
readonlyMAX_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_DELETE_PIECES_BATCH_SIZE
Section titled “MAX_DELETE_PIECES_BATCH_SIZE”
readonlyMAX_DELETE_PIECES_BATCH_SIZE:35=35
Maximum pieces per schedulePieceDeletions call accepted by the Curio PDP API.
Curio also rejects requests (429) when the data set already has 200 or more removals queued on-chain; the queue only drains at the next proving period.
MAX_UPLOAD_SIZE
Section titled “MAX_UPLOAD_SIZE”
readonlyMAX_UPLOAD_SIZE:1065353216=1_065_353_216
Maximum upload size currently supported by PDP servers.
1 GiB adjusted for fr32 expansion: 1 GiB * (127/128) = 1,065,353,216 bytes
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.
Note: While it’s technically possible to upload pieces this large as Uint8Array, streaming via AsyncIterable is strongly recommended for non-trivial sizes. See SIZE_CONSTANTS.MAX_UPLOAD_SIZE in synapse-sdk for detailed guidance.
readonlyMiB:bigint
Bytes in 1 MiB
MIN_UPLOAD_SIZE
Section titled “MIN_UPLOAD_SIZE”
readonlyMIN_UPLOAD_SIZE:127=127
Minimum upload size; matches what storage providers currently accept.
readonlyPiB:bigint
Bytes in 1 PiB
readonlyTiB:bigint
Bytes in 1 TiB