lambdaclass / lambdaclass/lambda_ethereum_consensus

Serve blocks for the latest `MIN_EPOCHS_FOR_BLOCK_REQUESTS` epochs

Open
#1,098 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Elixir
Stars
109
Forks
41
PR merge metrics
No merged PRs in 30d

Description

We added https://github.com/lambdaclass/lambda_ethereum_consensus/pull/1092 to keep our db small but this breaks the spec. We should remove this logic.

Instead, we should be able to serve block up until MIN_EPOCHS_FOR_BLOCK_REQUESTS epochs

See: https://github.com/ethereum/consensus-specs/blob/836bc43a0667990dd1243cf3aaad7e35a32eab99/specs/phase0/p2p-interface.md#why-are-blocksbyrange-requests-only-required-to-be-served-for-the-latest-min_epochs_for_block_requests-epochs

As part of this ticket, we should remove blocks older than MIN_EPOCHS_FOR_BLOCK_REQUESTS

We should also backfill the local block database to at least epoch current_epoch - MIN_EPOCHS_FOR_BLOCK_REQUESTS to be fully compliant with BlocksByRange requests when starting from a recent weak subjectivity checkpoint.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing PR 1092 and the linked consensus-specs BlocksByRange rationale to locate the block-serving, pruning, and database backfill paths. Done means serving blocks through the latest MIN_EPOCHS_FOR_BLOCK_REQUESTS epochs, removing older blocks, and backfilling from a recent weak subjectivity checkpoint to the required epoch.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
database, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.