mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: relax ProviderFactory setup (#13254)
This commit is contained in:
@ -2,10 +2,10 @@
|
||||
|
||||
use alloy_primitives::B256;
|
||||
use clap::Parser;
|
||||
use reth_beacon_consensus::EthBeaconConsensus;
|
||||
use reth_chainspec::EthChainSpec;
|
||||
use reth_cli::chainspec::ChainSpecParser;
|
||||
use reth_config::{config::EtlConfig, Config};
|
||||
use reth_consensus::noop::NoopConsensus;
|
||||
use reth_db::{init_db, open_db_read_only, DatabaseEnv};
|
||||
use reth_db_common::init::init_genesis;
|
||||
use reth_downloaders::{bodies::noop::NoopBodiesDownloader, headers::noop::NoopHeaderDownloader};
|
||||
@ -151,10 +151,10 @@ impl<C: ChainSpecParser> EnvironmentArgs<C> {
|
||||
.add_stages(DefaultStages::new(
|
||||
factory.clone(),
|
||||
tip_rx,
|
||||
Arc::new(EthBeaconConsensus::new(self.chain.clone())),
|
||||
Arc::new(NoopConsensus::default()),
|
||||
NoopHeaderDownloader::default(),
|
||||
NoopBodiesDownloader::default(),
|
||||
NoopBlockExecutorProvider::default(),
|
||||
NoopBlockExecutorProvider::<N::Primitives>::default(),
|
||||
config.stages.clone(),
|
||||
prune_modes.clone(),
|
||||
))
|
||||
|
||||
@ -140,13 +140,7 @@ fn import_tables_with_range<N: NodeTypesWithDB>(
|
||||
/// `PlainAccountState` safely. There might be some state dependency from an address
|
||||
/// which hasn't been changed in the given range.
|
||||
fn unwind_and_copy<
|
||||
N: ProviderNodeTypes<
|
||||
Primitives: NodePrimitives<
|
||||
Block = reth_primitives::Block,
|
||||
Receipt = reth_primitives::Receipt,
|
||||
BlockHeader = reth_primitives::Header,
|
||||
>,
|
||||
>,
|
||||
N: ProviderNodeTypes<Primitives: NodePrimitives<BlockHeader = reth_primitives::Header>>,
|
||||
>(
|
||||
db_tool: &DbTool<N>,
|
||||
from: u64,
|
||||
@ -155,7 +149,8 @@ fn unwind_and_copy<
|
||||
) -> eyre::Result<()> {
|
||||
let provider = db_tool.provider_factory.database_provider_rw()?;
|
||||
|
||||
let mut exec_stage = ExecutionStage::new_with_executor(NoopBlockExecutorProvider::default());
|
||||
let mut exec_stage =
|
||||
ExecutionStage::new_with_executor(NoopBlockExecutorProvider::<N::Primitives>::default());
|
||||
|
||||
exec_stage.unwind(
|
||||
&provider,
|
||||
|
||||
@ -112,7 +112,7 @@ fn unwind_and_copy<
|
||||
|
||||
// Bring Plainstate to TO (hashing stage execution requires it)
|
||||
let mut exec_stage = ExecutionStage::new(
|
||||
NoopBlockExecutorProvider::default(), // Not necessary for unwinding.
|
||||
NoopBlockExecutorProvider::<N::Primitives>::default(), // Not necessary for unwinding.
|
||||
ExecutionStageThresholds {
|
||||
max_blocks: Some(u64::MAX),
|
||||
max_changes: None,
|
||||
|
||||
@ -120,7 +120,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
|
||||
let (tip_tx, tip_rx) = watch::channel(B256::ZERO);
|
||||
|
||||
// Unwinding does not require a valid executor
|
||||
let executor = NoopBlockExecutorProvider::default();
|
||||
let executor = NoopBlockExecutorProvider::<N::Primitives>::default();
|
||||
|
||||
let builder = if self.offline {
|
||||
Pipeline::<N>::builder().add_stages(
|
||||
|
||||
Reference in New Issue
Block a user