Keep execution payload during historical backfill when prune-payloads set to false (#6766)

- #6510


  - Keep execution payload during historical backfill when `--prune-payloads false` is set
- Add a field in the historical backfill debug log to indicate if execution payload is kept
- Add a test to check historical blocks has execution payload when `--prune-payloads false is set
- Very minor typo correction that I notice when working on this
This commit is contained in:
chonghe
2025-02-07 17:19:29 +08:00
committed by GitHub
parent 921d95217d
commit d6596dbe21
4 changed files with 31 additions and 9 deletions

View File

@@ -130,10 +130,20 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
});
}
let blinded_block = block.clone_as_blinded();
// Store block in the hot database without payload.
self.store
.blinded_block_as_kv_store_ops(&block_root, &blinded_block, &mut hot_batch);
if !self.store.get_config().prune_payloads {
// If prune-payloads is set to false, store the block which includes the execution payload
self.store
.block_as_kv_store_ops(&block_root, (*block).clone(), &mut hot_batch)?;
} else {
let blinded_block = block.clone_as_blinded();
// Store block in the hot database without payload.
self.store.blinded_block_as_kv_store_ops(
&block_root,
&blinded_block,
&mut hot_batch,
);
}
// Store the blobs too
if let Some(blobs) = maybe_blobs {
new_oldest_blob_slot = Some(block.slot());