mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
add a unique integer id to Rpc requests (#6444)
* add id to rpc requests * rename rpc request and response types for more accurate meaning * remove unrequired build_request function * remove unirequired Request wrapper types and unify Outbound and Inbound Request * add RequestId to NetworkMessage::SendResponse ,NetworkMessage::SendErrorResponse to be passed to Rpc::send_response
This commit is contained in:
@@ -252,7 +252,7 @@ pub trait RateLimiterItem {
|
||||
fn max_responses(&self) -> u64;
|
||||
}
|
||||
|
||||
impl<E: EthSpec> RateLimiterItem for super::InboundRequest<E> {
|
||||
impl<E: EthSpec> RateLimiterItem for super::RequestType<E> {
|
||||
fn protocol(&self) -> Protocol {
|
||||
self.versioned_protocol().protocol()
|
||||
}
|
||||
@@ -262,15 +262,6 @@ impl<E: EthSpec> RateLimiterItem for super::InboundRequest<E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> RateLimiterItem for super::OutboundRequest<E> {
|
||||
fn protocol(&self) -> Protocol {
|
||||
self.versioned_protocol().protocol()
|
||||
}
|
||||
|
||||
fn max_responses(&self) -> u64 {
|
||||
self.max_responses()
|
||||
}
|
||||
}
|
||||
impl RPCRateLimiter {
|
||||
pub fn new_with_config(config: RateLimiterConfig) -> Result<Self, &'static str> {
|
||||
// Destructure to make sure every configuration value is used.
|
||||
|
||||
Reference in New Issue
Block a user