Files
lodestar/packages/cli/src
Nico Flaig 6324a39d74 feat: make serving historical state opt-in (#7799)
**Motivation**

Based on concerns raised by @twoeths in
https://github.com/ChainSafe/lodestar/pull/7781#issuecomment-2849856198
we decided to put historical state regen (which triggers `loadState` in
certain cases) behind a feature flag as it may affect validator
performance and users should be aware of it when using the feature, the
primary use case for it anyways is for users that need a RPC node to
query this data, not operators that use Lodestar as their staking node
with attached validators.

**Description**

Make serving historical state opt-in
- adds new flag `--serveHistoricalState`
- only enables `HistoricalStateRegen` if flag is set
- throws error if data that requires historical state regen is fetched

**Open question:** do we want to add a check to each `loadState` call
specifically or inside `loadState` function itself? practically this
code path is only triggered if we return state as `Uint8Array` which
implies that it must be historically generated but this is no longer
possible without setting `--serveHistoricalState` flag after this PR.


d85e73aa12/packages/state-transition/src/util/loadState/loadState.ts (L20)
2025-05-07 20:32:00 +01:00
..
2025-03-23 15:03:30 +07:00