lambda_ethereum_consensus icon indicating copy to clipboard operation
lambda_ethereum_consensus copied to clipboard

Serve blocks for the latest `MIN_EPOCHS_FOR_BLOCK_REQUESTS` epochs

Open mpaulucci opened this issue 1 year ago • 0 comments

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.

mpaulucci avatar May 22 '24 12:05 mpaulucci