@@ -412,6 +412,7 @@ func (f *finalizer) handleTxProcessResp(ctx context.Context, tx *TxTracker, resu
412
412
413
413
// Store the processed transaction, add it to the batch and update status in the pool atomically
414
414
f .storeProcessedTx (ctx , oldStateRoot , tx , result )
415
+ metrics .TxProcessed (metrics .TxProcessedLabelSuccessful , 1 )
415
416
416
417
return nil
417
418
}
@@ -439,6 +440,8 @@ func (f *finalizer) storeProcessedTx(ctx context.Context, previousL2BlockStateRo
439
440
err := f .dbManager .UpdateTxStatus (ctx , txToDelete .Hash , pool .TxStatusFailed , false , txToDelete .FailedReason )
440
441
if err != nil {
441
442
log .Errorf ("failed to update status to failed in the pool for tx: %s, err: %s" , txToDelete .Hash .String (), err )
443
+ } else {
444
+ metrics .TxProcessed (metrics .TxProcessedLabelFailed , 1 )
442
445
}
443
446
}
444
447
metrics .WorkerProcessingTime (time .Since (start ))
@@ -465,6 +468,8 @@ func (f *finalizer) handleTransactionError(ctx context.Context, result *state.Pr
465
468
err := f .dbManager .UpdateTxStatus (ctx , tx .Hash , pool .TxStatusInvalid , false , & failedReason )
466
469
if err != nil {
467
470
log .Errorf ("failed to update status to failed in the pool for tx: %s, err: %s" , tx .Hash .String (), err )
471
+ } else {
472
+ metrics .TxProcessed (metrics .TxProcessedLabelInvalid , 1 )
468
473
}
469
474
}()
470
475
} else if (executor .IsInvalidNonceError (errorCode ) || executor .IsInvalidBalanceError (errorCode )) && ! tx .IsClaim {
@@ -484,6 +489,7 @@ func (f *finalizer) handleTransactionError(ctx context.Context, result *state.Pr
484
489
txToDelete := txToDelete
485
490
go func () {
486
491
err := f .dbManager .UpdateTxStatus (ctx , txToDelete .Hash , pool .TxStatusFailed , false , & failedReason )
492
+ metrics .TxProcessed (metrics .TxProcessedLabelFailed , 1 )
487
493
if err != nil {
488
494
log .Errorf ("failed to update status to failed in the pool for tx: %s, err: %s" , txToDelete .Hash .String (), err )
489
495
}
@@ -501,6 +507,8 @@ func (f *finalizer) handleTransactionError(ctx context.Context, result *state.Pr
501
507
err := f .dbManager .UpdateTxStatus (ctx , tx .Hash , pool .TxStatusFailed , false , & failedReason )
502
508
if err != nil {
503
509
log .Errorf ("failed to update status to failed in the pool for tx: %s, err: %s" , tx .Hash .String (), err )
510
+ } else {
511
+ metrics .TxProcessed (metrics .TxProcessedLabelFailed , 1 )
504
512
}
505
513
}()
506
514
}
0 commit comments