mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(cli): unify trait bounds (#12604)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -15,24 +15,23 @@ use reth_blockchain_tree::{
|
|||||||
};
|
};
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_consensus::Consensus;
|
use reth_consensus::Consensus;
|
||||||
use reth_errors::RethResult;
|
use reth_errors::RethResult;
|
||||||
use reth_evm::execute::{BlockExecutorProvider, Executor};
|
use reth_evm::execute::{BlockExecutorProvider, Executor};
|
||||||
use reth_execution_types::ExecutionOutcome;
|
use reth_execution_types::ExecutionOutcome;
|
||||||
use reth_fs_util as fs;
|
use reth_fs_util as fs;
|
||||||
use reth_node_api::{
|
use reth_node_api::{EngineApiMessageVersion, PayloadBuilderAttributes};
|
||||||
EngineApiMessageVersion, NodeTypesWithDB, NodeTypesWithEngine, PayloadBuilderAttributes,
|
|
||||||
};
|
|
||||||
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
|
use reth_node_ethereum::{EthEvmConfig, EthExecutorProvider};
|
||||||
use reth_primitives::{
|
use reth_primitives::{
|
||||||
BlobTransaction, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, SealedHeader,
|
BlobTransaction, PooledTransactionsElement, SealedBlock, SealedBlockWithSenders, SealedHeader,
|
||||||
Transaction, TransactionSigned,
|
Transaction, TransactionSigned,
|
||||||
};
|
};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::BlockchainProvider, BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider,
|
providers::{BlockchainProvider, ProviderNodeTypes},
|
||||||
ProviderFactory, StageCheckpointReader, StateProviderFactory,
|
BlockHashReader, BlockReader, BlockWriter, ChainSpecProvider, ProviderFactory,
|
||||||
|
StageCheckpointReader, StateProviderFactory,
|
||||||
};
|
};
|
||||||
use reth_revm::{
|
use reth_revm::{
|
||||||
cached::CachedReads,
|
cached::CachedReads,
|
||||||
@ -88,7 +87,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
/// Fetches the best block block from the database.
|
/// Fetches the best block block from the database.
|
||||||
///
|
///
|
||||||
/// If the database is empty, returns the genesis block.
|
/// If the database is empty, returns the genesis block.
|
||||||
fn lookup_best_block<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>>(
|
fn lookup_best_block<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
factory: ProviderFactory<N>,
|
factory: ProviderFactory<N>,
|
||||||
) -> RethResult<Arc<SealedBlock>> {
|
) -> RethResult<Arc<SealedBlock>> {
|
||||||
@ -123,7 +122,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Execute `debug in-memory-merkle` command
|
/// Execute `debug in-memory-merkle` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ use futures::{stream::select as stream_select, StreamExt};
|
|||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_cli_util::get_secret_key;
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
@ -22,10 +22,11 @@ use reth_exex::ExExManagerHandle;
|
|||||||
use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider, NetworkHandle};
|
use reth_network::{BlockDownloaderProvider, NetworkEventListenerProvider, NetworkHandle};
|
||||||
use reth_network_api::NetworkInfo;
|
use reth_network_api::NetworkInfo;
|
||||||
use reth_network_p2p::{headers::client::HeadersClient, EthBlockClient};
|
use reth_network_p2p::{headers::client::HeadersClient, EthBlockClient};
|
||||||
use reth_node_api::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine};
|
use reth_node_api::NodeTypesWithDBAdapter;
|
||||||
use reth_node_ethereum::EthExecutorProvider;
|
use reth_node_ethereum::EthExecutorProvider;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
BlockExecutionWriter, ChainSpecProvider, ProviderFactory, StageCheckpointReader,
|
providers::ProviderNodeTypes, BlockExecutionWriter, ChainSpecProvider, ProviderFactory,
|
||||||
|
StageCheckpointReader,
|
||||||
};
|
};
|
||||||
use reth_prune::PruneModes;
|
use reth_prune::PruneModes;
|
||||||
use reth_stages::{
|
use reth_stages::{
|
||||||
@ -58,7 +59,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||||
fn build_pipeline<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>, Client>(
|
fn build_pipeline<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>, Client>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
client: Client,
|
client: Client,
|
||||||
@ -116,7 +117,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
Ok(pipeline)
|
Ok(pipeline)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn build_network<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
async fn build_network<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
task_executor: TaskExecutor,
|
task_executor: TaskExecutor,
|
||||||
@ -160,7 +161,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Execute `execution-debug` command
|
/// Execute `execution-debug` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ use clap::Parser;
|
|||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_cli_util::get_secret_key;
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
@ -19,12 +19,11 @@ use reth_evm::execute::{BlockExecutorProvider, Executor};
|
|||||||
use reth_execution_types::ExecutionOutcome;
|
use reth_execution_types::ExecutionOutcome;
|
||||||
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
||||||
use reth_network_api::NetworkInfo;
|
use reth_network_api::NetworkInfo;
|
||||||
use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine};
|
|
||||||
use reth_node_ethereum::EthExecutorProvider;
|
use reth_node_ethereum::EthExecutorProvider;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
writer::UnifiedStorageWriter, AccountExtReader, ChainSpecProvider, HashingWriter,
|
providers::ProviderNodeTypes, writer::UnifiedStorageWriter, AccountExtReader,
|
||||||
HeaderProvider, LatestStateProviderRef, OriginalValuesKnown, ProviderFactory,
|
ChainSpecProvider, HashingWriter, HeaderProvider, LatestStateProviderRef, OriginalValuesKnown,
|
||||||
StageCheckpointReader, StateWriter, StorageReader,
|
ProviderFactory, StageCheckpointReader, StateWriter, StorageReader,
|
||||||
};
|
};
|
||||||
use reth_revm::database::StateProviderDatabase;
|
use reth_revm::database::StateProviderDatabase;
|
||||||
use reth_stages::StageId;
|
use reth_stages::StageId;
|
||||||
@ -56,7 +55,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||||
async fn build_network<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>>(
|
async fn build_network<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
task_executor: TaskExecutor,
|
task_executor: TaskExecutor,
|
||||||
@ -78,7 +77,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Execute `debug in-memory-merkle` command
|
/// Execute `debug in-memory-merkle` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -6,7 +6,7 @@ use clap::Parser;
|
|||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_cli_util::get_secret_key;
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
@ -17,12 +17,11 @@ use reth_evm::execute::{BatchExecutor, BlockExecutorProvider};
|
|||||||
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
||||||
use reth_network_api::NetworkInfo;
|
use reth_network_api::NetworkInfo;
|
||||||
use reth_network_p2p::full_block::FullBlockClient;
|
use reth_network_p2p::full_block::FullBlockClient;
|
||||||
use reth_node_api::{NodeTypesWithDB, NodeTypesWithEngine};
|
|
||||||
use reth_node_ethereum::EthExecutorProvider;
|
use reth_node_ethereum::EthExecutorProvider;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
writer::UnifiedStorageWriter, BlockNumReader, BlockWriter, ChainSpecProvider,
|
providers::ProviderNodeTypes, writer::UnifiedStorageWriter, BlockNumReader, BlockWriter,
|
||||||
DatabaseProviderFactory, HeaderProvider, LatestStateProviderRef, OriginalValuesKnown,
|
ChainSpecProvider, DatabaseProviderFactory, HeaderProvider, LatestStateProviderRef,
|
||||||
ProviderError, ProviderFactory, StateWriter,
|
OriginalValuesKnown, ProviderError, ProviderFactory, StateWriter,
|
||||||
};
|
};
|
||||||
use reth_revm::database::StateProviderDatabase;
|
use reth_revm::database::StateProviderDatabase;
|
||||||
use reth_stages::{
|
use reth_stages::{
|
||||||
@ -56,7 +55,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||||
async fn build_network<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>>(
|
async fn build_network<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
task_executor: TaskExecutor,
|
task_executor: TaskExecutor,
|
||||||
@ -78,7 +77,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Execute `merkle-debug` command
|
/// Execute `merkle-debug` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
|
use reth_cli_commands::common::CliNodeTypes;
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_node_api::NodeTypesWithEngine;
|
|
||||||
use reth_node_ethereum::EthEngineTypes;
|
use reth_node_ethereum::EthEngineTypes;
|
||||||
|
|
||||||
mod build_block;
|
mod build_block;
|
||||||
@ -37,9 +37,7 @@ pub enum Subcommands<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||||
/// Execute `debug` command
|
/// Execute `debug` command
|
||||||
pub async fn execute<
|
pub async fn execute<N: CliNodeTypes<Engine = EthEngineTypes, ChainSpec = C::ChainSpec>>(
|
||||||
N: NodeTypesWithEngine<Engine = EthEngineTypes, ChainSpec = C::ChainSpec>,
|
|
||||||
>(
|
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -8,7 +8,7 @@ use reth_blockchain_tree::{
|
|||||||
};
|
};
|
||||||
use reth_chainspec::ChainSpec;
|
use reth_chainspec::ChainSpec;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_cli_util::get_secret_key;
|
use reth_cli_util::get_secret_key;
|
||||||
use reth_config::Config;
|
use reth_config::Config;
|
||||||
@ -18,13 +18,12 @@ use reth_engine_util::engine_store::{EngineMessageStore, StoredEngineApiMessage}
|
|||||||
use reth_fs_util as fs;
|
use reth_fs_util as fs;
|
||||||
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
||||||
use reth_network_api::NetworkInfo;
|
use reth_network_api::NetworkInfo;
|
||||||
use reth_node_api::{
|
use reth_node_api::{EngineApiMessageVersion, NodeTypesWithDBAdapter};
|
||||||
EngineApiMessageVersion, NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine,
|
|
||||||
};
|
|
||||||
use reth_node_ethereum::{EthEngineTypes, EthEvmConfig, EthExecutorProvider};
|
use reth_node_ethereum::{EthEngineTypes, EthEvmConfig, EthExecutorProvider};
|
||||||
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
|
use reth_payload_builder::{PayloadBuilderHandle, PayloadBuilderService};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::BlockchainProvider, CanonStateSubscriptions, ChainSpecProvider, ProviderFactory,
|
providers::{BlockchainProvider, ProviderNodeTypes},
|
||||||
|
CanonStateSubscriptions, ChainSpecProvider, ProviderFactory,
|
||||||
};
|
};
|
||||||
use reth_prune::PruneModes;
|
use reth_prune::PruneModes;
|
||||||
use reth_stages::Pipeline;
|
use reth_stages::Pipeline;
|
||||||
@ -56,7 +55,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||||
async fn build_network<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>>(
|
async fn build_network<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
task_executor: TaskExecutor,
|
task_executor: TaskExecutor,
|
||||||
@ -78,9 +77,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Execute `debug replay-engine` command
|
/// Execute `debug replay-engine` command
|
||||||
pub async fn execute<
|
pub async fn execute<N: CliNodeTypes<Engine = EthEngineTypes, ChainSpec = C::ChainSpec>>(
|
||||||
N: NodeTypesWithEngine<Engine = EthEngineTypes, ChainSpec = C::ChainSpec>,
|
|
||||||
>(
|
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ pub struct EnvironmentArgs<C: ChainSpecParser> {
|
|||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> EnvironmentArgs<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> EnvironmentArgs<C> {
|
||||||
/// Initializes environment according to [`AccessRights`] and returns an instance of
|
/// Initializes environment according to [`AccessRights`] and returns an instance of
|
||||||
/// [`Environment`].
|
/// [`Environment`].
|
||||||
pub fn init<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub fn init<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
access: AccessRights,
|
access: AccessRights,
|
||||||
) -> eyre::Result<Environment<N>> {
|
) -> eyre::Result<Environment<N>> {
|
||||||
@ -105,7 +105,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Environmen
|
|||||||
/// If it's a read-write environment and an issue is found, it will attempt to heal (including a
|
/// If it's a read-write environment and an issue is found, it will attempt to heal (including a
|
||||||
/// pipeline unwind). Otherwise, it will print out an warning, advising the user to restart the
|
/// pipeline unwind). Otherwise, it will print out an warning, advising the user to restart the
|
||||||
/// node to heal.
|
/// node to heal.
|
||||||
fn create_provider_factory<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
fn create_provider_factory<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
&self,
|
&self,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
db: Arc<DatabaseEnv>,
|
db: Arc<DatabaseEnv>,
|
||||||
@ -188,3 +188,8 @@ impl AccessRights {
|
|||||||
matches!(self, Self::RW)
|
matches!(self, Self::RW)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Helper trait with a common set of requirements for the
|
||||||
|
/// [`NodeTypes`](reth_node_builder::NodeTypes) in CLI.
|
||||||
|
pub trait CliNodeTypes: NodeTypesWithEngine<ChainSpec: EthereumHardforks> {}
|
||||||
|
impl<N> CliNodeTypes for N where N: NodeTypesWithEngine<ChainSpec: EthereumHardforks> {}
|
||||||
|
|||||||
@ -1,11 +1,14 @@
|
|||||||
use crate::db::get::{maybe_json_value_parser, table_key};
|
use crate::{
|
||||||
|
common::CliNodeTypes,
|
||||||
|
db::get::{maybe_json_value_parser, table_key},
|
||||||
|
};
|
||||||
use ahash::RandomState;
|
use ahash::RandomState;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::EthereumHardforks;
|
use reth_chainspec::EthereumHardforks;
|
||||||
use reth_db::{DatabaseEnv, RawKey, RawTable, RawValue, TableViewer, Tables};
|
use reth_db::{DatabaseEnv, RawKey, RawTable, RawValue, TableViewer, Tables};
|
||||||
use reth_db_api::{cursor::DbCursorRO, table::Table, transaction::DbTx};
|
use reth_db_api::{cursor::DbCursorRO, table::Table, transaction::DbTx};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine};
|
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithDBAdapter};
|
||||||
use reth_provider::{providers::ProviderNodeTypes, DBProvider};
|
use reth_provider::{providers::ProviderNodeTypes, DBProvider};
|
||||||
use std::{
|
use std::{
|
||||||
hash::{BuildHasher, Hasher},
|
hash::{BuildHasher, Hasher},
|
||||||
@ -36,7 +39,7 @@ pub struct Command {
|
|||||||
|
|
||||||
impl Command {
|
impl Command {
|
||||||
/// Execute `db checksum` command
|
/// Execute `db checksum` command
|
||||||
pub fn execute<N: NodeTypesWithEngine<ChainSpec: EthereumHardforks>>(
|
pub fn execute<N: CliNodeTypes<ChainSpec: EthereumHardforks>>(
|
||||||
self,
|
self,
|
||||||
tool: &DbTool<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>,
|
tool: &DbTool<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_db::version::{get_db_version, DatabaseVersionError, DB_VERSION};
|
use reth_db::version::{get_db_version, DatabaseVersionError, DB_VERSION};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
|
||||||
mod checksum;
|
mod checksum;
|
||||||
@ -65,9 +64,7 @@ macro_rules! db_ro_exec {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
||||||
/// Execute `db` command
|
/// Execute `db` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
let data_dir = self.env.datadir.clone().resolve_datadir(self.env.chain.chain());
|
let data_dir = self.env.datadir.clone().resolve_datadir(self.env.chain.chain());
|
||||||
let db_path = data_dir.db();
|
let db_path = data_dir.db();
|
||||||
let static_files_path = data_dir.static_files();
|
let static_files_path = data_dir.static_files();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use crate::db::checksum::ChecksumViewer;
|
use crate::{common::CliNodeTypes, db::checksum::ChecksumViewer};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use comfy_table::{Cell, Row, Table as ComfyTable};
|
use comfy_table::{Cell, Row, Table as ComfyTable};
|
||||||
use eyre::WrapErr;
|
use eyre::WrapErr;
|
||||||
@ -9,9 +9,7 @@ use reth_db::{mdbx, static_file::iter_static_files, DatabaseEnv, TableViewer, Ta
|
|||||||
use reth_db_api::database::Database;
|
use reth_db_api::database::Database;
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_fs_util as fs;
|
use reth_fs_util as fs;
|
||||||
use reth_node_builder::{
|
use reth_node_builder::{NodePrimitives, NodeTypesWithDB, NodeTypesWithDBAdapter};
|
||||||
NodePrimitives, NodeTypesWithDB, NodeTypesWithDBAdapter, NodeTypesWithEngine,
|
|
||||||
};
|
|
||||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||||
use reth_provider::providers::{ProviderNodeTypes, StaticFileProvider};
|
use reth_provider::providers::{ProviderNodeTypes, StaticFileProvider};
|
||||||
use reth_static_file_types::SegmentRangeInclusive;
|
use reth_static_file_types::SegmentRangeInclusive;
|
||||||
@ -40,7 +38,7 @@ pub struct Command {
|
|||||||
|
|
||||||
impl Command {
|
impl Command {
|
||||||
/// Execute `db stats` command
|
/// Execute `db stats` command
|
||||||
pub fn execute<N: NodeTypesWithEngine<ChainSpec: EthereumHardforks>>(
|
pub fn execute<N: CliNodeTypes<ChainSpec: EthereumHardforks>>(
|
||||||
self,
|
self,
|
||||||
data_dir: ChainPath<DataDirPath>,
|
data_dir: ChainPath<DataDirPath>,
|
||||||
tool: &DbTool<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>,
|
tool: &DbTool<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
//! Command that initializes the node by importing a chain from a file.
|
//! Command that initializes the node by importing a chain from a file.
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use alloy_primitives::B256;
|
use alloy_primitives::B256;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use futures::{Stream, StreamExt};
|
use futures::{Stream, StreamExt};
|
||||||
@ -20,7 +20,6 @@ use reth_network_p2p::{
|
|||||||
bodies::downloader::BodyDownloader,
|
bodies::downloader::BodyDownloader,
|
||||||
headers::downloader::{HeaderDownloader, SyncTarget},
|
headers::downloader::{HeaderDownloader, SyncTarget},
|
||||||
};
|
};
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_node_core::version::SHORT_VERSION;
|
use reth_node_core::version::SHORT_VERSION;
|
||||||
use reth_node_events::node::NodeEvent;
|
use reth_node_events::node::NodeEvent;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
@ -60,7 +59,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> ImportComm
|
|||||||
/// Execute `import` command
|
/// Execute `import` command
|
||||||
pub async fn execute<N, E, F>(self, executor: F) -> eyre::Result<()>
|
pub async fn execute<N, E, F>(self, executor: F) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>,
|
N: CliNodeTypes<ChainSpec = C::ChainSpec>,
|
||||||
E: BlockExecutorProvider,
|
E: BlockExecutorProvider,
|
||||||
F: FnOnce(Arc<N::ChainSpec>) -> E,
|
F: FnOnce(Arc<N::ChainSpec>) -> E,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
//! Command that initializes the node from a genesis file.
|
//! Command that initializes the node from a genesis file.
|
||||||
|
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_provider::BlockHashReader;
|
use reth_provider::BlockHashReader;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
@ -17,9 +16,7 @@ pub struct InitCommand<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> InitCommand<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> InitCommand<C> {
|
||||||
/// Execute the `init` command
|
/// Execute the `init` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
info!(target: "reth::cli", "reth init starting");
|
info!(target: "reth::cli", "reth init starting");
|
||||||
|
|
||||||
let Environment { provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
let Environment { provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
//! Command that initializes the node from a genesis file.
|
//! Command that initializes the node from a genesis file.
|
||||||
|
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use alloy_primitives::{B256, U256};
|
use alloy_primitives::{B256, U256};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_db_common::init::init_from_state_dump;
|
use reth_db_common::init::init_from_state_dump;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_primitives::SealedHeader;
|
use reth_primitives::SealedHeader;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
BlockNumReader, DatabaseProviderFactory, StaticFileProviderFactory, StaticFileWriter,
|
BlockNumReader, DatabaseProviderFactory, StaticFileProviderFactory, StaticFileWriter,
|
||||||
@ -68,9 +67,7 @@ pub struct InitStateCommand<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> InitStateCommand<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> InitStateCommand<C> {
|
||||||
/// Execute the `init` command
|
/// Execute the `init` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
info!(target: "reth::cli", "Reth init-state starting");
|
info!(target: "reth::cli", "Reth init-state starting");
|
||||||
|
|
||||||
let Environment { config, provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
let Environment { config, provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
//! Command that runs pruning without any limits.
|
//! Command that runs pruning without any limits.
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_prune::PrunerBuilder;
|
use reth_prune::PrunerBuilder;
|
||||||
use reth_static_file::StaticFileProducer;
|
use reth_static_file::StaticFileProducer;
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
@ -17,9 +16,7 @@ pub struct PruneCommand<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> PruneCommand<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> PruneCommand<C> {
|
||||||
/// Execute the `prune` command
|
/// Execute the `prune` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
let Environment { config, provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
let Environment { config, provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||||
let prune_config = config.prune.unwrap_or_default();
|
let prune_config = config.prune.unwrap_or_default();
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
//! `reth recover` command.
|
//! `reth recover` command.
|
||||||
|
|
||||||
|
use crate::common::CliNodeTypes;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
|
|
||||||
mod storage_tries;
|
mod storage_tries;
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ pub enum Subcommands<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
||||||
/// Execute `recover` command
|
/// Execute `recover` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
ctx: CliContext,
|
ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
@ -8,7 +8,6 @@ use reth_db_api::{
|
|||||||
cursor::{DbCursorRO, DbDupCursorRW},
|
cursor::{DbCursorRO, DbDupCursorRW},
|
||||||
transaction::DbTx,
|
transaction::DbTx,
|
||||||
};
|
};
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_provider::{BlockNumReader, HeaderProvider, ProviderError};
|
use reth_provider::{BlockNumReader, HeaderProvider, ProviderError};
|
||||||
use reth_trie::StateRoot;
|
use reth_trie::StateRoot;
|
||||||
use reth_trie_db::DatabaseStateRoot;
|
use reth_trie_db::DatabaseStateRoot;
|
||||||
@ -23,7 +22,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
||||||
/// Execute `storage-tries` recovery command
|
/// Execute `storage-tries` recovery command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
_ctx: CliContext,
|
_ctx: CliContext,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
//! Database debugging tool
|
//! Database debugging tool
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
@ -10,7 +10,6 @@ use reth_db_common::{
|
|||||||
init::{insert_genesis_header, insert_genesis_history, insert_genesis_state},
|
init::{insert_genesis_header, insert_genesis_history, insert_genesis_state},
|
||||||
DbTool,
|
DbTool,
|
||||||
};
|
};
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_node_core::args::StageEnum;
|
use reth_node_core::args::StageEnum;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
writer::UnifiedStorageWriter, DatabaseProviderFactory, StaticFileProviderFactory,
|
writer::UnifiedStorageWriter, DatabaseProviderFactory, StaticFileProviderFactory,
|
||||||
@ -30,9 +29,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
||||||
/// Execute `db` command
|
/// Execute `db` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
let Environment { provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
let Environment { provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||||
|
|
||||||
let tool = DbTool::new(provider_factory)?;
|
let tool = DbTool::new(provider_factory)?;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use reth_db_api::{
|
|||||||
};
|
};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_evm::{execute::BlockExecutorProvider, noop::NoopBlockExecutorProvider};
|
use reth_evm::{execute::BlockExecutorProvider, noop::NoopBlockExecutorProvider};
|
||||||
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithDBAdapter};
|
use reth_node_builder::NodeTypesWithDB;
|
||||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::{ProviderNodeTypes, StaticFileProvider},
|
providers::{ProviderNodeTypes, StaticFileProvider},
|
||||||
@ -25,7 +25,7 @@ pub(crate) async fn dump_execution_stage<N, E>(
|
|||||||
executor: E,
|
executor: E,
|
||||||
) -> eyre::Result<()>
|
) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: ProviderNodeTypes,
|
N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>,
|
||||||
E: BlockExecutorProvider,
|
E: BlockExecutorProvider,
|
||||||
{
|
{
|
||||||
let (output_db, tip_block_number) = setup(from, to, &output_datadir.db(), db_tool)?;
|
let (output_db, tip_block_number) = setup(from, to, &output_datadir.db(), db_tool)?;
|
||||||
@ -36,7 +36,7 @@ where
|
|||||||
|
|
||||||
if should_run {
|
if should_run {
|
||||||
dry_run(
|
dry_run(
|
||||||
ProviderFactory::<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>::new(
|
ProviderFactory::<N>::new(
|
||||||
Arc::new(output_db),
|
Arc::new(output_db),
|
||||||
db_tool.chain(),
|
db_tool.chain(),
|
||||||
StaticFileProvider::read_write(output_datadir.static_files())?,
|
StaticFileProvider::read_write(output_datadir.static_files())?,
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use eyre::Result;
|
|||||||
use reth_db::{tables, DatabaseEnv};
|
use reth_db::{tables, DatabaseEnv};
|
||||||
use reth_db_api::{database::Database, table::TableImporter};
|
use reth_db_api::{database::Database, table::TableImporter};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_node_builder::NodeTypesWithDBAdapter;
|
|
||||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::{ProviderNodeTypes, StaticFileProvider},
|
providers::{ProviderNodeTypes, StaticFileProvider},
|
||||||
@ -15,7 +14,7 @@ use reth_provider::{
|
|||||||
use reth_stages::{stages::AccountHashingStage, Stage, StageCheckpoint, UnwindInput};
|
use reth_stages::{stages::AccountHashingStage, Stage, StageCheckpoint, UnwindInput};
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
pub(crate) async fn dump_hashing_account_stage<N: ProviderNodeTypes>(
|
pub(crate) async fn dump_hashing_account_stage<N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>>(
|
||||||
db_tool: &DbTool<N>,
|
db_tool: &DbTool<N>,
|
||||||
from: BlockNumber,
|
from: BlockNumber,
|
||||||
to: BlockNumber,
|
to: BlockNumber,
|
||||||
@ -37,7 +36,7 @@ pub(crate) async fn dump_hashing_account_stage<N: ProviderNodeTypes>(
|
|||||||
|
|
||||||
if should_run {
|
if should_run {
|
||||||
dry_run(
|
dry_run(
|
||||||
ProviderFactory::<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>::new(
|
ProviderFactory::<N>::new(
|
||||||
Arc::new(output_db),
|
Arc::new(output_db),
|
||||||
db_tool.chain(),
|
db_tool.chain(),
|
||||||
StaticFileProvider::read_write(output_datadir.static_files())?,
|
StaticFileProvider::read_write(output_datadir.static_files())?,
|
||||||
|
|||||||
@ -5,7 +5,6 @@ use eyre::Result;
|
|||||||
use reth_db::{tables, DatabaseEnv};
|
use reth_db::{tables, DatabaseEnv};
|
||||||
use reth_db_api::{database::Database, table::TableImporter};
|
use reth_db_api::{database::Database, table::TableImporter};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_node_builder::NodeTypesWithDBAdapter;
|
|
||||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::{ProviderNodeTypes, StaticFileProvider},
|
providers::{ProviderNodeTypes, StaticFileProvider},
|
||||||
@ -14,7 +13,7 @@ use reth_provider::{
|
|||||||
use reth_stages::{stages::StorageHashingStage, Stage, StageCheckpoint, UnwindInput};
|
use reth_stages::{stages::StorageHashingStage, Stage, StageCheckpoint, UnwindInput};
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
pub(crate) async fn dump_hashing_storage_stage<N: ProviderNodeTypes>(
|
pub(crate) async fn dump_hashing_storage_stage<N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>>(
|
||||||
db_tool: &DbTool<N>,
|
db_tool: &DbTool<N>,
|
||||||
from: u64,
|
from: u64,
|
||||||
to: u64,
|
to: u64,
|
||||||
@ -27,7 +26,7 @@ pub(crate) async fn dump_hashing_storage_stage<N: ProviderNodeTypes>(
|
|||||||
|
|
||||||
if should_run {
|
if should_run {
|
||||||
dry_run(
|
dry_run(
|
||||||
ProviderFactory::<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>::new(
|
ProviderFactory::<N>::new(
|
||||||
Arc::new(output_db),
|
Arc::new(output_db),
|
||||||
db_tool.chain(),
|
db_tool.chain(),
|
||||||
StaticFileProvider::read_write(output_datadir.static_files())?,
|
StaticFileProvider::read_write(output_datadir.static_files())?,
|
||||||
|
|||||||
@ -9,7 +9,6 @@ use reth_db_api::{database::Database, table::TableImporter};
|
|||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_evm::noop::NoopBlockExecutorProvider;
|
use reth_evm::noop::NoopBlockExecutorProvider;
|
||||||
use reth_exex::ExExManagerHandle;
|
use reth_exex::ExExManagerHandle;
|
||||||
use reth_node_builder::NodeTypesWithDBAdapter;
|
|
||||||
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
use reth_node_core::dirs::{ChainPath, DataDirPath};
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::{ProviderNodeTypes, StaticFileProvider},
|
providers::{ProviderNodeTypes, StaticFileProvider},
|
||||||
@ -25,7 +24,7 @@ use reth_stages::{
|
|||||||
};
|
};
|
||||||
use tracing::info;
|
use tracing::info;
|
||||||
|
|
||||||
pub(crate) async fn dump_merkle_stage<N: ProviderNodeTypes>(
|
pub(crate) async fn dump_merkle_stage<N: ProviderNodeTypes<DB = Arc<DatabaseEnv>>>(
|
||||||
db_tool: &DbTool<N>,
|
db_tool: &DbTool<N>,
|
||||||
from: BlockNumber,
|
from: BlockNumber,
|
||||||
to: BlockNumber,
|
to: BlockNumber,
|
||||||
@ -54,7 +53,7 @@ pub(crate) async fn dump_merkle_stage<N: ProviderNodeTypes>(
|
|||||||
|
|
||||||
if should_run {
|
if should_run {
|
||||||
dry_run(
|
dry_run(
|
||||||
ProviderFactory::<NodeTypesWithDBAdapter<N, Arc<DatabaseEnv>>>::new(
|
ProviderFactory::<N>::new(
|
||||||
Arc::new(output_db),
|
Arc::new(output_db),
|
||||||
db_tool.chain(),
|
db_tool.chain(),
|
||||||
StaticFileProvider::read_write(output_datadir.static_files())?,
|
StaticFileProvider::read_write(output_datadir.static_files())?,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
//! Database debugging tool
|
//! Database debugging tool
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
@ -10,7 +10,7 @@ use reth_db_api::{
|
|||||||
};
|
};
|
||||||
use reth_db_common::DbTool;
|
use reth_db_common::DbTool;
|
||||||
use reth_evm::execute::BlockExecutorProvider;
|
use reth_evm::execute::BlockExecutorProvider;
|
||||||
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithEngine};
|
use reth_node_builder::NodeTypesWithDB;
|
||||||
use reth_node_core::{
|
use reth_node_core::{
|
||||||
args::DatadirArgs,
|
args::DatadirArgs,
|
||||||
dirs::{DataDirPath, PlatformPath},
|
dirs::{DataDirPath, PlatformPath},
|
||||||
@ -92,7 +92,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
|
|||||||
/// Execute `dump-stage` command
|
/// Execute `dump-stage` command
|
||||||
pub async fn execute<N, E, F>(self, executor: F) -> eyre::Result<()>
|
pub async fn execute<N, E, F>(self, executor: F) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>,
|
N: CliNodeTypes<ChainSpec = C::ChainSpec>,
|
||||||
E: BlockExecutorProvider,
|
E: BlockExecutorProvider,
|
||||||
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use crate::common::CliNodeTypes;
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
use reth_chainspec::{EthChainSpec, EthereumHardforks};
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_runner::CliContext;
|
use reth_cli_runner::CliContext;
|
||||||
use reth_evm::execute::BlockExecutorProvider;
|
use reth_evm::execute::BlockExecutorProvider;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
|
|
||||||
pub mod drop;
|
pub mod drop;
|
||||||
pub mod dump;
|
pub mod dump;
|
||||||
@ -43,7 +43,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
|
|||||||
/// Execute `stage` command
|
/// Execute `stage` command
|
||||||
pub async fn execute<N, E, F>(self, ctx: CliContext, executor: F) -> eyre::Result<()>
|
pub async fn execute<N, E, F>(self, ctx: CliContext, executor: F) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>,
|
N: CliNodeTypes<ChainSpec = C::ChainSpec>,
|
||||||
E: BlockExecutorProvider,
|
E: BlockExecutorProvider,
|
||||||
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
//!
|
//!
|
||||||
//! Stage debugging tool
|
//! Stage debugging tool
|
||||||
|
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use alloy_eips::BlockHashOrNumber;
|
use alloy_eips::BlockHashOrNumber;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_beacon_consensus::EthBeaconConsensus;
|
use reth_beacon_consensus::EthBeaconConsensus;
|
||||||
@ -19,7 +19,6 @@ use reth_evm::execute::BlockExecutorProvider;
|
|||||||
use reth_exex::ExExManagerHandle;
|
use reth_exex::ExExManagerHandle;
|
||||||
use reth_network::BlockDownloaderProvider;
|
use reth_network::BlockDownloaderProvider;
|
||||||
use reth_network_p2p::HeadersClient;
|
use reth_network_p2p::HeadersClient;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_node_core::{
|
use reth_node_core::{
|
||||||
args::{NetworkArgs, StageEnum},
|
args::{NetworkArgs, StageEnum},
|
||||||
version::{
|
version::{
|
||||||
@ -106,7 +105,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
|
|||||||
/// Execute `stage` command
|
/// Execute `stage` command
|
||||||
pub async fn execute<N, E, F>(self, ctx: CliContext, executor: F) -> eyre::Result<()>
|
pub async fn execute<N, E, F>(self, ctx: CliContext, executor: F) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>,
|
N: CliNodeTypes<ChainSpec = C::ChainSpec>,
|
||||||
E: BlockExecutorProvider,
|
E: BlockExecutorProvider,
|
||||||
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
F: FnOnce(Arc<C::ChainSpec>) -> E,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
//! Unwinding a certain block range
|
//! Unwinding a certain block range
|
||||||
|
|
||||||
use crate::common::{AccessRights, Environment, EnvironmentArgs};
|
use crate::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use alloy_eips::BlockHashOrNumber;
|
use alloy_eips::BlockHashOrNumber;
|
||||||
use alloy_primitives::{BlockNumber, B256};
|
use alloy_primitives::{BlockNumber, B256};
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
@ -13,7 +13,6 @@ use reth_db::DatabaseEnv;
|
|||||||
use reth_downloaders::{bodies::noop::NoopBodiesDownloader, headers::noop::NoopHeaderDownloader};
|
use reth_downloaders::{bodies::noop::NoopBodiesDownloader, headers::noop::NoopHeaderDownloader};
|
||||||
use reth_evm::noop::NoopBlockExecutorProvider;
|
use reth_evm::noop::NoopBlockExecutorProvider;
|
||||||
use reth_exex::ExExManagerHandle;
|
use reth_exex::ExExManagerHandle;
|
||||||
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithEngine};
|
|
||||||
use reth_node_core::args::NetworkArgs;
|
use reth_node_core::args::NetworkArgs;
|
||||||
use reth_provider::{
|
use reth_provider::{
|
||||||
providers::ProviderNodeTypes, BlockExecutionWriter, BlockNumReader, ChainSpecProvider,
|
providers::ProviderNodeTypes, BlockExecutionWriter, BlockNumReader, ChainSpecProvider,
|
||||||
@ -50,9 +49,7 @@ pub struct Command<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C> {
|
||||||
/// Execute `db stage unwind` command
|
/// Execute `db stage unwind` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
let Environment { provider_factory, config, .. } = self.env.init::<N>(AccessRights::RW)?;
|
let Environment { provider_factory, config, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||||
|
|
||||||
let range = self.command.unwind_range(provider_factory.clone())?;
|
let range = self.command.unwind_range(provider_factory.clone())?;
|
||||||
@ -116,7 +113,7 @@ impl<C: ChainSpecParser<ChainSpec: EthChainSpec + EthereumHardforks>> Command<C>
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn build_pipeline<N: NodeTypesWithDB<ChainSpec = C::ChainSpec>>(
|
fn build_pipeline<N: ProviderNodeTypes<ChainSpec = C::ChainSpec>>(
|
||||||
self,
|
self,
|
||||||
config: Config,
|
config: Config,
|
||||||
provider_factory: ProviderFactory<N>,
|
provider_factory: ProviderFactory<N>,
|
||||||
|
|||||||
@ -11,11 +11,13 @@ use reth_network_p2p::{
|
|||||||
bodies::downloader::BodyDownloader,
|
bodies::downloader::BodyDownloader,
|
||||||
headers::downloader::{HeaderDownloader, SyncTarget},
|
headers::downloader::{HeaderDownloader, SyncTarget},
|
||||||
};
|
};
|
||||||
use reth_node_builder::NodeTypesWithDB;
|
|
||||||
use reth_node_events::node::NodeEvent;
|
use reth_node_events::node::NodeEvent;
|
||||||
use reth_optimism_chainspec::OpChainSpec;
|
use reth_optimism_chainspec::OpChainSpec;
|
||||||
use reth_optimism_evm::OpExecutorProvider;
|
use reth_optimism_evm::OpExecutorProvider;
|
||||||
use reth_provider::{BlockNumReader, ChainSpecProvider, HeaderProvider, ProviderFactory};
|
use reth_provider::{
|
||||||
|
providers::ProviderNodeTypes, BlockNumReader, ChainSpecProvider, HeaderProvider,
|
||||||
|
ProviderFactory,
|
||||||
|
};
|
||||||
use reth_prune::PruneModes;
|
use reth_prune::PruneModes;
|
||||||
use reth_stages::{sets::DefaultStages, Pipeline, StageSet};
|
use reth_stages::{sets::DefaultStages, Pipeline, StageSet};
|
||||||
use reth_stages_types::StageId;
|
use reth_stages_types::StageId;
|
||||||
@ -36,7 +38,7 @@ pub(crate) async fn build_import_pipeline<N, C>(
|
|||||||
disable_exec: bool,
|
disable_exec: bool,
|
||||||
) -> eyre::Result<(Pipeline<N>, impl Stream<Item = NodeEvent>)>
|
) -> eyre::Result<(Pipeline<N>, impl Stream<Item = NodeEvent>)>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithDB<ChainSpec = OpChainSpec>,
|
N: ProviderNodeTypes<ChainSpec = OpChainSpec>,
|
||||||
C: Consensus + 'static,
|
C: Consensus + 'static,
|
||||||
{
|
{
|
||||||
if !file_client.has_canonical_blocks() {
|
if !file_client.has_canonical_blocks() {
|
||||||
|
|||||||
@ -2,14 +2,13 @@
|
|||||||
//! file.
|
//! file.
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_consensus::noop::NoopConsensus;
|
use reth_consensus::noop::NoopConsensus;
|
||||||
use reth_db::tables;
|
use reth_db::tables;
|
||||||
use reth_db_api::transaction::DbTx;
|
use reth_db_api::transaction::DbTx;
|
||||||
use reth_downloaders::file_client::{
|
use reth_downloaders::file_client::{
|
||||||
ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE,
|
ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE,
|
||||||
};
|
};
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_node_core::version::SHORT_VERSION;
|
use reth_node_core::version::SHORT_VERSION;
|
||||||
use reth_optimism_chainspec::OpChainSpec;
|
use reth_optimism_chainspec::OpChainSpec;
|
||||||
use reth_optimism_primitives::bedrock::is_dup_tx;
|
use reth_optimism_primitives::bedrock::is_dup_tx;
|
||||||
@ -42,9 +41,7 @@ pub struct ImportOpCommand<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> ImportOpCommand<C> {
|
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> ImportOpCommand<C> {
|
||||||
/// Execute `import` command
|
/// Execute `import` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
info!(target: "reth::cli", "reth {} starting", SHORT_VERSION);
|
info!(target: "reth::cli", "reth {} starting", SHORT_VERSION);
|
||||||
|
|
||||||
info!(target: "reth::cli",
|
info!(target: "reth::cli",
|
||||||
|
|||||||
@ -5,14 +5,13 @@ use std::path::{Path, PathBuf};
|
|||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||||
use reth_db::tables;
|
use reth_db::tables;
|
||||||
use reth_downloaders::{
|
use reth_downloaders::{
|
||||||
file_client::{ChunkedFileReader, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
|
file_client::{ChunkedFileReader, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
|
||||||
receipt_file_client::ReceiptFileClient,
|
receipt_file_client::ReceiptFileClient,
|
||||||
};
|
};
|
||||||
use reth_execution_types::ExecutionOutcome;
|
use reth_execution_types::ExecutionOutcome;
|
||||||
use reth_node_builder::{NodeTypesWithDB, NodeTypesWithEngine};
|
|
||||||
use reth_node_core::version::SHORT_VERSION;
|
use reth_node_core::version::SHORT_VERSION;
|
||||||
use reth_optimism_chainspec::OpChainSpec;
|
use reth_optimism_chainspec::OpChainSpec;
|
||||||
use reth_optimism_primitives::bedrock::is_dup_tx;
|
use reth_optimism_primitives::bedrock::is_dup_tx;
|
||||||
@ -48,9 +47,7 @@ pub struct ImportReceiptsOpCommand<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> ImportReceiptsOpCommand<C> {
|
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> ImportReceiptsOpCommand<C> {
|
||||||
/// Execute `import` command
|
/// Execute `import` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
info!(target: "reth::cli", "reth {} starting", SHORT_VERSION);
|
info!(target: "reth::cli", "reth {} starting", SHORT_VERSION);
|
||||||
|
|
||||||
debug!(target: "reth::cli",
|
debug!(target: "reth::cli",
|
||||||
@ -88,7 +85,7 @@ pub async fn import_receipts_from_file<N, P, F>(
|
|||||||
filter: F,
|
filter: F,
|
||||||
) -> eyre::Result<()>
|
) -> eyre::Result<()>
|
||||||
where
|
where
|
||||||
N: NodeTypesWithDB<ChainSpec = OpChainSpec>,
|
N: ProviderNodeTypes<ChainSpec = OpChainSpec>,
|
||||||
P: AsRef<Path>,
|
P: AsRef<Path>,
|
||||||
F: FnMut(u64, &mut Receipts) -> usize,
|
F: FnMut(u64, &mut Receipts) -> usize,
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use reth_cli::chainspec::ChainSpecParser;
|
use reth_cli::chainspec::ChainSpecParser;
|
||||||
use reth_cli_commands::common::{AccessRights, Environment};
|
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment};
|
||||||
use reth_db_common::init::init_from_state_dump;
|
use reth_db_common::init::init_from_state_dump;
|
||||||
use reth_node_builder::NodeTypesWithEngine;
|
|
||||||
use reth_optimism_chainspec::OpChainSpec;
|
use reth_optimism_chainspec::OpChainSpec;
|
||||||
use reth_optimism_primitives::bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD};
|
use reth_optimism_primitives::bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD};
|
||||||
use reth_primitives::SealedHeader;
|
use reth_primitives::SealedHeader;
|
||||||
@ -36,9 +35,7 @@ pub struct InitStateCommandOp<C: ChainSpecParser> {
|
|||||||
|
|
||||||
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> InitStateCommandOp<C> {
|
impl<C: ChainSpecParser<ChainSpec = OpChainSpec>> InitStateCommandOp<C> {
|
||||||
/// Execute the `init` command
|
/// Execute the `init` command
|
||||||
pub async fn execute<N: NodeTypesWithEngine<ChainSpec = C::ChainSpec>>(
|
pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> {
|
||||||
self,
|
|
||||||
) -> eyre::Result<()> {
|
|
||||||
info!(target: "reth::cli", "Reth init-state starting");
|
info!(target: "reth::cli", "Reth init-state starting");
|
||||||
|
|
||||||
let Environment { config, provider_factory, .. } =
|
let Environment { config, provider_factory, .. } =
|
||||||
|
|||||||
Reference in New Issue
Block a user