chore: remove unused async (#9299)

This commit is contained in:
joshieDo
2024-07-04 13:10:27 +02:00
committed by GitHub
parent afe86895ff
commit af280b98f7
14 changed files with 45 additions and 53 deletions

View File

@ -71,11 +71,11 @@ impl LaunchContext {
/// `config`.
///
/// Attaches both the `NodeConfig` and the loaded `reth.toml` config to the launch context.
pub async fn with_loaded_toml_config(
pub fn with_loaded_toml_config(
self,
config: NodeConfig,
) -> eyre::Result<LaunchContextWith<WithConfigs>> {
let toml_config = self.load_toml_config(&config).await?;
let toml_config = self.load_toml_config(&config)?;
Ok(self.with(WithConfigs { config, toml_config }))
}
@ -83,7 +83,7 @@ impl LaunchContext {
/// `config`.
///
/// This is async because the trusted peers may have to be resolved.
pub async fn load_toml_config(&self, config: &NodeConfig) -> eyre::Result<reth_config::Config> {
pub fn load_toml_config(&self, config: &NodeConfig) -> eyre::Result<reth_config::Config> {
let config_path = config.config.clone().unwrap_or_else(|| self.data_dir.config());
let mut toml_config = confy::load_path::<reth_config::Config>(&config_path)
@ -518,7 +518,7 @@ where
}
/// Creates a `BlockchainProvider` and attaches it to the launch context.
pub async fn with_blockchain_db<T>(
pub fn with_blockchain_db<T>(
self,
) -> eyre::Result<LaunchContextWith<Attached<WithConfigs, WithMeteredProviders<DB, T>>>>
where

View File

@ -104,7 +104,7 @@ where
let ctx = ctx
.with_configured_globals()
// load the toml config
.with_loaded_toml_config(config).await?
.with_loaded_toml_config(config)?
// add resolved peers
.with_resolved_peers().await?
// attach the database
@ -127,7 +127,7 @@ where
.with_metrics()
// passing FullNodeTypes as type parameter here so that we can build
// later the components.
.with_blockchain_db::<T>().await?
.with_blockchain_db::<T>()?
.with_components(components_builder, on_component_initialized).await?;
// spawn exexs
@ -201,8 +201,7 @@ where
static_file_producer,
ctx.components().block_executor().clone(),
pipeline_exex_handle,
)
.await?;
)?;
let pipeline_events = pipeline.events();
task.set_pipeline_events(pipeline_events);
@ -223,8 +222,7 @@ where
static_file_producer,
ctx.components().block_executor().clone(),
pipeline_exex_handle,
)
.await?;
)?;
(pipeline, Either::Right(network_client.clone()))
};

View File

@ -24,7 +24,7 @@ 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>(
pub fn build_networked_pipeline<DB, Client, Executor>(
config: &StageConfig,
client: Client,
consensus: Arc<dyn Consensus>,
@ -63,15 +63,14 @@ where
static_file_producer,
executor,
exex_manager_handle,
)
.await?;
)?;
Ok(pipeline)
}
/// Builds the [Pipeline] with the given [`ProviderFactory`] and downloaders.
#[allow(clippy::too_many_arguments)]
pub async fn build_pipeline<DB, H, B, Executor>(
pub fn build_pipeline<DB, H, B, Executor>(
provider_factory: ProviderFactory<DB>,
stage_config: &StageConfig,
header_downloader: H,