1use alloy_primitives::Sealable;
2use derive_more::{Display, Error};
3use reth_consensus::ConsensusError;
4use reth_primitives_traits::SealedHeader;
56/// Header downloader result
7pub type HeadersDownloaderResult<T, H> = Result<T, HeadersDownloaderError<H>>;
89/// Error variants that can happen when sending requests to a session.
10#[derive(Debug, Clone, Eq, PartialEq, Display, Error)]
11pub enum HeadersDownloaderError<H: Sealable> {
12/// The downloaded header cannot be attached to the local head,
13 /// but is valid otherwise.
14#[display("valid downloaded header cannot be attached to the local head: {error}")]
15DetachedHead {
16/// The local head we attempted to attach to.
17local_head: Box<SealedHeader<H>>,
18/// The header we attempted to attach.
19header: Box<SealedHeader<H>>,
20/// The error that occurred when attempting to attach the header.
21#[error(source)]
22error: Box<ConsensusError>,
23 },
24}