@@ -123,7 +123,7 @@ impl Handler<DrReporterMsg> for DrReporter {
123123 msg. reports . retain ( |report| {
124124 if self . pending_dr_reports . contains ( & report. dr_id ) {
125125 // Timeout is not over yet, no action is needed
126- log:: debug!( "[{}]: currently being reported... " , report. dr_id) ;
126+ log:: debug!( "[{}] => ignored as it's currently being reported" , report. dr_id) ;
127127
128128 false
129129 } else {
@@ -228,14 +228,13 @@ impl Handler<DrReporterMsg> for DrReporter {
228228 )
229229 . await ;
230230
231- log:: debug!(
232- "[{:?}] will be reported in {} transactions" ,
233- dr_ids,
234- batched_reports. len( )
231+ log:: info!(
232+ "{:?} will be reported in {} transactions" ,
233+ dr_ids, batched_reports. len( ) ,
235234 ) ;
236235
237236 for ( batched_report, eth_gas_limit) in batched_reports {
238- log:: debug!( "Executing reportResultBatch {:?}" , batched_report) ;
237+ // log::debug!("Executing reportResultBatch {:?}", batched_report);
239238
240239 let receipt_fut = wrb_contract. call_with_confirmations (
241240 "reportResultBatch" ,
@@ -251,7 +250,7 @@ impl Handler<DrReporterMsg> for DrReporter {
251250 let receipt = tokio:: time:: timeout ( eth_tx_timeout, receipt_fut) . await ;
252251 match receipt {
253252 Ok ( Ok ( receipt) ) => {
254- log:: debug!( "[ {:?}]: tx receipt: {:?}" , dr_ids, receipt) ;
253+ log:: debug!( "{:?} <> {:?}" , dr_ids, receipt) ;
255254 match handle_receipt ( & receipt) . await {
256255 Ok ( ( ) ) => {
257256 let mut dismissed_dr_reports: HashSet < DrId > = Default :: default ( ) ;
@@ -261,7 +260,7 @@ impl Handler<DrReporterMsg> for DrReporter {
261260 {
262261 if dismissed_dr_reports. insert ( dismissed_dr_id) {
263262 log:: warn!(
264- "[{}]: dismissed => {} " ,
263+ "[{}] >< dismissed due to \" {} \" ... " ,
265264 dismissed_dr_id,
266265 reason
267266 ) ;
@@ -282,7 +281,7 @@ impl Handler<DrReporterMsg> for DrReporter {
282281 } else {
283282 // Finalize data requests that got successfully reported
284283 log:: info!(
285- "[{}]: success => drTallyTxHash: {}" ,
284+ "[{}] <= dr_tally_tx = {}" ,
286285 report. dr_id,
287286 report. dr_tally_tx_hash
288287 ) ;
@@ -298,8 +297,7 @@ impl Handler<DrReporterMsg> for DrReporter {
298297 }
299298 Err ( ( ) ) => {
300299 log:: error!(
301- "[{:?}]: evm tx failed: {}" ,
302- dr_ids,
300+ "reportResultBatch(..) tx reverted: {}" ,
303301 receipt. transaction_hash
304302 ) ;
305303 }
@@ -309,29 +307,32 @@ impl Handler<DrReporterMsg> for DrReporter {
309307 // Error in call_with_confirmations
310308 log:: error!(
311309 "{}: {:?}" ,
312- format!( "reportResultBatch{:?}" , & batched_report) ,
310+ format!( "Cannot call reportResultBatch{:?}" , & batched_report) ,
313311 e
314312 ) ;
315313 }
316314 Err ( elapsed) => {
317315 // Timeout is over
318- log:: warn!( "[{:?}]: evm tx timeout after {}" , dr_ids, elapsed) ;
316+ log:: warn!(
317+ "Timeout ({} secs) when calling reportResultBatch{:?}" ,
318+ elapsed, & batched_report
319+ ) ;
319320 }
320321 }
321322 }
322323
323324 if let Ok ( x) = eth. balance ( eth_from, None ) . await {
324325 if x < eth_from_balance {
325326 log:: warn!(
326- "EVM address {} loss: -{} ETH" ,
327+ "EVM address {} loss = -{} ETH" ,
327328 eth_from,
328329 Unit :: Wei ( & ( eth_from_balance - x) . to_string( ) )
329330 . to_eth_str( )
330331 . unwrap_or_default( )
331332 ) ;
332- } else {
333+ } else if x > eth_from_balance {
333334 log:: debug!(
334- "EVM address {} revenue: +{} ETH" ,
335+ "EVM address {} revenue = +{} ETH" ,
335336 eth_from,
336337 Unit :: Wei ( & ( x - eth_from_balance) . to_string( ) )
337338 . to_eth_str( )
@@ -425,8 +426,9 @@ async fn split_by_gas_limit(
425426 if let Err ( e) = estimated_gas {
426427 if batch_params. len ( ) <= 1 {
427428 // Skip this single-query batch if still not possible to estimate gas
428- log:: error!( "Cannot estimate gas limit: {:?}" , e) ;
429- log:: warn!( "Skipping report: {:?}" , batch_params) ;
429+ log:: error!( "Cannot estimate gas limit: {:?}" , e) ;
430+ log:: warn!( "Skipping report batch: {:?}" , batch_params) ;
431+
430432 } else {
431433 // Split batch in half if gas estimation is not possible
432434 let ( batch_tuples_1, batch_tuples_2) =
@@ -440,7 +442,7 @@ async fn split_by_gas_limit(
440442
441443 let estimated_gas = estimated_gas. unwrap ( ) ;
442444 log:: debug!(
443- "reportResultBatch (x{} drs) estimated gas: {:?}" ,
445+ "reportResultBatch (x{} drs) estimated gas: {:?}" ,
444446 batch_params. len( ) ,
445447 estimated_gas
446448 ) ;
@@ -499,11 +501,11 @@ async fn split_by_gas_limit(
499501 v. push ( ( batch_params, estimated_gas) ) ;
500502 continue ;
501503 }
502- Ok ( _) => {
503- if batch_params. len ( ) <= 1 {
504- log:: warn!( "Skipping unprofitable report: {:?}" , batch_params) ;
505- }
506- }
504+ // Ok(_) => {
505+ // if batch_params.len() <= 1 {
506+ // log::warn!("Skipping unprofitable report: {:?}", batch_params);
507+ // }
508+ // }
507509 Err ( e) => {
508510 if batch_params. len ( ) <= 1 {
509511 log:: error!( "Cannot estimate report profit: {:?}" , e) ;
0 commit comments