Coin Brief ENDE

Agave gives each snapshot file its own size limits and cuts two of them from 32 GiB to 1 GiB

Anza merged pull request #16946 into the Agave validator client on 21 November. It changes how snapshot files are deserialized with the wincode library. Until now the serialization helpers used one hardcoded preallocation limit of 32 GiB for every snapshot file. The pull request description points out that the limit was applied to each collection separately, so nested collections could allocate much more than 32 GiB in total, and that the bank snapshot and status cache files were allowed to grow to 32 GiB, far above their real size.

The change, written by kskalski, passes a configuration specific to each file into the snapshot helpers. Each preallocation limit is sized from the largest collections found in a mainnet snapshot, and the size limit for the bank snapshot and the status cache files drops to 1 GiB. Tests now use wincode's byte-slice functions for their in-memory round trips.

For testing, the author reports that all five files of a mainnet snapshot taken at slot 452539277 deserialize under the new limits. The pull request adds 113 lines and removes 66.

Agave gives each snapshot file its own size limits and cuts two of them from 32 GiB to 1 GiB
Agave gives each snapshot file its own size limits and cuts two of them from 32 GiB to 1 GiB — Coin Brief

Why it matters

The old setting looked like a 32 GiB cap per file but did not bound the total a file could make the validator allocate. Sizing each limit from a real mainnet snapshot makes the bound on memory requested while reading a snapshot match the data it is meant to hold.