feat(cli): expose tree engine persistence configuration (#10999)

This commit is contained in:
Roman Krasiuk
2024-09-18 20:24:01 +02:00
committed by GitHub
parent c09f650a3a
commit f64aecfbc8
9 changed files with 95 additions and 12 deletions

View File

@ -54,12 +54,20 @@ use crate::{
pub struct EngineNodeLauncher {
/// The task executor for the node.
pub ctx: LaunchContext,
/// Temporary configuration for engine tree.
/// After engine is stabilized, this should be configured through node builder.
pub engine_tree_config: TreeConfig,
}
impl EngineNodeLauncher {
/// Create a new instance of the ethereum node launcher.
pub const fn new(task_executor: TaskExecutor, data_dir: ChainPath<DataDirPath>) -> Self {
Self { ctx: LaunchContext::new(task_executor, data_dir) }
pub const fn new(
task_executor: TaskExecutor,
data_dir: ChainPath<DataDirPath>,
engine_tree_config: TreeConfig,
) -> Self {
Self { ctx: LaunchContext::new(task_executor, data_dir), engine_tree_config }
}
}
@ -85,7 +93,7 @@ where
self,
target: NodeBuilderWithComponents<T, CB, AO>,
) -> eyre::Result<Self::Node> {
let Self { ctx } = self;
let Self { ctx, engine_tree_config } = self;
let NodeBuilderWithComponents {
adapter: NodeTypesAdapter { database },
components_builder,
@ -221,7 +229,7 @@ where
ctx.blockchain_db().clone(),
pruner,
ctx.components().payload_builder().clone(),
TreeConfig::default(),
engine_tree_config,
ctx.invalid_block_hook()?,
ctx.sync_metrics_tx(),
);

View File

@ -28,6 +28,9 @@ pub use builder::{
mod launch;
pub use launch::{engine::EngineNodeLauncher, *};
/// Temporarily re-export engine tree config.
pub use reth_engine_tree::tree::config as engine_tree_config;
mod handle;
pub use handle::NodeHandle;