feat(eth-wire): update docs (#5450)

This commit is contained in:
DoTheBestToGetTheBest
2023-11-15 15:31:45 -08:00
committed by GitHub
parent 5e605d20a4
commit 0b46e16dcd

View File

@@ -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,
},
}