ChainSafe / ChainSafe/lodestar
Avoid accessing full beacon state in PrepareNextSlotScheduler
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 483
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 150
Description
### Problem description
as part of #8650 we should not need the full beacon state in PrepareNextSlotScheduler
### Solution description
right now we need a full `CachedBeaconStateAllForks` in `PrepareNextSlotScheduler` in order to:
- get payload attributes
- get expected withdrawals
- genesis time
- epoch
- randao mix
- proposer index
- latest execution payload header block hash
- slot, epoch
- randao mix
- compute and cache its root early
instead of that, we should create a beacon state view as stated here and consume it everywhere
### Additional context
_No response_
Contributor guide
Research direction
Start by reading PrepareNextSlotScheduler and the context from #8650, focusing on where it consumes CachedBeaconStateAllForks. Replace those full-state accesses with the proposed beacon state view while preserving payload attributes, slot, epoch, randao mix, and root caching. Done means the scheduler no longer requires the full beacon state and its existing behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100