# Pruning ExecutionPayloads in CL *Most of these ideas came from Jacek and conversations he led at Amphora. Writing them down to further this convo* ## Problem/Motivation In current Merge EL/CL separation designs, the various mechanisms generally assume that both EL and CL retain execution-payloads. EL does so to maintain their block-tree and participate in core `eth` networking protocols. CL does so (at least through `MIN_EPOCHS_FOR_BLOCK_REQUESTS`) to be able to serve requisite `BlocksByRange` requests and potentially as a local utility for other sync purposes. This creates a minimum of `MIN_EPOCHS_FOR_BLOCK_REQUESTS` (5 months on mainnet) of duplication of execution-payloads between EL and CL, and maximually up to duplication through the point of merge if the CL does not use block pruning strategies. Current PoW blocks grow at ~1.3GB per week and are ~160GB since genesis. If CL is only keeping beacon blocks through `MIN_EPOCHS_FOR_BLOCK_REQUESTS` deduplication between layers is ~26GB in local DB savings, but if they want to keep payloads since the Merge, this grows linearly with time. *Thus it is valuable to find a standard way to allow for pruning of execution payloads from CL but still allow access so they can respond to the requistite networking protocols* ## Solution 1. CL keep execution payloads alongside blocks since at least finality. This allows for being able to handle dynamic re-orgs in the space that is expected to potentially need them 2. CL *MAY* prune execution-payloads past finality, under the assumption that they can efficiently retrieve the payloads from the EL to handle BlocksByRange requests or any other emergent requirement. ### Suggestion Add an endpoint to the EngineAPI that allows for requesting ranges of ExecutionPayloads from EL. Essentially an analogue to the beacon chains p2p `BlocksByRange` for local EL queries. The CL knows the block number and can use this to form an efficient request of (typically) an epoch's worth of payloads. Similarily, because history of this kind is linear in nature (being finalized already in the typical case), the EL can serve such requests trivially from a flat file. *[TODO -- formally define the method and the mapping between current BlocksByRange and EL block defs]*