# GRAPH_MAX_DECODE_VERTICES

> `const` **GRAPH_MAX_DECODE_VERTICES**: `number`

Defined in: [packages/graph/src/serialization.ts:78](https://github.com/jkomyno/knotkit/blob/ef04dc6fd5182dca281abddf3e1dcb13118c15a4/packages/graph/src/serialization.ts#L78)

The largest vertex count a decoder will allocate for, and the largest a serializer will write: `2 ** 24`.

Enforced in both directions on purpose. Every layout allocates per vertex, so without it a payload of a few dozen bytes could claim two billion vertices and make the decoder allocate gigabytes; and an encoder could write bytes its own decoder refuses. Edge storage needs no separate budget, because every edge occupies bytes in the payload.
