This repository was archived by the owner on Aug 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -10,3 +10,12 @@ pub enum EthSenderError {
10
10
#[ error( "Token parsing error: {0}" ) ]
11
11
Parse ( #[ from] contract:: Error ) ,
12
12
}
13
+
14
+ impl EthSenderError {
15
+ pub fn is_transient ( & self ) -> bool {
16
+ match self {
17
+ EthSenderError :: EthereumGateway ( err) => err. is_transient ( ) ,
18
+ _ => false ,
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -232,6 +232,8 @@ impl EthTxManager {
232
232
. remove_tx_history ( tx_history_id)
233
233
. await
234
234
. unwrap ( ) ;
235
+ } else {
236
+ METRICS . l1_transient_errors . inc ( ) ;
235
237
}
236
238
Err ( error. into ( ) )
237
239
}
@@ -563,6 +565,9 @@ impl EthTxManager {
563
565
// Web3 API request failures can cause this,
564
566
// and anything more important is already properly reported.
565
567
tracing:: warn!( "eth_sender error {:?}" , e) ;
568
+ if e. is_transient ( ) {
569
+ METRICS . l1_transient_errors . inc ( ) ;
570
+ }
566
571
}
567
572
}
568
573
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ pub(super) struct EthSenderMetrics {
107
107
pub l1_blocks_waited_in_mempool : Family < ActionTypeLabel , Histogram < u64 > > ,
108
108
/// Number of L1 batches aggregated for publishing with a specific reason.
109
109
pub block_aggregation_reason : Family < AggregationReasonLabels , Counter > ,
110
+ pub l1_transient_errors : Counter ,
110
111
}
111
112
112
113
impl EthSenderMetrics {
You can’t perform that action at this time.
0 commit comments