mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor: Consensus trait error type (#13655)
This commit is contained in:
@ -21,7 +21,7 @@ use reth_cli::chainspec::ChainSpecParser;
|
||||
use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, EnvironmentArgs};
|
||||
use reth_cli_runner::CliContext;
|
||||
use reth_consensus::{Consensus, FullConsensus};
|
||||
use reth_errors::RethResult;
|
||||
use reth_errors::{ConsensusError, RethResult};
|
||||
use reth_ethereum_payload_builder::EthereumBuilderConfig;
|
||||
use reth_evm::execute::{BlockExecutorProvider, Executor};
|
||||
use reth_execution_types::ExecutionOutcome;
|
||||
@ -128,7 +128,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
) -> eyre::Result<()> {
|
||||
let Environment { provider_factory, .. } = self.env.init::<N>(AccessRights::RW)?;
|
||||
|
||||
let consensus: Arc<dyn FullConsensus> =
|
||||
let consensus: Arc<dyn FullConsensus<Error = ConsensusError>> =
|
||||
Arc::new(EthBeaconConsensus::new(provider_factory.chain_spec()));
|
||||
|
||||
let executor = EthExecutorProvider::ethereum(provider_factory.chain_spec());
|
||||
|
||||
@ -18,6 +18,7 @@ use reth_downloaders::{
|
||||
bodies::bodies::BodiesDownloaderBuilder,
|
||||
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
|
||||
};
|
||||
use reth_errors::ConsensusError;
|
||||
use reth_exex::ExExManagerHandle;
|
||||
use reth_network::{BlockDownloaderProvider, NetworkHandle};
|
||||
use reth_network_api::NetworkInfo;
|
||||
@ -64,7 +65,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
&self,
|
||||
config: &Config,
|
||||
client: Client,
|
||||
consensus: Arc<dyn Consensus>,
|
||||
consensus: Arc<dyn Consensus<Error = ConsensusError>>,
|
||||
provider_factory: ProviderFactory<N>,
|
||||
task_executor: &TaskExecutor,
|
||||
static_file_producer: StaticFileProducer<ProviderFactory<N>>,
|
||||
@ -172,7 +173,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
let Environment { provider_factory, config, data_dir } =
|
||||
self.env.init::<N>(AccessRights::RW)?;
|
||||
|
||||
let consensus: Arc<dyn Consensus> =
|
||||
let consensus: Arc<dyn Consensus<Error = ConsensusError>> =
|
||||
Arc::new(EthBeaconConsensus::new(provider_factory.chain_spec()));
|
||||
|
||||
// Configure and build network
|
||||
|
||||
@ -10,7 +10,7 @@ use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, Environ
|
||||
use reth_cli_runner::CliContext;
|
||||
use reth_cli_util::get_secret_key;
|
||||
use reth_config::Config;
|
||||
use reth_consensus::Consensus;
|
||||
use reth_consensus::{Consensus, ConsensusError};
|
||||
use reth_db::tables;
|
||||
use reth_db_api::{cursor::DbCursorRO, transaction::DbTx};
|
||||
use reth_evm::execute::{BatchExecutor, BlockExecutorProvider};
|
||||
@ -129,7 +129,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
info!(target: "reth::cli", target_block_number=self.to, "Finished downloading tip of block range");
|
||||
|
||||
// build the full block client
|
||||
let consensus: Arc<dyn Consensus> =
|
||||
let consensus: Arc<dyn Consensus<Error = ConsensusError>> =
|
||||
Arc::new(EthBeaconConsensus::new(provider_factory.chain_spec()));
|
||||
let block_range_client = FullBlockClient::new(fetch_client, consensus);
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ use reth_cli_commands::common::{AccessRights, CliNodeTypes, Environment, Environ
|
||||
use reth_cli_runner::CliContext;
|
||||
use reth_cli_util::get_secret_key;
|
||||
use reth_config::Config;
|
||||
use reth_consensus::FullConsensus;
|
||||
use reth_consensus::{ConsensusError, FullConsensus};
|
||||
use reth_db::DatabaseEnv;
|
||||
use reth_engine_util::engine_store::{EngineMessageStore, StoredEngineApiMessage};
|
||||
use reth_ethereum_payload_builder::EthereumBuilderConfig;
|
||||
@ -97,7 +97,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>> Command<C> {
|
||||
let Environment { provider_factory, config, data_dir } =
|
||||
self.env.init::<N>(AccessRights::RW)?;
|
||||
|
||||
let consensus: Arc<dyn FullConsensus> =
|
||||
let consensus: Arc<dyn FullConsensus<Error = ConsensusError>> =
|
||||
Arc::new(EthBeaconConsensus::new(provider_factory.chain_spec()));
|
||||
|
||||
let executor = EthExecutorProvider::ethereum(provider_factory.chain_spec());
|
||||
|
||||
Reference in New Issue
Block a user