Skip to content

Commit 362bfed

Browse files
committed
Fix TXM stack overflow trigged by new logger
1 parent 139a324 commit 362bfed

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

chains/txmgr/confirmer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ func (ec *Confirmer[CID, HEAD, ADDR, THASH, BHASH, R, SEQ, FEE]) logFieldsPrevio
614614
return []interface{}{
615615
"etxID", etx.ID,
616616
"txHash", attempt.Hash,
617-
"previousAttempt", attempt,
617+
"previousAttempt", attempt.String(), // use string instead of direct attempt to prevent infinite loop for loggers that use fmt.Sprintf("%v")
618618
"feeLimit", attempt.ChainSpecificFeeLimit,
619619
"callerProvidedFeeLimit", etx.FeeLimit,
620620
"maxGasPrice", ec.feeConfig.MaxFeePrice(),

chains/txmgr/types/tx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ type TxAttempt[
189189
}
190190

191191
func (a *TxAttempt[CHAIN_ID, ADDR, TX_HASH, BLOCK_HASH, SEQ, FEE]) String() string {
192-
return fmt.Sprintf("TxAttempt(ID:%d,TxID:%d,Fee:%s,TxType:%d", a.ID, a.TxID, a.TxFee, a.TxType)
192+
return fmt.Sprintf("TxAttempt(ID:%d,TxID:%d,Fee:%s,TxType:%d,CreatedAt:%s)", a.ID, a.TxID, a.TxFee, a.TxType, a.CreatedAt.Format(time.RFC3339))
193193
}
194194

195195
type Tx[

0 commit comments

Comments
 (0)