File tree Expand file tree Collapse file tree 9 files changed +976
-163
lines changed
beacon_node/lighthouse_network Expand file tree Collapse file tree 9 files changed +976
-163
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ pub static REPORT_PEER_MSGS: LazyLock<Result<IntCounterVec>> = LazyLock::new(||
206206 )
207207} ) ;
208208
209+ pub static OUTBOUND_REQUEST_IDLING : LazyLock < Result < Histogram > > = LazyLock :: new ( || {
210+ try_create_histogram (
211+ "outbound_request_idling_seconds" ,
212+ "The time our own request remained idle in the self-limiter" ,
213+ )
214+ } ) ;
215+
216+ pub static RESPONSE_IDLING : LazyLock < Result < Histogram > > = LazyLock :: new ( || {
217+ try_create_histogram (
218+ "response_idling_seconds" ,
219+ "The time our response remained idle in the response limiter" ,
220+ )
221+ } ) ;
222+
209223pub fn scrape_discovery_metrics ( ) {
210224 let metrics =
211225 discv5:: metrics:: Metrics :: from ( discv5:: Discv5 :: < discv5:: DefaultProtocolId > :: raw_metrics ( ) ) ;
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ where
141141 /// Waker, to be sure the handler gets polled when needed.
142142 waker : Option < std:: task:: Waker > ,
143143
144- /// Timeout that will me used for inbound and outbound responses.
144+ /// Timeout that will be used for inbound and outbound responses.
145145 resp_timeout : Duration ,
146146}
147147
@@ -314,6 +314,7 @@ where
314314 }
315315 return ;
316316 } ;
317+
317318 // If the response we are sending is an error, report back for handling
318319 if let RpcResponse :: Error ( ref code, ref reason) = response {
319320 self . events_out . push ( HandlerEvent :: Err ( HandlerErr :: Inbound {
@@ -331,6 +332,7 @@ where
331332 "Response not sent. Deactivated handler" ) ;
332333 return ;
333334 }
335+
334336 inbound_info. pending_items . push_back ( response) ;
335337 }
336338}
Original file line number Diff line number Diff line change @@ -606,6 +606,20 @@ pub enum ResponseTermination {
606606 LightClientUpdatesByRange ,
607607}
608608
609+ impl ResponseTermination {
610+ pub fn as_protocol ( & self ) -> Protocol {
611+ match self {
612+ ResponseTermination :: BlocksByRange => Protocol :: BlocksByRange ,
613+ ResponseTermination :: BlocksByRoot => Protocol :: BlocksByRoot ,
614+ ResponseTermination :: BlobsByRange => Protocol :: BlobsByRange ,
615+ ResponseTermination :: BlobsByRoot => Protocol :: BlobsByRoot ,
616+ ResponseTermination :: DataColumnsByRoot => Protocol :: DataColumnsByRoot ,
617+ ResponseTermination :: DataColumnsByRange => Protocol :: DataColumnsByRange ,
618+ ResponseTermination :: LightClientUpdatesByRange => Protocol :: LightClientUpdatesByRange ,
619+ }
620+ }
621+ }
622+
609623/// The structured response containing a result/code indicating success or failure
610624/// and the contents of the response
611625#[ derive( Debug , Clone ) ]
You can’t perform that action at this time.
0 commit comments