ChainSafe / ChainSafe/lodestar

Add narrow state provider boundary for Fast Confirmation

Open
#9,438 0 comments 0 reactions 1 assignee Claimed by @nazarhussain View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.