Skip to content

pieceSizesToLeafCount

pieceSizesToLeafCount(pieceSizes): bigint

Defined in: packages/synapse-core/src/utils/pdp-size.ts:61

Sum the PDP data-bearing leaves produced by known raw piece sizes.

Leaf rounding is applied independently to each piece, matching PDPVerifier.

ParameterTypeDescription
pieceSizesreadonly bigint[]Raw payload size of every piece, in bytes

bigint

Aggregate data-bearing leaf count added by the pieces

ValidationError when the piece sizes are invalid