# restartPointSortedBlock

> **restartPointSortedBlock**(`entries`, `options?`): [`SortedBlock`](/reference/knotkit/sorted-block/interfaces/sortedblock/)

Defined in: [packages/sorted-block/src/restart-point-sorted-block.ts:19](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/sorted-block/src/restart-point-sorted-block.ts#L19)

Build an immutable `restart-point` block from entries already in strictly ascending `compareBytes` key order.

Each key is stored as the bytes it does not share with the previous key, except at every `restartInterval`-th entry, a restart point, where it is stored whole. Lookups binary-search the restart keys in place and decode at most `restartInterval` entries forward. Every input byte is copied into one `Uint8Array`, so mutating the caller’s arrays afterwards cannot change the block. Builds in O(total key and value bytes).

## Parameters

### entries

`Iterable`<[`SortedBlockEntry`](/reference/knotkit/sorted-block/type-aliases/sortedblockentry/)>

### options?

[`RestartPointSortedBlockOptions`](/reference/knotkit/sorted-block/interfaces/restartpointsortedblockoptions/)

## Returns

[`SortedBlock`](/reference/knotkit/sorted-block/interfaces/sortedblock/)

## Throws

With `INVALID_RESTART_INTERVAL` when `restartInterval` is not a positive safe integer, `INVALID_ENTRY` when `entries` is not iterable or an entry is not a `[Uint8Array, Uint8Array]` pair, `UNSORTED_KEY` or `DUPLICATE_KEY` when keys do not strictly ascend, and `MAX_CAPACITY_EXCEEDED` when the entries pass 2^32 - 1 bytes or entries, or the runtime refuses the allocation.
