Skip to content

Commit

Permalink
Add prune_payloads false
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Jan 3, 2025
1 parent 7e0cdde commit 016e58e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions beacon_node/beacon_chain/src/chain_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ pub struct ChainConfig {
/// The delay in milliseconds applied by the node between sending each blob or data column batch.
/// This doesn't apply if the node is the block proposer.
pub blob_publication_batch_interval: Duration,
/// When prune execution payloads is set to false, store full block information instead of blinded block.
pub prune_payloads: bool,
}

impl Default for ChainConfig {
Expand Down Expand Up @@ -129,6 +131,7 @@ impl Default for ChainConfig {
enable_sampling: false,
blob_publication_batches: 4,
blob_publication_batch_interval: Duration::from_millis(300),
prune_payloads: true,
}
}
}
Expand Down
17 changes: 13 additions & 4 deletions beacon_node/beacon_chain/src/historical_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,19 @@ 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.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());
Expand Down

0 comments on commit 016e58e

Please sign in to comment.