mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
impl Resource Unavailable RPC error (#2072)
## Issue Addressed Related to #1891, The error is not in the spec yet (see ethereum/eth2.0-specs#2131) ## Proposed Changes Implement the proposed error, banning peers that send it ## Additional Info NA
This commit is contained in:
@@ -412,6 +412,12 @@ impl<TSpec: EthSpec> PeerManager<TSpec> {
|
||||
}
|
||||
RPCError::ErrorResponse(code, _) => match code {
|
||||
RPCResponseErrorCode::Unknown => PeerAction::HighToleranceError,
|
||||
RPCResponseErrorCode::ResourceUnavailable => {
|
||||
// NOTE: This error only makes sense for the `BlocksByRange` and `BlocksByRoot`
|
||||
// protocols. For the time being, there is no reason why a peer should send
|
||||
// this error.
|
||||
PeerAction::Fatal
|
||||
}
|
||||
RPCResponseErrorCode::ServerError => PeerAction::MidToleranceError,
|
||||
RPCResponseErrorCode::InvalidRequest => PeerAction::LowToleranceError,
|
||||
RPCResponseErrorCode::RateLimited => match protocol {
|
||||
|
||||
Reference in New Issue
Block a user