feat(bin, engine, prune): spawn pruning task from the engine (#3566)

This commit is contained in:
Alexey Shekhirin
2023-07-12 13:03:08 +01:00
committed by GitHub
parent a7eae8cfc3
commit dbafe23cce
20 changed files with 494 additions and 50 deletions

View File

@@ -36,6 +36,7 @@ reth-payload-builder = { workspace = true }
reth-basic-payload-builder = { path = "../../crates/payload/basic" }
reth-discv4 = { path = "../../crates/net/discv4" }
reth-metrics = { workspace = true }
reth-prune = { path = "../../crates/prune" }
jemallocator = { version = "0.5.0", optional = true }
jemalloc-ctl = { version = "0.5.0", optional = true }

View File

@@ -360,6 +360,11 @@ impl Command {
None
};
let pruner = config.prune.map(|prune_config| {
info!(target: "reth::cli", "Pruner initialized");
reth_prune::Pruner::new(prune_config.block_interval, tree_config.max_reorg_depth())
});
// Configure the consensus engine
let (beacon_consensus_engine, beacon_engine_handle) = BeaconConsensusEngine::with_channel(
client,
@@ -374,6 +379,7 @@ impl Command {
MIN_BLOCKS_FOR_PIPELINE_RUN,
consensus_engine_tx,
consensus_engine_rx,
pruner,
)?;
info!(target: "reth::cli", "Consensus engine initialized");