refactor: Consensus trait error type (#13655)

This commit is contained in:
Tin Chung
2025-01-07 23:11:42 +07:00
committed by GitHub
parent b2c00418df
commit f7f2012156
33 changed files with 122 additions and 98 deletions

View File

@ -18,7 +18,7 @@ use crate::miner::{LocalMiner, MiningMode};
use futures_util::{Stream, StreamExt};
use reth_beacon_consensus::{BeaconConsensusEngineEvent, EngineNodeTypes};
use reth_chainspec::EthChainSpec;
use reth_consensus::FullConsensus;
use reth_consensus::{ConsensusError, FullConsensus};
use reth_engine_primitives::{BeaconEngineMessage, EngineValidator};
use reth_engine_service::service::EngineMessageStream;
use reth_engine_tree::{
@ -64,7 +64,7 @@ where
/// Constructor for [`LocalEngineService`].
#[allow(clippy::too_many_arguments)]
pub fn new<B, V>(
consensus: Arc<dyn FullConsensus<N::Primitives>>,
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
executor_factory: impl BlockExecutorProvider<Primitives = N::Primitives>,
provider: ProviderFactory<N>,
blockchain_db: BlockchainProvider2<N>,

View File

@ -2,7 +2,7 @@ use futures::{Stream, StreamExt};
use pin_project::pin_project;
use reth_beacon_consensus::{BeaconConsensusEngineEvent, EngineNodeTypes};
use reth_chainspec::EthChainSpec;
use reth_consensus::FullConsensus;
use reth_consensus::{ConsensusError, FullConsensus};
use reth_engine_primitives::{BeaconEngineMessage, EngineValidator};
use reth_engine_tree::{
backfill::PipelineSync,
@ -69,7 +69,7 @@ where
/// Constructor for `EngineService`.
#[allow(clippy::too_many_arguments)]
pub fn new<V>(
consensus: Arc<dyn FullConsensus<N::Primitives>>,
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
executor_factory: E,
chain_spec: Arc<N::ChainSpec>,
client: Client,

View File

@ -4,7 +4,7 @@ use crate::{engine::DownloadRequest, metrics::BlockDownloaderMetrics};
use alloy_consensus::BlockHeader;
use alloy_primitives::B256;
use futures::FutureExt;
use reth_consensus::Consensus;
use reth_consensus::{Consensus, ConsensusError};
use reth_network_p2p::{
full_block::{FetchFullBlockFuture, FetchFullBlockRangeFuture, FullBlockClient},
BlockClient,
@ -84,7 +84,7 @@ where
/// Create a new instance
pub fn new(
client: Client,
consensus: Arc<dyn Consensus<Client::Header, Client::Body>>,
consensus: Arc<dyn Consensus<Client::Header, Client::Body, Error = ConsensusError>>,
) -> Self {
Self {
full_block_client: FullBlockClient::new(client, consensus),

View File

@ -496,7 +496,7 @@ where
{
provider: P,
executor_provider: E,
consensus: Arc<dyn FullConsensus<N>>,
consensus: Arc<dyn FullConsensus<N, Error = ConsensusError>>,
payload_validator: V,
/// Keeps track of internals such as executed and buffered blocks.
state: EngineApiTreeState<N>,
@ -585,7 +585,7 @@ where
pub fn new(
provider: P,
executor_provider: E,
consensus: Arc<dyn FullConsensus<N>>,
consensus: Arc<dyn FullConsensus<N, Error = ConsensusError>>,
payload_validator: V,
outgoing: UnboundedSender<EngineApiEvent<N>>,
state: EngineApiTreeState<N>,
@ -643,7 +643,7 @@ where
pub fn spawn_new(
provider: P,
executor_provider: E,
consensus: Arc<dyn FullConsensus<N>>,
consensus: Arc<dyn FullConsensus<N, Error = ConsensusError>>,
payload_validator: V,
persistence: PersistenceHandle<N>,
payload_builder: PayloadBuilderHandle<T>,