mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
chore: remove HeaderSyncMode::Continuous & debug.continuous (#8714)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
This commit is contained in:
@@ -16,9 +16,7 @@ use reth_node_core::{
|
||||
node_config::NodeConfig,
|
||||
};
|
||||
use reth_primitives::{BlockNumber, Chain, ChainSpec, Head, B256};
|
||||
use reth_provider::{
|
||||
providers::StaticFileProvider, HeaderSyncMode, ProviderFactory, StaticFileProviderFactory,
|
||||
};
|
||||
use reth_provider::{providers::StaticFileProvider, ProviderFactory, StaticFileProviderFactory};
|
||||
use reth_prune::{PruneModes, PrunerBuilder};
|
||||
use reth_rpc_builder::config::RethRpcServerConfig;
|
||||
use reth_rpc_layer::JwtSecret;
|
||||
@@ -27,7 +25,7 @@ use reth_static_file::StaticFileProducer;
|
||||
use reth_tasks::TaskExecutor;
|
||||
use reth_tracing::tracing::{debug, error, info, warn};
|
||||
use std::{sync::Arc, thread::available_parallelism};
|
||||
use tokio::sync::{mpsc::Receiver, oneshot};
|
||||
use tokio::sync::{mpsc::Receiver, oneshot, watch};
|
||||
|
||||
/// Reusable setup for launching a node.
|
||||
///
|
||||
@@ -316,16 +314,6 @@ impl<R> LaunchContextWith<Attached<WithConfigs, R>> {
|
||||
.timeout(PrunerBuilder::DEFAULT_TIMEOUT)
|
||||
}
|
||||
|
||||
/// Returns the initial pipeline target, based on whether or not the node is running in
|
||||
/// `debug.tip` mode, `debug.continuous` mode, or neither.
|
||||
///
|
||||
/// If running in `debug.tip` mode, the configured tip is returned.
|
||||
/// Otherwise, if running in `debug.continuous` mode, the genesis hash is returned.
|
||||
/// Otherwise, `None` is returned. This is what the node will do by default.
|
||||
pub fn initial_pipeline_target(&self) -> Option<B256> {
|
||||
self.node_config().initial_pipeline_target(self.genesis_hash())
|
||||
}
|
||||
|
||||
/// Loads the JWT secret for the engine API
|
||||
pub fn auth_jwt_secret(&self) -> eyre::Result<JwtSecret> {
|
||||
let default_jwt_path = self.data_dir().jwt();
|
||||
@@ -377,11 +365,13 @@ where
|
||||
|
||||
info!(target: "reth::cli", unwind_target = %unwind_target, "Executing an unwind after a failed storage consistency check.");
|
||||
|
||||
let (_tip_tx, tip_rx) = watch::channel(B256::ZERO);
|
||||
|
||||
// Builds an unwind-only pipeline
|
||||
let pipeline = Pipeline::builder()
|
||||
.add_stages(DefaultStages::new(
|
||||
factory.clone(),
|
||||
HeaderSyncMode::Continuous,
|
||||
tip_rx,
|
||||
Arc::new(EthBeaconConsensus::new(self.chain_spec())),
|
||||
NoopHeaderDownloader::default(),
|
||||
NoopBodiesDownloader::default(),
|
||||
|
||||
@@ -250,7 +250,6 @@ where
|
||||
.build();
|
||||
|
||||
let pipeline = crate::setup::build_networked_pipeline(
|
||||
ctx.node_config(),
|
||||
&ctx.toml_config().stages,
|
||||
client.clone(),
|
||||
consensus.clone(),
|
||||
@@ -273,7 +272,6 @@ where
|
||||
(pipeline, Either::Left(client))
|
||||
} else {
|
||||
let pipeline = crate::setup::build_networked_pipeline(
|
||||
ctx.node_config(),
|
||||
&ctx.toml_config().stages,
|
||||
network_client.clone(),
|
||||
consensus.clone(),
|
||||
@@ -293,7 +291,7 @@ where
|
||||
|
||||
let pipeline_events = pipeline.events();
|
||||
|
||||
let initial_target = ctx.initial_pipeline_target();
|
||||
let initial_target = ctx.node_config().debug.tip;
|
||||
|
||||
let mut pruner_builder =
|
||||
ctx.pruner_builder().max_reorg_depth(tree_config.max_reorg_depth() as usize);
|
||||
@@ -316,7 +314,6 @@ where
|
||||
Box::new(ctx.task_executor().clone()),
|
||||
Box::new(node_adapter.components.network().clone()),
|
||||
max_block,
|
||||
ctx.node_config().debug.continuous,
|
||||
node_adapter.components.payload_builder().clone(),
|
||||
initial_target,
|
||||
reth_beacon_consensus::MIN_BLOCKS_FOR_PIPELINE_RUN,
|
||||
|
||||
@@ -13,11 +13,8 @@ use reth_network_p2p::{
|
||||
bodies::{client::BodiesClient, downloader::BodyDownloader},
|
||||
headers::{client::HeadersClient, downloader::HeaderDownloader},
|
||||
};
|
||||
use reth_node_core::{
|
||||
node_config::NodeConfig,
|
||||
primitives::{BlockNumber, B256},
|
||||
};
|
||||
use reth_provider::{HeaderSyncMode, ProviderFactory};
|
||||
use reth_node_core::primitives::{BlockNumber, B256};
|
||||
use reth_provider::ProviderFactory;
|
||||
use reth_stages::{prelude::DefaultStages, stages::ExecutionStage, Pipeline, StageSet};
|
||||
use reth_static_file::StaticFileProducer;
|
||||
use reth_tasks::TaskExecutor;
|
||||
@@ -28,7 +25,6 @@ use tokio::sync::watch;
|
||||
/// Constructs a [Pipeline] that's wired to the network
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn build_networked_pipeline<DB, Client, Executor>(
|
||||
node_config: &NodeConfig,
|
||||
config: &StageConfig,
|
||||
client: Client,
|
||||
consensus: Arc<dyn Consensus>,
|
||||
@@ -56,7 +52,6 @@ where
|
||||
.into_task_with(task_executor);
|
||||
|
||||
let pipeline = build_pipeline(
|
||||
node_config,
|
||||
provider_factory,
|
||||
config,
|
||||
header_downloader,
|
||||
@@ -77,7 +72,6 @@ where
|
||||
/// Builds the [Pipeline] with the given [`ProviderFactory`] and downloaders.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn build_pipeline<DB, H, B, Executor>(
|
||||
node_config: &NodeConfig,
|
||||
provider_factory: ProviderFactory<DB>,
|
||||
stage_config: &StageConfig,
|
||||
header_downloader: H,
|
||||
@@ -107,18 +101,13 @@ where
|
||||
|
||||
let prune_modes = prune_config.map(|prune| prune.segments).unwrap_or_default();
|
||||
|
||||
let header_mode = if node_config.debug.continuous {
|
||||
HeaderSyncMode::Continuous
|
||||
} else {
|
||||
HeaderSyncMode::Tip(tip_rx)
|
||||
};
|
||||
let pipeline = builder
|
||||
.with_tip_sender(tip_tx)
|
||||
.with_metrics_tx(metrics_tx.clone())
|
||||
.add_stages(
|
||||
DefaultStages::new(
|
||||
provider_factory.clone(),
|
||||
header_mode,
|
||||
tip_rx,
|
||||
Arc::clone(&consensus),
|
||||
header_downloader,
|
||||
body_downloader,
|
||||
|
||||
Reference in New Issue
Block a user