ChainSafe / ChainSafe/lodestar

Update the logic for pruning the unfinalized headers

Open
#5,646 0 comments 0 reactions 1 assignee Claimed by @nazarhussain View on GitHub
help wanted meta-feature-request prio-low scope-light-clients
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 18h
Merged PRs (30d)
156

Description

### Problem description

In `@lodestar/prover` we store the `payloads` and `roots`. The `roots` are divided into `finalized` and `unfinalized` categories. The finalized roots are cleaned based on `MAX_PAYLOAD_HISTORY`.

https://github.com/ChainSafe/lodestar/blob/08b82af89f83e89ecaa164e8d94e4e296e0ee65e/packages/prover/src/proof_provider/payload_store.ts#L177-L181

There could be cases when chain is not finalized and endup huge memory bloat for unfinalized root.s

### Solution description

We nee to develop similar limit for unfinalzied roots similar to `MAX_PAYLOAD_HISTORY`. And this value should be configureable so based on different networks user can configure.

### Additional context

Extracted from https://github.com/ChainSafe/lodestar/issues/4706

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.