diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index f06de042b8..5aa011bce0 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -262,12 +262,7 @@ impl NodeCommand { info!(target: "reth::cli", "{}", DisplayHardforks::from(self.chain.hardforks().clone())); - let consensus: Arc = if self.dev.dev { - debug!(target: "reth::cli", "Using auto seal"); - Arc::new(AutoSealConsensus::new(Arc::clone(&self.chain))) - } else { - Arc::new(BeaconConsensus::new(Arc::clone(&self.chain))) - }; + let consensus = self.consensus(); self.init_trusted_nodes(&mut config); @@ -558,6 +553,18 @@ impl NodeCommand { } } + /// Returns the [Consensus] instance to use. + /// + /// By default this will be a [BeaconConsensus] instance, but if the `--dev` flag is set, it + /// will be an [AutoSealConsensus] instance. + pub fn consensus(&self) -> Arc { + if self.dev.dev { + Arc::new(AutoSealConsensus::new(Arc::clone(&self.chain))) + } else { + Arc::new(BeaconConsensus::new(Arc::clone(&self.chain))) + } + } + /// Constructs a [Pipeline] that's wired to the network #[allow(clippy::too_many_arguments)] async fn build_networked_pipeline(