@@ -105,11 +105,19 @@ pub(crate) async fn process_pending_burns<E: linera_core::environment::Environme
105105
106106 match estimate_fits ( evm_client. estimate_add_block_gas ( & cert) . await ) {
107107 Ok ( true ) => {
108- submit_addblock ( monitor, evm_client, & cert, height, & event_indices) . await ;
108+ submit_addblock (
109+ monitor,
110+ evm_client,
111+ & cert,
112+ height,
113+ & event_indices,
114+ max_retries,
115+ )
116+ . await ;
109117 relay:: update_balance_metrics ( evm_client, linera_client) . await ;
110118 }
111119 Ok ( false ) => {
112- submit_chunked ( monitor, evm_client, & cert, height, & by_tx) . await ;
120+ submit_chunked ( monitor, evm_client, & cert, height, & by_tx, max_retries ) . await ;
113121 relay:: update_balance_metrics ( evm_client, linera_client) . await ;
114122 }
115123 Err ( error) => {
@@ -130,6 +138,7 @@ async fn submit_addblock<P: Provider>(
130138 cert : & linera_chain:: types:: ConfirmedBlockCertificate ,
131139 height : BlockHeight ,
132140 event_indices : & [ u32 ] ,
141+ max_retries : u32 ,
133142) {
134143 match evm_client. forward_cert ( cert) . await {
135144 Ok ( ( ) ) => {
@@ -143,7 +152,7 @@ async fn submit_addblock<P: Provider>(
143152 tracing:: warn!( ?height, ?error, "addBlock submission failed" ) ;
144153 let mut state = monitor. write ( ) . await ;
145154 for ei in event_indices {
146- state. mark_burn_retried ( height, * ei) ;
155+ state. mark_burn_retried ( height, * ei, max_retries ) . await ;
147156 }
148157 }
149158 }
@@ -158,11 +167,21 @@ async fn submit_chunked<P: Provider>(
158167 cert : & linera_chain:: types:: ConfirmedBlockCertificate ,
159168 height : BlockHeight ,
160169 by_tx : & [ ( u32 , Vec < u32 > ) ] ,
170+ max_retries : u32 ,
161171) {
162172 for ( tx_index, positions) in by_tx {
163173 let ( chunks, oversized) = split_to_fit ( evm_client, cert, * tx_index, positions) . await ;
164174 mark_oversized_failed ( monitor, height, * tx_index, & oversized) . await ;
165- submit_chunks_with_retry ( monitor, evm_client, cert, height, * tx_index, chunks) . await ;
175+ submit_chunks_with_retry (
176+ monitor,
177+ evm_client,
178+ cert,
179+ height,
180+ * tx_index,
181+ chunks,
182+ max_retries,
183+ )
184+ . await ;
166185 }
167186}
168187
@@ -246,6 +265,7 @@ async fn submit_chunks_with_retry<P: Provider>(
246265 height : BlockHeight ,
247266 tx_index : u32 ,
248267 events_chunks : Vec < Vec < u32 > > ,
268+ max_retries : u32 ,
249269) {
250270 for events_chunk in events_chunks {
251271 if let Err ( error) = evm_client
@@ -267,7 +287,7 @@ async fn submit_chunks_with_retry<P: Provider>(
267287 } ;
268288 let mut state = monitor. write ( ) . await ;
269289 for ei in to_bump {
270- state. mark_burn_retried ( height, ei) ;
290+ state. mark_burn_retried ( height, ei, max_retries ) . await ;
271291 }
272292 }
273293 }
0 commit comments