reth_discv5/
error.rs

1//! Errors interfacing with [`discv5::Discv5`].
2
3use discv5::IpMode;
4
5/// Errors interfacing with [`discv5::Discv5`].
6#[derive(thiserror::Error, Debug)]
7pub enum Error {
8    /// Failure adding node to [`discv5::Discv5`].
9    #[error("failed adding node to discv5, {0}")]
10    AddNodeFailed(&'static str),
11    /// Node record has incompatible key type.
12    #[error("incompatible key type (not secp256k1)")]
13    IncompatibleKeyType,
14    /// No key used to identify rlpx network is configured.
15    #[error("network stack identifier is not configured")]
16    NetworkStackIdNotConfigured,
17    /// Missing key used to identify rlpx network.
18    #[error("fork missing on enr, key missing")]
19    ForkMissing(&'static [u8]),
20    /// Failed to decode [`ForkId`](reth_ethereum_forks::ForkId) rlp value.
21    #[error("failed to decode fork id, 'eth': {0:?}")]
22    ForkIdDecodeError(#[from] alloy_rlp::Error),
23    /// Peer is unreachable over discovery.
24    #[error("discovery socket missing")]
25    UnreachableDiscovery,
26    /// Peer is unreachable over rlpx.
27    #[error("RLPx TCP socket missing")]
28    UnreachableRlpx,
29    /// Peer is not using same IP version as local node in rlpx.
30    #[error("RLPx TCP socket is unsupported IP version, local ip mode: {0:?}")]
31    IpVersionMismatchRlpx(IpMode),
32    /// Failed to initialize [`discv5::Discv5`].
33    #[error("init failed, {0}")]
34    InitFailure(&'static str),
35    /// An error from underlying [`discv5::Discv5`] node.
36    #[error("sigp/discv5 error, {0}")]
37    Discv5Error(discv5::Error),
38    /// The [`ListenConfig`](discv5::ListenConfig) has been misconfigured.
39    #[error("misconfigured listen config, RLPx TCP address must also be supported by discv5")]
40    ListenConfigMisconfigured,
41}