use discv5::IpMode;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("failed adding node to discv5, {0}")]
AddNodeFailed(&'static str),
#[error("incompatible key type (not secp256k1)")]
IncompatibleKeyType,
#[error("network stack identifier is not configured")]
NetworkStackIdNotConfigured,
#[error("fork missing on enr, key missing")]
ForkMissing(&'static [u8]),
#[error("failed to decode fork id, 'eth': {0:?}")]
ForkIdDecodeError(#[from] alloy_rlp::Error),
#[error("discovery socket missing")]
UnreachableDiscovery,
#[error("RLPx TCP socket missing")]
UnreachableRlpx,
#[error("RLPx TCP socket is unsupported IP version, local ip mode: {0:?}")]
IpVersionMismatchRlpx(IpMode),
#[error("init failed, {0}")]
InitFailure(&'static str),
#[error("sigp/discv5 error, {0}")]
Discv5Error(discv5::Error),
#[error("misconfigured listen config, RLPx TCP address must also be supported by discv5")]
ListenConfigMisconfigured,
}