Skip to content

Commit bcbe08e

Browse files
authored
Improve transmission logs (#92)
1 parent 710d5a7 commit bcbe08e

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

chains/txmgr/broadcaster.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,7 @@ func (eb *Broadcaster[CID, HEAD, ADDR, THASH, BHASH, SEQ, FEE]) handleInProgress
464464

465465
lgr := etx.GetLogger(logger.With(eb.lggr, "fee", attempt.TxFee))
466466
errType, err := eb.client.SendTransactionReturnCode(ctx, etx, attempt, lgr)
467-
lgr.Infow("Broadcasted transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash, "tracingID", etx.GetTracingID(lgr), "meta", etx.Meta, "feeLimit",
468-
attempt.ChainSpecificFeeLimit, "callerProvidedFeeLimit", etx.FeeLimit, "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
467+
eb.lggr.Infow("Broadcasted transaction", "txHash", attempt.Hash, "tracingID", etx.GetTracingID(lgr), "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
469468

470469
// The validation below is only applicable to Hedera because it has instant finality and a unique sequence behavior
471470
if eb.chainType == hederaChainType {

chains/txmgr/confirmer.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -799,11 +799,9 @@ func (ec *Confirmer[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) ForceRebroadcas
799799
attempt.Tx = *etx // for logging
800800
errType, err := ec.client.SendTransactionReturnCode(ctx, *etx, attempt, ec.lggr)
801801
if errType == multinode.Successful || errType == multinode.TransactionAlreadyKnown {
802-
ec.lggr.Infow("ForceRebroadcast: Broadcasted transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash, "tracingID", etx.GetTracingID(ec.lggr), "meta", etx.Meta, "feeLimit",
803-
attempt.ChainSpecificFeeLimit, "callerProvidedFeeLimit", etx.FeeLimit, "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
802+
ec.lggr.Infow("ForceRebroadcast: Broadcasted transaction", "txHash", attempt.Hash, "tracingID", etx.GetTracingID(ec.lggr), "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
804803
} else {
805-
ec.lggr.Errorw("ForceRebroadcast: Broadcasted transaction", "txAttemptID", attempt.ID, "txHash", attempt.Hash, "tracingID", etx.GetTracingID(ec.lggr), "meta", etx.Meta, "feeLimit",
806-
attempt.ChainSpecificFeeLimit, "callerProvidedFeeLimit", etx.FeeLimit, "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
804+
ec.lggr.Errorw("ForceRebroadcast: Broadcasted transaction", "txHash", attempt.Hash, "tracingID", etx.GetTracingID(ec.lggr), "attempt", attempt, "etxID", etx.ID, "etx", etx, "errType", errType, "err", err)
807805
}
808806
}
809807
}

chains/txmgr/txmgr.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,11 +926,12 @@ func (b *Txm[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) pruneQueueAndCreateTxn
926926
if err != nil {
927927
return tx, err
928928
}
929-
b.logger.Debugw("Created transaction",
929+
b.logger.Infow("Created transaction",
930930
"fromAddress", txRequest.FromAddress,
931931
"toAddress", txRequest.ToAddress,
932932
"meta", txRequest.Meta,
933933
"transactionID", tx.ID,
934+
"tracingID", tx.GetTracingID(b.logger),
934935
)
935936

936937
return tx, nil

0 commit comments

Comments
 (0)