ChainSafe / ChainSafe/lodestar
Support old finalized checkpoints in assertPeerRelevance
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 483
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 150
Description
From https://github.com/ChainSafe/lodestar/pull/3405
TODO: If the slot is very old, go to the historical blocks DB and fetch the block with less or equal `slot`. Note that our db schema will have to be updated to persist the block root to prevent re-hashing. For now peers will be accepted, since it's better than throwing an error on `getBlockRootAtSlot()`
https://github.com/ChainSafe/lodestar/blob/fbeabc6acb9bd9b018c10f58ee0d1291843371b0/packages/lodestar/src/network/peers/utils/assertPeerRelevance.ts#L97-L99
Contributor guide
Research direction
Start in packages/lodestar/src/network/peers/utils/assertPeerRelevance.ts at the referenced getBlockRootAtSlot() call. Trace how finalized checkpoints are resolved and how the historical blocks DB stores blocks. Done means an old slot uses the block at or before that slot, with its block root persisted to avoid re-hashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain, databases, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100