ChainSafe / ChainSafe/lodestar
Add narrow state provider boundary for Fast Confirmation
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 483
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 150
Description
Fast Confirmation currently reaches directly into `IBeaconStateView` for state-derived data such as committees, active indices, slashing status, effective balances, checkpoint states, and pulled-up head state.
Refactor FCR to consume a narrow provider interface instead of full beacon state views.
Proposed direction:
```js
type FastConfirmationStateProvider = {
getHeadSlotCommittee(stateRoot: RootHex, slot: Slot): Iterable;
getCurrentEpochBalanceSource(stateRoot: RootHex, currentSlot: Slot): FastConfirmationBalanceSource | null;
getCheckpointBalanceSource(checkpoint: CheckpointWithHex): FastConfirmationBalanceSource | null;
};
```
## Motivation:
- Reduces coupling between FCR logic and full beacon-state internals.
- Makes FCR easier to test with small fixtures.
- Keeps state lookup, pull-up, and committee derivation behind one adapter.
- Allows future state-access optimizations without changing FCR rule logic.
Contributor guide
Assessment
This issue has not been assessed yet.