@@ -43,7 +43,7 @@ use lazy_static::lazy_static;
4343use mockall:: automock;
4444use reqwest:: Client ;
4545use tokio:: time:: sleep;
46- use tracing:: { info, warn} ;
46+ use tracing:: { error , info, warn} ;
4747
4848// For more details on state update, refer to the core contract logic
4949// https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/solidity/Output.sol
@@ -263,11 +263,13 @@ impl SettlementClient for EthereumSettlementClient {
263263 state_diff : Vec < Vec < u8 > > ,
264264 _nonce : u64 ,
265265 ) -> Result < String > {
266- tracing:: info!(
266+ // TODO(prakhar,20/11/2025): Update the logs to add custom formatter - https://github.com/madara-alliance/madara/blob/d2a1e8050a3d01ccf398f57616cbc4fb6386aaa6/madara/crates/client/analytics/src/formatter.rs#L288
267+ info ! (
267268 log_type = "starting" ,
268269 category = "update_state" ,
269- function_type = "blobs" ,
270- "Updating state with blobs."
270+ state_diff_len = %state_diff. len( ) ,
271+ program_output_len = %program_output. len( ) ,
272+ "Updating state with blob"
271273 ) ;
272274
273275 let mut mul_factor = GAS_PRICE_MULTIPLIER_START ;
@@ -279,8 +281,15 @@ impl SettlementClient for EthereumSettlementClient {
279281 Result :: Ok ( pending_transaction) => pending_transaction,
280282 Err ( e) => match e {
281283 SendTransactionError :: ReplacementTransactionUnderpriced ( e) => {
282- warn ! ( "Failed to send the state update transaction: {:?} with {:?} multiplication factor, trying again..." , e, mul_factor) ;
283- mul_factor = self . get_next_mul_factor ( mul_factor) ?;
284+ let next_mul_factor = self . get_next_mul_factor ( mul_factor) ?;
285+ warn ! (
286+ current_multiplier = %mul_factor,
287+ next_multiplier = %next_mul_factor,
288+ max_multiplier = %self . max_gas_price_mul_factor,
289+ error = ?e,
290+ "Transaction rejected due to low gas price, retrying with higher multiplier"
291+ ) ;
292+ mul_factor = next_mul_factor;
284293 continue ;
285294 }
286295 SendTransactionError :: Other ( _) => {
@@ -289,24 +298,29 @@ impl SettlementClient for EthereumSettlementClient {
289298 } ,
290299 } ;
291300
292- tracing :: info!(
301+ info ! (
293302 log_type = "completed" ,
294303 category = "update_state" ,
295304 function_type = "blobs" ,
296- "State updated with blobs."
305+ tx_hash = %pending_transaction. tx_hash( ) ,
306+ "State update transaction submitted to Ethereum with blobs"
297307 ) ;
298308
299- tracing:: warn!( "⏳ Waiting for txn finality..." ) ;
300-
301309 // Waiting for transaction finality
302310 let res = self . wait_for_tx_finality ( & pending_transaction. tx_hash ( ) . to_string ( ) ) . await ?;
303311
304312 match res {
305313 Some ( _) => {
306- tracing:: info!( "✅ Txn hash : {:?} finalized" , pending_transaction. tx_hash( ) . to_string( ) ) ;
314+ info ! (
315+ tx_hash = %pending_transaction. tx_hash( ) ,
316+ "Transaction finalized successfully"
317+ ) ;
307318 }
308319 None => {
309- tracing:: error!( "❌ Txn hash: {:?} not finalised" , pending_transaction. tx_hash( ) . to_string( ) ) ;
320+ error ! (
321+ tx_hash = %pending_transaction. tx_hash( ) ,
322+ "Transaction not finalized"
323+ ) ;
310324 }
311325 }
312326 return Ok ( pending_transaction. tx_hash ( ) . to_string ( ) ) ;
0 commit comments