Skip to content

Commit

Permalink
feat(eth-wire): update docs (#5450)
Browse files Browse the repository at this point in the history
  • Loading branch information
DoTheBestToGetTheBest authored Nov 15, 2023
1 parent 5e605d2 commit 0b46e16
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions crates/net/eth-wire/src/errors/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,37 @@ impl From<alloy_rlp::Error> for EthStreamError {
}
}

/// Error variants that can occur during the `eth` sub-protocol handshake.
/// Error that can occur during the `eth` sub-protocol handshake.
#[derive(thiserror::Error, Debug)]
#[allow(missing_docs)]

pub enum EthHandshakeError {
/// Status message received or sent outside of the handshake process.
#[error("status message can only be recv/sent in handshake")]
StatusNotInHandshake,
/// Receiving a non-status message during the handshake phase.
#[error("received non-status message when trying to handshake")]
NonStatusMessageInHandshake,
#[error("no response received when sending out handshake")]
/// No response received during the handshake process.
NoResponse,
#[error(transparent)]
/// Invalid fork data.
InvalidFork(#[from] ValidationError),
#[error("mismatched genesis in status message: {0}")]
/// Mismatch in the genesis block during status exchange.
MismatchedGenesis(GotExpectedBoxed<B256>),
#[error("mismatched protocol version in status message: {0}")]
/// Mismatched protocol versions in status messages.
MismatchedProtocolVersion(GotExpected<u8>),
#[error("mismatched chain in status message: {0}")]
/// Mismatch in chain details in status messages.
MismatchedChain(GotExpected<Chain>),
#[error("total difficulty bitlen is too large: got {got}, maximum {maximum}")]
TotalDifficultyBitLenTooLarge { got: usize, maximum: usize },
/// Excessively large total difficulty bit lengths.
TotalDifficultyBitLenTooLarge {
/// The actual bit length of the total difficulty.
got: usize,
/// The maximum allowed bit length for the total difficulty.
maximum: usize,
},
}

0 comments on commit 0b46e16

Please sign in to comment.